test-network: try to change MAC address more

Follow-up for 23b6bf274f.
This commit is contained in:
Yu Watanabe 2022-12-07 13:53:37 +09:00 committed by Luca Boccassi
parent ed7c45a8c8
commit b448fc0a6f
2 changed files with 15 additions and 6 deletions

View file

@ -4,6 +4,3 @@ Name=bond199
[Network]
IPv6AcceptRA=no
[Link]
MACAddress=00:11:22:33:44:55

View file

@ -3871,7 +3871,7 @@ class NetworkdBondTests(unittest.TestCase, Utilities):
output = check_output('ip -d link show bond199')
print(output)
self.assertRegex(output, 'active_slave dummy98')
self.assertIn('active_slave dummy98', output)
def test_bond_primary_slave(self):
copy_network_unit('23-primary-slave.network', '23-bond199.network', '25-bond-active-backup-slave.netdev', '12-dummy.netdev')
@ -3880,8 +3880,20 @@ class NetworkdBondTests(unittest.TestCase, Utilities):
output = check_output('ip -d link show bond199')
print(output)
self.assertRegex(output, 'primary dummy98')
self.assertIn('link/ether 00:11:22:33:44:55', output)
self.assertIn('primary dummy98', output)
# for issue #25627
mkdir_p(os.path.join(network_unit_dir, '23-bond199.network.d'))
for mac in ['00:11:22:33:44:55', '00:11:22:33:44:56']:
with open(os.path.join(network_unit_dir, '23-bond199.network.d/mac.conf'), mode='w', encoding='utf-8') as f:
f.write(f'[Link]\nMACAddress={mac}\n')
networkctl_reload()
self.wait_online(['dummy98:enslaved', 'bond199:degraded'])
output = check_output('ip -d link show bond199')
print(output)
self.assertIn(f'link/ether {mac}', output)
def test_bond_operstate(self):
copy_network_unit('25-bond.netdev', '11-dummy.netdev', '12-dummy.netdev',