From: Yu Watanabe Date: Wed, 10 Jul 2019 14:54:26 +0000 (+0900) Subject: test-network: add test for Xfrm netdev X-Git-Tag: v243~277^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e64dc40615f368741d891c6aec18b75b99e24bd7;p=platform%2Fupstream%2Fsystemd.git test-network: add test for Xfrm netdev --- diff --git a/test/test-network/conf/25-xfrm-independent.netdev b/test/test-network/conf/25-xfrm-independent.netdev new file mode 100644 index 0000000..8ed4321 --- /dev/null +++ b/test/test-network/conf/25-xfrm-independent.netdev @@ -0,0 +1,6 @@ +[NetDev] +Kind=xfrm +Name=xfrm99 + +[Xfrm] +Independent=yes diff --git a/test/test-network/conf/25-xfrm.netdev b/test/test-network/conf/25-xfrm.netdev new file mode 100644 index 0000000..81b32de --- /dev/null +++ b/test/test-network/conf/25-xfrm.netdev @@ -0,0 +1,3 @@ +[NetDev] +Kind=xfrm +Name=xfrm99 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 b76bfb3..d7dfa7e 100644 --- a/test/test-network/conf/netdev-link-local-addressing-yes.network +++ b/test/test-network/conf/netdev-link-local-addressing-yes.network @@ -12,6 +12,7 @@ Name=vrf99 Name=geneve99 Name=ipiptun99 Name=nlmon99 +Name=xfrm99 [Network] LinkLocalAddressing=yes diff --git a/test/test-network/conf/xfrm.network b/test/test-network/conf/xfrm.network new file mode 100644 index 0000000..bfb2956 --- /dev/null +++ b/test/test-network/conf/xfrm.network @@ -0,0 +1,6 @@ +[Match] +Name=dummy98 + +[Network] +IPv6AcceptRA=no +Xfrm=xfrm99 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index fc15927..2139c5f 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -461,7 +461,11 @@ class NetworkctlTests(unittest.TestCase, Utilities): class NetworkdNetDevTests(unittest.TestCase, Utilities): - links =[ + links_remove_earlier = [ + 'xfrm99', + ] + + links = [ '6rdtun99', 'bond99', 'bridge99', @@ -515,7 +519,8 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): 'vxcan99', 'vxlan99', 'wg98', - 'wg99'] + 'wg99', + ] units = [ '10-dropin-test.netdev', @@ -595,6 +600,8 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): '25-wireguard-private-key.txt', '25-wireguard.netdev', '25-wireguard.network', + '25-xfrm.netdev', + '25-xfrm-independent.netdev', '6rd.network', 'erspan.network', 'gre.network', @@ -615,7 +622,9 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): 'vti6.network', 'vti.network', 'vxlan-test1.network', - 'vxlan.network'] + 'vxlan.network', + 'xfrm.network', + ] fou_ports = [ '55555', @@ -623,11 +632,13 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): def setUp(self): remove_fou_ports(self.fou_ports) + remove_links(self.links_remove_earlier) remove_links(self.links) stop_networkd(show_logs=False) def tearDown(self): remove_fou_ports(self.fou_ports) + remove_links(self.links_remove_earlier) remove_links(self.links) remove_unit_from_networkd_path(self.units) stop_networkd(show_logs=True) @@ -1137,6 +1148,24 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): wait_online(['ipiptun99:carrier']) + @expectedFailureIfModuleIsNotAvailable('xfrm_interface') + def test_xfrm(self): + copy_unit_to_networkd_unit_path('12-dummy.netdev', 'xfrm.network', + '25-xfrm.netdev', 'netdev-link-local-addressing-yes.network') + start_networkd() + + wait_online(['xfrm99:degraded', 'dummy98:degraded']) + + output = check_output('ip link show dev xfrm99') + print(output) + + @expectedFailureIfModuleIsNotAvailable('xfrm_interface') + def test_xfrm_independent(self): + copy_unit_to_networkd_unit_path('25-xfrm-independent.netdev', 'netdev-link-local-addressing-yes.network') + start_networkd() + + wait_online(['xfrm99:degraded']) + @expectedFailureIfModuleIsNotAvailable('fou') def test_fou(self): # The following redundant check is necessary for CentOS CI.