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

test-network: add test for Xfrm netdev

This commit is contained in:
Yu Watanabe 2019-07-10 23:54:26 +09:00
parent 95082dbef5
commit e64dc40615
5 changed files with 48 additions and 3 deletions

View File

@ -0,0 +1,6 @@
[NetDev]
Kind=xfrm
Name=xfrm99
[Xfrm]
Independent=yes

View File

@ -0,0 +1,3 @@
[NetDev]
Kind=xfrm
Name=xfrm99

View File

@ -12,6 +12,7 @@ Name=vrf99
Name=geneve99
Name=ipiptun99
Name=nlmon99
Name=xfrm99
[Network]
LinkLocalAddressing=yes

View File

@ -0,0 +1,6 @@
[Match]
Name=dummy98
[Network]
IPv6AcceptRA=no
Xfrm=xfrm99

View File

@ -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.