summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fuzz/fuzz-netdev-parser/directives.netdev4
-rw-r--r--test/fuzz/fuzz-network-parser/directives.network4
-rw-r--r--test/mkosi.default.networkd-test18
-rw-r--r--test/test-network/conf/25-bareudp.netdev7
-rw-r--r--test/test-network/conf/25-qdisc-fq_pie.network11
-rw-r--r--test/test-network/conf/25-vxlan-independent.netdev17
-rw-r--r--test/test-network/conf/netdev-link-local-addressing-yes.network2
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py48
8 files changed, 102 insertions, 9 deletions
diff --git a/test/fuzz/fuzz-netdev-parser/directives.netdev b/test/fuzz/fuzz-netdev-parser/directives.netdev
index ef1f18fa40..a7aa76f498 100644
--- a/test/fuzz/fuzz-netdev-parser/directives.netdev
+++ b/test/fuzz/fuzz-netdev-parser/directives.netdev
@@ -116,6 +116,7 @@ PortRange=
UDPChecksum=
UDP6ZeroCheckSumTx=
IPDoNotFragment=
+Independent=
[VXCAN]
Peer=
[Bond]
@@ -215,3 +216,6 @@ Activate=
[Xfrm]
Independent=
InterfaceId=
+[BareUDP]
+DestinationPort=
+EtherType=
diff --git a/test/fuzz/fuzz-network-parser/directives.network b/test/fuzz/fuzz-network-parser/directives.network
index 054b630226..1494daa0c1 100644
--- a/test/fuzz/fuzz-network-parser/directives.network
+++ b/test/fuzz/fuzz-network-parser/directives.network
@@ -471,3 +471,7 @@ PriorityMap=
Parent=
Handle=
PacketLimit=
+[FlowQueuePIE]
+Parent=
+Handle=
+PacketLimit=
diff --git a/test/mkosi.default.networkd-test b/test/mkosi.default.networkd-test
index 6032c33c3a..c4fa569d41 100644
--- a/test/mkosi.default.networkd-test
+++ b/test/mkosi.default.networkd-test
@@ -1,11 +1,14 @@
# Puts together an nspawn container and runs networkd-test.py in it, inside a
-# network namespace and everything. Run this with "mkosi
-# --default=mkosi.default.networkd-test boot". This will start the test and
-# eventually exit with success in case the test succeeded.
+# network namespace and everything. Run this with
+#
+# mkosi -C test --default=mkosi.default.networkd-test boot
+#
+# This will start the test and eventually exit with success in case the test
+# succeeded.
[Distribution]
Distribution=fedora
-Release=29
+Release=32
[Output]
Format=raw_btrfs
@@ -45,13 +48,13 @@ BuildPackages=
libmount-devel
libseccomp-devel
libselinux-devel
- libtool
libxkbcommon-devel
libxslt
lz4
lz4-devel
m4
meson
+ ninja-build
pam-devel
pcre2-devel
pkgconfig
@@ -59,7 +62,6 @@ BuildPackages=
python3-lxml
qrencode-devel
tree
- xz-devel
Packages=
dnsmasq
@@ -69,8 +71,8 @@ Packages=
python3
# Share caches with the top-level mkosi
-BuildDirectory=../mkosi.builddir
-Cache=../mkosi.cache
+BuildDirectory=../mkosi/mkosi.builddir
+Cache=../mkosi/mkosi.cache
# Run our own script
BuildScript=mkosi.build.networkd-test
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/25-qdisc-fq_pie.network b/test/test-network/conf/25-qdisc-fq_pie.network
new file mode 100644
index 0000000000..9ba23328c8
--- /dev/null
+++ b/test/test-network/conf/25-qdisc-fq_pie.network
@@ -0,0 +1,11 @@
+[Match]
+Name=dummy98
+
+[Network]
+IPv6AcceptRA=no
+Address=10.1.2.3/16
+
+[FlowQueuePIE]
+Parent=root
+Handle=3a
+PacketLimit=200000
diff --git a/test/test-network/conf/25-vxlan-independent.netdev b/test/test-network/conf/25-vxlan-independent.netdev
new file mode 100644
index 0000000000..13b6cc8e7c
--- /dev/null
+++ b/test/test-network/conf/25-vxlan-independent.netdev
@@ -0,0 +1,17 @@
+[NetDev]
+Name=vxlan98
+Kind=vxlan
+
+[VXLAN]
+VNI=1000
+L2MissNotification=true
+L3MissNotification=true
+RouteShortCircuit=true
+UDPChecksum=true
+UDP6ZeroChecksumTx=true
+UDP6ZeroChecksumRx=true
+RemoteChecksumTx=true
+RemoteChecksumRx=true
+GroupPolicyExtension=true
+DestinationPort=5556
+Independent=yes
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 4b96a8231a..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
@@ -14,6 +15,7 @@ Name=ifb99
Name=ipiptun99
Name=nlmon99
Name=xfrm99
+Name=vxlan98
Name=hogehogehogehogehogehoge
[Network]
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index f2fd86aa4a..3e57b335ce 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -233,6 +233,18 @@ def expectedFailureIfETSIsNotAvailable():
return f
+def expectedFailureIfFQPIEIsNotAvailable():
+ def f(func):
+ call('ip link add dummy98 type dummy', stderr=subprocess.DEVNULL)
+ rc = call('tc qdisc add dev dummy98 parent root fq_pie', stderr=subprocess.DEVNULL)
+ call('ip link del dummy98', stderr=subprocess.DEVNULL)
+ if rc == 0:
+ return func
+ else:
+ return unittest.expectedFailure(func)
+
+ return f
+
def setUpModule():
global running_units
@@ -732,6 +744,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
links = [
'6rdtun99',
+ 'bareudp99',
'bond99',
'bridge99',
'dropin-test',
@@ -785,6 +798,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
'vtitun98',
'vtitun99',
'vxcan99',
+ 'vxlan98',
'vxlan99',
'wg97',
'wg98',
@@ -805,6 +819,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',
@@ -870,6 +885,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
'25-vti-tunnel-remote-any.netdev',
'25-vti-tunnel.netdev',
'25-vxcan.netdev',
+ '25-vxlan-independent.netdev',
'25-vxlan.netdev',
'25-wireguard-23-peers.netdev',
'25-wireguard-23-peers.network',
@@ -950,6 +966,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()
@@ -1516,10 +1544,11 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
def test_vxlan(self):
copy_unit_to_networkd_unit_path('25-vxlan.netdev', 'vxlan.network',
+ '25-vxlan-independent.netdev', 'netdev-link-local-addressing-yes.network',
'11-dummy.netdev', 'vxlan-test1.network')
start_networkd()
- self.wait_online(['test1:degraded', 'vxlan99:degraded'])
+ self.wait_online(['test1:degraded', 'vxlan99:degraded', 'vxlan98:degraded'])
output = check_output('ip -d link show vxlan99')
print(output)
@@ -1546,6 +1575,9 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
self.assertRegex(output, 'Destination Port: 5555')
self.assertRegex(output, 'Underlying Device: test1')
+ output = check_output('ip -d link show vxlan98')
+ print(output)
+
def test_macsec(self):
copy_unit_to_networkd_unit_path('25-macsec.netdev', '25-macsec.network', '25-macsec.key',
'macsec.network', '12-dummy.netdev')
@@ -1714,6 +1746,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
'25-qdisc-clsact-and-htb.network',
'25-qdisc-drr.network',
'25-qdisc-ets.network',
+ '25-qdisc-fq_pie.network',
'25-qdisc-hhf.network',
'25-qdisc-ingress-netem-compat.network',
'25-qdisc-pie.network',
@@ -2647,11 +2680,24 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
output = check_output('tc qdisc show dev dummy98')
print(output)
+
self.assertRegex(output, 'qdisc ets 3a: root')
self.assertRegex(output, 'bands 10 strict 3')
self.assertRegex(output, 'quanta 1 2 3 4 5')
self.assertRegex(output, 'priomap 3 4 5 6 7')
+ @expectedFailureIfFQPIEIsNotAvailable()
+ def test_qdisc_fq_pie(self):
+ copy_unit_to_networkd_unit_path('25-qdisc-fq_pie.network', '12-dummy.netdev')
+ start_networkd()
+ self.wait_online(['dummy98:routable'])
+
+ output = check_output('tc qdisc show dev dummy98')
+ print(output)
+
+ self.assertRegex(output, 'qdisc fq_pie 3a: root')
+ self.assertRegex(output, 'limit 200000p')
+
@expectedFailureIfNetdevsimWithSRIOVIsNotAvailable()
def test_sriov(self):
call('rmmod netdevsim', stderr=subprocess.DEVNULL)