]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add tests for BareUDP netdev 16929/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 17 Sep 2020 06:31:54 +0000 (15:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 17 Sep 2020 07:46:29 +0000 (16:46 +0900)
test/test-network/conf/25-bareudp.netdev [new file with mode: 0644]
test/test-network/conf/netdev-link-local-addressing-yes.network
test/test-network/systemd-networkd-tests.py

diff --git a/test/test-network/conf/25-bareudp.netdev b/test/test-network/conf/25-bareudp.netdev
new file mode 100644 (file)
index 0000000..2e76709
--- /dev/null
@@ -0,0 +1,7 @@
+[NetDev]
+Kind=bareudp
+Name=bareudp99
+
+[BareUDP]
+DestinationPort=1000
+EtherType=ipv4
index 4b96a8231ac2a0225b57106452a519590853e48d..5a4eea4e2315044c76c46aa151c2d5ff28aac660 100644 (file)
@@ -1,4 +1,5 @@
 [Match]
+Name=bareudp99
 Name=ipvlan99
 Name=ipvtap99
 Name=macvlan99
index 12f91bf3c9ea6b7e1d8700519059c8d6470592c1..d3084d0e9bb4373dffe295d2e08e7df1735e64d0 100755 (executable)
@@ -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()