summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2020-09-17 13:34:15 +0200
committerGitHub <noreply@github.com>2020-09-17 13:34:15 +0200
commitdc0e90d2e00552df3a45e5ccad74ed37dc23a38e (patch)
treec2f08876daf2dbbee83b3742594665f85e8f74bc /test
parentMerge pull request #17073 from ssahani/vxlan (diff)
parenttest-network: add tests for BareUDP netdev (diff)
downloadsystemd-dc0e90d2e00552df3a45e5ccad74ed37dc23a38e.tar.xz
systemd-dc0e90d2e00552df3a45e5ccad74ed37dc23a38e.zip
Merge pull request #16929 from ssahani/network-bare-udp
network: introduce Bare UDP Tunnelling
Diffstat (limited to 'test')
-rw-r--r--test/fuzz/fuzz-netdev-parser/directives.netdev3
-rw-r--r--test/test-network/conf/25-bareudp.netdev7
-rw-r--r--test/test-network/conf/netdev-link-local-addressing-yes.network1
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py14
4 files changed, 25 insertions, 0 deletions
diff --git a/test/fuzz/fuzz-netdev-parser/directives.netdev b/test/fuzz/fuzz-netdev-parser/directives.netdev
index 4c223f908e..a7aa76f498 100644
--- a/test/fuzz/fuzz-netdev-parser/directives.netdev
+++ b/test/fuzz/fuzz-netdev-parser/directives.netdev
@@ -216,3 +216,6 @@ Activate=
[Xfrm]
Independent=
InterfaceId=
+[BareUDP]
+DestinationPort=
+EtherType=
diff --git a/test/test-network/conf/25-bareudp.netdev b/test/test-network/conf/25-bareudp.netdev
new file mode 100644
index 0000000000..2e76709d88
--- /dev/null
+++ b/test/test-network/conf/25-bareudp.netdev
@@ -0,0 +1,7 @@
+[NetDev]
+Kind=bareudp
+Name=bareudp99
+
+[BareUDP]
+DestinationPort=1000
+EtherType=ipv4
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 3384fde581..1a22390a33 100644
--- a/test/test-network/conf/netdev-link-local-addressing-yes.network
+++ b/test/test-network/conf/netdev-link-local-addressing-yes.network
@@ -1,4 +1,5 @@
[Match]
+Name=bareudp99
Name=ipvlan99
Name=ipvtap99
Name=macvlan99
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index 21d95c7f66..f74fbd7c42 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -732,6 +732,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
links = [
'6rdtun99',
+ 'bareudp99',
'bond99',
'bridge99',
'dropin-test',
@@ -806,6 +807,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',
@@ -952,6 +954,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()