1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

test-network: add tests for Flags= in [IPVLAN]

This commit is contained in:
Yu Watanabe 2019-05-20 12:47:31 +09:00
parent 460feb6127
commit bc6dff6e25
2 changed files with 13 additions and 6 deletions

View File

@ -1,6 +1,3 @@
[NetDev]
Name=ipvlan99
Kind=ipvlan
[IPVLAN]
Mode=L2

View File

@ -547,10 +547,20 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
@expectedFailureIfModuleIsNotAvailable('ipvlan')
def test_ipvlan(self):
self.copy_unit_to_networkd_unit_path('25-ipvlan.netdev', '11-dummy.netdev', 'ipvlan.network')
self.start_networkd(0)
for mode, flag in [['L2', 'private'], ['L3', 'vepa'], ['L3S', 'bridge']]:
with self.subTest(mode=mode, flag=flag):
if mode != 'L2':
self.tearDown()
self.copy_unit_to_networkd_unit_path('25-ipvlan.netdev', '11-dummy.netdev', 'ipvlan.network')
with open(os.path.join(network_unit_file_path, '25-ipvlan.netdev'), mode='a') as f:
f.write('[IPVLAN]\nMode=' + mode + '\nFlags=' + flag)
self.wait_online(['ipvlan99:off', 'test1:degraded'])
self.start_networkd(0)
self.wait_online(['ipvlan99:off', 'test1:degraded'])
output = subprocess.check_output(['ip', '-d', 'link', 'show', 'ipvlan99'], universal_newlines=True).rstrip()
print(output)
self.assertRegex(output, 'ipvlan *mode ' + mode.lower() + ' ' + flag)
@expectedFailureIfModuleIsNotAvailable('ipvtap')
def test_ipvtap(self):