1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

test-network: add basic tests for veth interfaces

This commit is contained in:
Yu Watanabe 2019-05-20 15:29:54 +09:00
parent 3543304057
commit 671dacdf0c
2 changed files with 11 additions and 2 deletions

View File

@ -3,6 +3,8 @@ Name=ipvlan99
Name=ipvtap99
Name=macvlan99
Name=macvtap99
Name=veth99
Name=veth-peer
[Network]
LinkLocalAddressing=yes

View File

@ -585,10 +585,17 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
self.assertRegex(output, 'ipvtap *mode ' + mode.lower() + ' ' + flag)
def test_veth(self):
self.copy_unit_to_networkd_unit_path('25-veth.netdev')
self.copy_unit_to_networkd_unit_path('25-veth.netdev', 'netdev-link-local-addressing-yes.network')
self.start_networkd(0)
self.wait_online(['veth99:off', 'veth-peer:off'])
self.wait_online(['veth99:degraded', 'veth-peer:degraded'])
output = subprocess.check_output(['ip', '-d', 'link', 'show', 'veth99'], universal_newlines=True).rstrip()
print(output)
self.assertRegex(output, 'link/ether 12:34:56:78:9a:bc')
output = subprocess.check_output(['ip', '-d', 'link', 'show', 'veth-peer'], universal_newlines=True).rstrip()
print(output)
self.assertRegex(output, 'link/ether 12:34:56:78:9a:bd')
def test_dummy(self):
self.copy_unit_to_networkd_unit_path('11-dummy.netdev')