summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2018-11-04 22:06:03 +0100
committerEvgeny Vereshchagin <evvers@ya.ru>2018-11-06 19:01:32 +0100
commite27aac11f26e6e42d14939e9348b2723f2d532ac (patch)
tree6c6faba520b2c624cfc1830899ac194dc0dd1732 /test
parent0621f03b133ef90b8df28046cae7dcbdc2a97eba (diff)
downloadsystemd-e27aac11f26e6e42d14939e9348b2723f2d532ac.tar.gz
systemd-e27aac11f26e6e42d14939e9348b2723f2d532ac.tar.bz2
systemd-e27aac11f26e6e42d14939e9348b2723f2d532ac.zip
networkd: make netdev_load_one "public" and add a fuzzer for it
Diffstat (limited to 'test')
-rw-r--r--test/fuzz/fuzz-netdev-parser/11-dummy.netdev3
-rw-r--r--test/fuzz/fuzz-netdev-parser/12-dummy.netdev3
-rw-r--r--test/fuzz/fuzz-netdev-parser/21-macvlan.netdev3
-rw-r--r--test/fuzz/fuzz-netdev-parser/21-macvtap.netdev3
-rw-r--r--test/fuzz/fuzz-netdev-parser/21-vlan.netdev10
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-bond-active-backup-slave.netdev6
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-bond.netdev18
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-bridge.netdev13
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-geneve.netdev12
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-gre-tunnel.netdev7
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-gretap-tunnel.netdev7
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-ip6gre-tunnel.netdev7
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-ip6tnl-tunnel.netdev8
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-ipip-tunnel-independent.netdev9
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-ipip-tunnel.netdev8
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-ipvlan.netdev6
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-sit-tunnel.netdev7
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-tap.netdev7
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-tun.netdev7
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-vcan.netdev3
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-veth.netdev8
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-vrf.netdev6
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-vti-tunnel.netdev7
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-vti6-tunnel.netdev7
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-vxlan.netdev16
-rw-r--r--test/fuzz/fuzz-netdev-parser/25-wireguard.netdev12
-rw-r--r--test/fuzz/fuzz-netdev-parser/26-bridge.netdev3
-rw-r--r--test/fuzz/fuzz-netdev-parser/github-106155
28 files changed, 211 insertions, 0 deletions
diff --git a/test/fuzz/fuzz-netdev-parser/11-dummy.netdev b/test/fuzz/fuzz-netdev-parser/11-dummy.netdev
new file mode 100644
index 0000000000..6797eb4b09
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/11-dummy.netdev
@@ -0,0 +1,3 @@
+[NetDev]
+Name=test1
+Kind=dummy
diff --git a/test/fuzz/fuzz-netdev-parser/12-dummy.netdev b/test/fuzz/fuzz-netdev-parser/12-dummy.netdev
new file mode 100644
index 0000000000..a7fdc0f7e0
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/12-dummy.netdev
@@ -0,0 +1,3 @@
+[NetDev]
+Name=dummy98
+Kind=dummy
diff --git a/test/fuzz/fuzz-netdev-parser/21-macvlan.netdev b/test/fuzz/fuzz-netdev-parser/21-macvlan.netdev
new file mode 100644
index 0000000000..e9a3c5b347
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/21-macvlan.netdev
@@ -0,0 +1,3 @@
+[NetDev]
+Name=macvlan99
+Kind=macvlan
diff --git a/test/fuzz/fuzz-netdev-parser/21-macvtap.netdev b/test/fuzz/fuzz-netdev-parser/21-macvtap.netdev
new file mode 100644
index 0000000000..2c23aacfb2
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/21-macvtap.netdev
@@ -0,0 +1,3 @@
+[NetDev]
+Name=macvtap99
+Kind=macvtap
diff --git a/test/fuzz/fuzz-netdev-parser/21-vlan.netdev b/test/fuzz/fuzz-netdev-parser/21-vlan.netdev
new file mode 100644
index 0000000000..fe9801c8a2
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/21-vlan.netdev
@@ -0,0 +1,10 @@
+[NetDev]
+Name=vlan99
+Kind=vlan
+
+[VLAN]
+Id=99
+GVRP=true
+MVRP=true
+LooseBinding=true
+ReorderHeader=true
diff --git a/test/fuzz/fuzz-netdev-parser/25-bond-active-backup-slave.netdev b/test/fuzz/fuzz-netdev-parser/25-bond-active-backup-slave.netdev
new file mode 100644
index 0000000000..1bbbf75570
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-bond-active-backup-slave.netdev
@@ -0,0 +1,6 @@
+[NetDev]
+Name=bond199
+Kind=bond
+
+[Bond]
+Mode=active-backup
diff --git a/test/fuzz/fuzz-netdev-parser/25-bond.netdev b/test/fuzz/fuzz-netdev-parser/25-bond.netdev
new file mode 100644
index 0000000000..61c54c4de0
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-bond.netdev
@@ -0,0 +1,18 @@
+[NetDev]
+Name=bond99
+Kind=bond
+
+[Bond]
+Mode=802.3ad
+TransmitHashPolicy=layer3+4
+MIIMonitorSec=1s
+LACPTransmitRate=fast
+UpDelaySec=2s
+DownDelaySec=2s
+ResendIGMP=4
+MinLinks=1
+AdActorSysPrio=1218
+AdUserPortKey=811
+AdActorSystem=00:11:22:33:44:55
+# feed the sanitizer
+AdActorSystem=00:11:22:33:44:55
diff --git a/test/fuzz/fuzz-netdev-parser/25-bridge.netdev b/test/fuzz/fuzz-netdev-parser/25-bridge.netdev
new file mode 100644
index 0000000000..e23abd5368
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-bridge.netdev
@@ -0,0 +1,13 @@
+[NetDev]
+Name=bridge99
+Kind=bridge
+
+[Bridge]
+HelloTimeSec=9
+MaxAgeSec=9
+ForwardDelaySec=9
+AgeingTimeSec=9
+Priority=9
+MulticastQuerier= true
+MulticastSnooping=true
+STP=true
diff --git a/test/fuzz/fuzz-netdev-parser/25-geneve.netdev b/test/fuzz/fuzz-netdev-parser/25-geneve.netdev
new file mode 100644
index 0000000000..279d71324e
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-geneve.netdev
@@ -0,0 +1,12 @@
+[NetDev]
+Name=geneve99
+Kind=geneve
+
+[GENEVE]
+Id=99
+Remote=192.168.22.1
+TTL=1
+UDPChecksum=true
+UDP6ZeroChecksumTx=true
+UDP6ZeroChecksumRx=true
+DestinationPort=6082
diff --git a/test/fuzz/fuzz-netdev-parser/25-gre-tunnel.netdev b/test/fuzz/fuzz-netdev-parser/25-gre-tunnel.netdev
new file mode 100644
index 0000000000..94d9320cdb
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-gre-tunnel.netdev
@@ -0,0 +1,7 @@
+[NetDev]
+Name=gretun99
+Kind=gre
+
+[Tunnel]
+Local=10.65.223.238
+Remote=10.65.223.239
diff --git a/test/fuzz/fuzz-netdev-parser/25-gretap-tunnel.netdev b/test/fuzz/fuzz-netdev-parser/25-gretap-tunnel.netdev
new file mode 100644
index 0000000000..769e7653e4
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-gretap-tunnel.netdev
@@ -0,0 +1,7 @@
+[NetDev]
+Name=gretap99
+Kind=gretap
+
+[Tunnel]
+Local=10.65.223.238
+Remote=10.65.223.239
diff --git a/test/fuzz/fuzz-netdev-parser/25-ip6gre-tunnel.netdev b/test/fuzz/fuzz-netdev-parser/25-ip6gre-tunnel.netdev
new file mode 100644
index 0000000000..b16e0b4969
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-ip6gre-tunnel.netdev
@@ -0,0 +1,7 @@
+[NetDev]
+Name=ip6gretap99
+Kind=ip6gretap
+
+[Tunnel]
+Local=2a00:ffde:4567:edde::4987
+Remote=2001:473:fece:cafe::5179
diff --git a/test/fuzz/fuzz-netdev-parser/25-ip6tnl-tunnel.netdev b/test/fuzz/fuzz-netdev-parser/25-ip6tnl-tunnel.netdev
new file mode 100644
index 0000000000..713e685ea1
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-ip6tnl-tunnel.netdev
@@ -0,0 +1,8 @@
+[NetDev]
+Name=ip6tnl99
+Kind=ip6tnl
+
+[Tunnel]
+Mode=ip6ip6
+Local=2a00:ffde:4567:edde::4987
+Remote=2001:473:fece:cafe::5179
diff --git a/test/fuzz/fuzz-netdev-parser/25-ipip-tunnel-independent.netdev b/test/fuzz/fuzz-netdev-parser/25-ipip-tunnel-independent.netdev
new file mode 100644
index 0000000000..36ff8d9429
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-ipip-tunnel-independent.netdev
@@ -0,0 +1,9 @@
+[NetDev]
+Name=ipiptun99
+Kind=ipip
+MTUBytes=1480
+
+[Tunnel]
+Local=192.168.223.238
+Remote=192.169.224.239
+Independent=true
diff --git a/test/fuzz/fuzz-netdev-parser/25-ipip-tunnel.netdev b/test/fuzz/fuzz-netdev-parser/25-ipip-tunnel.netdev
new file mode 100644
index 0000000000..159ac72703
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-ipip-tunnel.netdev
@@ -0,0 +1,8 @@
+[NetDev]
+Name=ipiptun99
+Kind=ipip
+MTUBytes=1480
+
+[Tunnel]
+Local=192.168.223.238
+Remote=192.169.224.239
diff --git a/test/fuzz/fuzz-netdev-parser/25-ipvlan.netdev b/test/fuzz/fuzz-netdev-parser/25-ipvlan.netdev
new file mode 100644
index 0000000000..9921b787a1
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-ipvlan.netdev
@@ -0,0 +1,6 @@
+[NetDev]
+Name=ipvlan99
+Kind=ipvlan
+
+[IPVLAN]
+Mode=L2
diff --git a/test/fuzz/fuzz-netdev-parser/25-sit-tunnel.netdev b/test/fuzz/fuzz-netdev-parser/25-sit-tunnel.netdev
new file mode 100644
index 0000000000..406d74bcf0
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-sit-tunnel.netdev
@@ -0,0 +1,7 @@
+[NetDev]
+Name=sittun99
+Kind=sit
+
+[Tunnel]
+Local=10.65.223.238
+Remote=10.65.223.239
diff --git a/test/fuzz/fuzz-netdev-parser/25-tap.netdev b/test/fuzz/fuzz-netdev-parser/25-tap.netdev
new file mode 100644
index 0000000000..bf5e7fe52c
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-tap.netdev
@@ -0,0 +1,7 @@
+[NetDev]
+Name=tap99
+Kind=tap
+
+[Tap]
+MultiQueue=true
+PacketInfo=true
diff --git a/test/fuzz/fuzz-netdev-parser/25-tun.netdev b/test/fuzz/fuzz-netdev-parser/25-tun.netdev
new file mode 100644
index 0000000000..380ab21552
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-tun.netdev
@@ -0,0 +1,7 @@
+[NetDev]
+Name=tun99
+Kind=tun
+
+[Tun]
+MultiQueue=true
+PacketInfo=true
diff --git a/test/fuzz/fuzz-netdev-parser/25-vcan.netdev b/test/fuzz/fuzz-netdev-parser/25-vcan.netdev
new file mode 100644
index 0000000000..ff1979536a
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-vcan.netdev
@@ -0,0 +1,3 @@
+[NetDev]
+Name=vcan99
+Kind=vcan
diff --git a/test/fuzz/fuzz-netdev-parser/25-veth.netdev b/test/fuzz/fuzz-netdev-parser/25-veth.netdev
new file mode 100644
index 0000000000..9ae4ad53b8
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-veth.netdev
@@ -0,0 +1,8 @@
+[NetDev]
+Name=veth99
+Kind=veth
+MACAddress=12:34:56:78:9a:bc
+
+[Peer]
+Name=veth-peer
+MACAddress=12:34:56:78:9a:bd
diff --git a/test/fuzz/fuzz-netdev-parser/25-vrf.netdev b/test/fuzz/fuzz-netdev-parser/25-vrf.netdev
new file mode 100644
index 0000000000..bf949ec293
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-vrf.netdev
@@ -0,0 +1,6 @@
+[NetDev]
+Name=vrf99
+Kind=vrf
+
+[VRF]
+TableId=42
diff --git a/test/fuzz/fuzz-netdev-parser/25-vti-tunnel.netdev b/test/fuzz/fuzz-netdev-parser/25-vti-tunnel.netdev
new file mode 100644
index 0000000000..cec6259781
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-vti-tunnel.netdev
@@ -0,0 +1,7 @@
+[NetDev]
+Name=vtitun99
+Kind=vti
+
+[Tunnel]
+Local=10.65.223.238
+Remote=10.65.223.239
diff --git a/test/fuzz/fuzz-netdev-parser/25-vti6-tunnel.netdev b/test/fuzz/fuzz-netdev-parser/25-vti6-tunnel.netdev
new file mode 100644
index 0000000000..d150c9ce86
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-vti6-tunnel.netdev
@@ -0,0 +1,7 @@
+[NetDev]
+Name=vti6tun99
+Kind=vti6
+
+[Tunnel]
+Local=2a00:ffde:4567:edde::4987
+Remote=2001:473:fece:cafe::5179
diff --git a/test/fuzz/fuzz-netdev-parser/25-vxlan.netdev b/test/fuzz/fuzz-netdev-parser/25-vxlan.netdev
new file mode 100644
index 0000000000..819a58356f
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-vxlan.netdev
@@ -0,0 +1,16 @@
+[NetDev]
+Name=vxlan99
+Kind=vxlan
+
+[VXLAN]
+Id=999
+L2MissNotification=true
+L3MissNotification=true
+RouteShortCircuit=true
+UDPChecksum=true
+UDP6ZeroChecksumTx=true
+UDP6ZeroChecksumRx=true
+RemoteChecksumTx=true
+RemoteChecksumRx=true
+GroupPolicyExtension=true
+DestinationPort=5555
diff --git a/test/fuzz/fuzz-netdev-parser/25-wireguard.netdev b/test/fuzz/fuzz-netdev-parser/25-wireguard.netdev
new file mode 100644
index 0000000000..e07d685129
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/25-wireguard.netdev
@@ -0,0 +1,12 @@
+[NetDev]
+Name=wg99
+Kind=wireguard
+
+[WireGuard]
+PrivateKey=EEGlnEPYJV//kbvvIqxKkQwOiS+UENyPncC4bF46ong=
+ListenPort=51820
+
+[WireGuardPeer]
+PublicKey=RDf+LSpeEre7YEIKaxg+wbpsNV7du+ktR99uBEtIiCA=
+AllowedIPs=fd31:bf08:57cb::/48,192.168.26.0/24
+Endpoint=wireguard.example.com:51820
diff --git a/test/fuzz/fuzz-netdev-parser/26-bridge.netdev b/test/fuzz/fuzz-netdev-parser/26-bridge.netdev
new file mode 100644
index 0000000000..9b31e06b5b
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/26-bridge.netdev
@@ -0,0 +1,3 @@
+[NetDev]
+Name=bridge99
+Kind=bridge
diff --git a/test/fuzz/fuzz-netdev-parser/github-10615 b/test/fuzz/fuzz-netdev-parser/github-10615
new file mode 100644
index 0000000000..1151ebfb47
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/github-10615
@@ -0,0 +1,5 @@
+[NetDev]
+Name=veth99
+Kind=veth
+MACAddress=12:34:56:78:9a:bc
+MACAddress=12:34:56:78:9a:bc