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

test-network: add tests for BareUDP netdev

This commit is contained in:
Yu Watanabe 2020-09-17 15:31:54 +09:00
parent b0486c732a
commit 130604719a
3 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,7 @@
[NetDev]
Kind=bareudp
Name=bareudp99
[BareUDP]
DestinationPort=1000
EtherType=ipv4

View File

@ -1,4 +1,5 @@
[Match]
Name=bareudp99
Name=ipvlan99
Name=ipvtap99
Name=macvlan99

View File

@ -732,6 +732,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
links = [
'6rdtun99',
'bareudp99',
'bond99',
'bridge99',
'dropin-test',
@ -805,6 +806,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
'21-vlan.netdev',
'21-vlan.network',
'25-6rd-tunnel.netdev',
'25-bareudp.netdev',
'25-bond.netdev',
'25-bond-balanced-tlb.netdev',
'25-bridge.netdev',
@ -950,6 +952,18 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
self.wait_operstate('bridge99', '(off|no-carrier)', setup_state='configuring')
self.wait_operstate('test1', 'degraded')
@expectedFailureIfModuleIsNotAvailable('bareudp')
def test_bareudp(self):
copy_unit_to_networkd_unit_path('25-bareudp.netdev', 'netdev-link-local-addressing-yes.network')
start_networkd()
self.wait_online(['bareudp99:degraded'])
output = check_output('ip -d link show bareudp99')
print(output)
self.assertRegex(output, 'dstport 1000 ')
self.assertRegex(output, 'ethertype ip ')
def test_bridge(self):
copy_unit_to_networkd_unit_path('25-bridge.netdev', '25-bridge-configure-without-carrier.network')
start_networkd()