Merge pull request #23412 from yuwata/network-bond-param

networkctl: bond param
This commit is contained in:
Luca Boccassi
2022-05-17 20:11:55 +01:00
committed by GitHub
2 changed files with 14 additions and 3 deletions

View File

@@ -1814,13 +1814,13 @@ static int link_status_one(
TABLE_STRING, bond_mode_to_string(info->mode),
TABLE_EMPTY,
TABLE_STRING, "Miimon:",
TABLE_TIMESPAN_MSEC, jiffies_to_usec(info->miimon),
TABLE_TIMESPAN_MSEC, info->miimon * USEC_PER_MSEC,
TABLE_EMPTY,
TABLE_STRING, "Updelay:",
TABLE_TIMESPAN_MSEC, jiffies_to_usec(info->updelay),
TABLE_TIMESPAN_MSEC, info->updelay * USEC_PER_MSEC,
TABLE_EMPTY,
TABLE_STRING, "Downdelay:",
TABLE_TIMESPAN_MSEC, jiffies_to_usec(info->downdelay));
TABLE_TIMESPAN_MSEC, info->downdelay * USEC_PER_MSEC);
if (r < 0)
return table_log_add_error(r);

View File

@@ -1218,6 +1218,17 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
self.assertEqual('balance-tlb 5', read_link_attr('bond98', 'bonding', 'mode'))
self.assertEqual('1', read_link_attr('bond98', 'bonding', 'tlb_dynamic_lb'))
output = check_output(*networkctl_cmd, '-n', '0', 'status', 'bond99', env=env)
print(output)
self.assertIn('Mode: 802.3ad', output)
self.assertIn('Miimon: 1s', output)
self.assertIn('Updelay: 2s', output)
self.assertIn('Downdelay: 2s', output)
output = check_output(*networkctl_cmd, '-n', '0', 'status', 'bond98', env=env)
print(output)
self.assertIn('Mode: balance-tlb', output)
def test_vlan(self):
copy_unit_to_networkd_unit_path('21-vlan.netdev', '11-dummy.netdev',
'21-vlan.network', '21-vlan-test1.network')