From: Yu Watanabe Date: Mon, 20 May 2019 06:29:54 +0000 (+0900) Subject: test-network: add basic tests for veth interfaces X-Git-Tag: v243-rc1~388^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=671dacdf0c54626ea9c1b1efa5903a6dbab50be3;p=thirdparty%2Fsystemd.git test-network: add basic tests for veth interfaces --- diff --git a/test/test-network/conf/netdev-link-local-addressing-yes.network b/test/test-network/conf/netdev-link-local-addressing-yes.network index 5a8513493c5..8bcace9888b 100644 --- a/test/test-network/conf/netdev-link-local-addressing-yes.network +++ b/test/test-network/conf/netdev-link-local-addressing-yes.network @@ -3,6 +3,8 @@ Name=ipvlan99 Name=ipvtap99 Name=macvlan99 Name=macvtap99 +Name=veth99 +Name=veth-peer [Network] LinkLocalAddressing=yes diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index dc2b96e2b22..d28efd90e33 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -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')