summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2018-11-06 19:42:29 +0100
committerEvgeny Vereshchagin <evvers@ya.ru>2018-11-06 19:42:29 +0100
commit220fa139dea5f2c18465f696333b2e646d0e40b5 (patch)
tree38a4628aa31ccecd0b857b890ee5569f2d1075f6
parentcf02fd1b7a80122b2a4366fb63925cd81dd80ce0 (diff)
downloadsystemd-220fa139dea5f2c18465f696333b2e646d0e40b5.tar.gz
systemd-220fa139dea5f2c18465f696333b2e646d0e40b5.tar.bz2
systemd-220fa139dea5f2c18465f696333b2e646d0e40b5.zip
tests: add a couple of files containing all the sections and directives
This should help the fuzzers to discover code paths faster. In case anyone is interested, they were generated with the following script ``` perl -aF'/[\s,]+/' -ne ' if (my ($s, $d) = ($F[0] =~ /^([^\s\.]+)\.([^\s\.]+)$/)) { $d{$s}{$d} = 1; } END { while (my ($key, $value) = each %d) { printf "[%s]\n%s\n", $key, join("\n", keys(%$value)) }}' ``` by passing src/network/networkd-network-gperf.gperf and src/network/netdev/netdev-gperf.gperf to it.
-rw-r--r--test/fuzz/fuzz-netdev-parser/directives.netdev153
-rw-r--r--test/fuzz/fuzz-network-parser/directives.network187
2 files changed, 340 insertions, 0 deletions
diff --git a/test/fuzz/fuzz-netdev-parser/directives.netdev b/test/fuzz/fuzz-netdev-parser/directives.netdev
new file mode 100644
index 0000000000..4725d2dad4
--- /dev/null
+++ b/test/fuzz/fuzz-netdev-parser/directives.netdev
@@ -0,0 +1,153 @@
+[VLAN]
+MVRP=
+LooseBinding=
+ReorderHeader=
+Id=
+GVRP=
+[MACVLAN]
+Mode=
+[WireGuard]
+ListenPort=
+PrivateKey=
+FwMark=
+[MACVTAP]
+Mode=
+[Match]
+Architecture=
+Host=
+KernelVersion=
+Virtualization=
+KernelCommandLine=
+[GENEVE]
+DestinationPort=
+TTL=
+UDP6ZeroCheckSumTx=
+TOS=
+Id=
+UDPChecksum=
+UDP6ZeroChecksumTx=
+FlowLabel=
+UDP6ZeroChecksumRx=
+Remote=
+UDP6ZeroCheckSumRx=
+[Bridge]
+ForwardDelaySec=
+HelloTimeSec=
+MaxAgeSec=
+STP=
+MulticastSnooping=
+DefaultPVID=
+MulticastQuerier=
+AgeingTimeSec=
+Priority=
+GroupForwardMask=
+VLANFiltering=
+[VRF]
+TableId=
+Table=
+[Peer]
+MACAddress=
+Name=
+[WireGuardPeer]
+Endpoint=
+PresharedKey=
+PersistentKeepalive=
+PublicKey=
+AllowedIPs=
+[Tunnel]
+FooOverUDP=
+IPv6FlowLabel=
+Remote=
+AllowLocalRemote=
+Local=
+TOS=
+Independent=
+Key=
+InputKey=
+Encapsulation=
+Mode=
+OutputKey=
+DiscoverPathMTU=
+FOUDestinationPort=
+CopyDSCP=
+EncapsulationLimit=
+TTL=
+FOUSourcePort=
+[VXLAN]
+UDP6ZeroChecksumRx=
+ARPProxy=
+FlowLabel=
+Local=
+RemoteChecksumTx=
+RouteShortCircuit=
+Remote=
+L3MissNotification=
+Group=
+FDBAgeingSec=
+MacLearning=
+Id=
+RemoteChecksumRx=
+TOS=
+L2MissNotification=
+UDP6ZeroChecksumTx=
+UDP6ZeroCheckSumRx=
+UDPCheckSum=
+GroupPolicyExtension=
+MaximumFDBEntries=
+TTL=
+DestinationPort=
+ReduceARPProxy=
+PortRange=
+UDPChecksum=
+UDP6ZeroCheckSumTx=
+[VXCAN]
+Peer=
+[Bond]
+LearnPacketIntervalSec=
+TransmitHashPolicy=
+MIIMonitorSec=
+PacketsPerSlave=
+DownDelaySec=
+PrimaryReselectPolicy=
+ResendIGMP=
+ARPAllTargets=
+AdActorSystemPriority=
+UpDelaySec=
+AdSelect=
+AdActorSystem=
+AdUserPortKey=
+FailOverMACPolicy=
+ARPValidate=
+Mode=
+GratuitousARP=
+ARPIPTargets=
+MinLinks=
+LACPTransmitRate=
+ARPIntervalSec=
+AllSlavesActive=
+[FooOverUDP]
+Protocol=
+Port=
+Encapsulation=
+[Tap]
+MultiQueue=
+OneQueue=
+User=
+Group=
+PacketInfo=
+VNetHeader=
+[IPVLAN]
+Mode=
+Flags=
+[Tun]
+OneQueue=
+MultiQueue=
+PacketInfo=
+Group=
+User=
+[NetDev]
+Kind=
+MACAddress=
+MTUBytes=
+Description=
+Name=
diff --git a/test/fuzz/fuzz-network-parser/directives.network b/test/fuzz/fuzz-network-parser/directives.network
new file mode 100644
index 0000000000..766c76008f
--- /dev/null
+++ b/test/fuzz/fuzz-network-parser/directives.network
@@ -0,0 +1,187 @@
+[Bridge]
+Cost=
+UseBPDU=
+HairPin=
+UnicastFlood=
+FastLeave=
+Priority=
+AllowPortToBeRoot=
+[Match]
+KernelVersion=
+Type=
+Driver=
+Architecture=
+Path=
+Name=
+Virtualization=
+KernelCommandLine=
+Host=
+MACAddress=
+[Link]
+RequiredForOnline=
+ARP=
+AllMulticast=
+Unmanaged=
+MTUBytes=
+Multicast=
+MACAddress=
+[BridgeFDB]
+VLANId=
+MACAddress=
+[DHCP]
+UseDomains=
+UseRoutes=
+IAID=
+UserClass=
+UseNTP=
+RapidCommit=
+ForceDHCPv6PDOtherInformation=
+UseMTU=
+UseDomainName=
+RouteMetric=
+SendHostname=
+Anonymize=
+VendorClassIdentifier=
+Hostname=
+DUIDType=
+UseHostname=
+UseDNS=
+CriticalConnection=
+DUIDRawData=
+RequestBroadcast=
+ClientIdentifier=
+ListenPort=
+UseTimezone=
+RouteTable=
+[Route]
+Destination=
+Protocol=
+Table=
+Gateway=
+InitialAdvertisedReceiveWindow=
+GatewayOnlink=
+Type=
+InitialCongestionWindow=
+IPv6Preference=
+PreferredSource=
+Scope=
+MTUBytes=
+QuickAck=
+Source=
+Metric=
+[Network]
+IPv6DuplicateAddressDetection=
+IPMasquerade=
+ProxyARP=
+PrimarySlave=
+IPv4LLRoute=
+Address=
+IPv6ProxyNDPAddress=
+IPv6AcceptRA=
+IPv6AcceptRouterAdvertisements=
+DNSSECNegativeTrustAnchors=
+MACVTAP=
+IPv6PrivacyExtensions=
+MACVLAN=
+MulticastDNS=
+LLDP=
+Tunnel=
+Gateway=
+IPv4LL=
+IPVLAN=
+EmitLLDP=
+IPv6MTUBytes=
+IPv4ProxyARP=
+Bridge=
+DNSOverTLS=
+Bond=
+IPv6ProxyNDP=
+DNS=
+ActiveSlave=
+LLMNR=
+DNSSEC=
+IPv6HopLimit=
+IPForward=
+IPv6Token=
+Description=
+VXLAN=
+LinkLocalAddressing=
+ConfigureWithoutCarrier=
+NTP=
+DHCP=
+Domains=
+IPv6PrefixDelegation=
+VLAN=
+DHCPServer=
+BindCarrier=
+VRF=
+[IPv6Prefix]
+Prefix=
+OnLink=
+PreferredLifetimeSec=
+AddressAutoconfiguration=
+ValidLifetimeSec=
+[BridgeVLAN]
+EgressUntagged=
+VLAN=
+PVID=
+[CAN]
+SamplePoint=
+BitRate=
+RestartSec=
+[Address]
+DuplicateAddressDetection=
+AutoJoin=
+PreferredLifetime=
+Address=
+Scope=
+HomeAddress=
+PrefixRoute=
+ManageTemporaryAddress=
+Broadcast=
+Peer=
+Label=
+[RoutingPolicyRule]
+Table=
+IncomingInterface=
+To=
+OutgoingInterface=
+From=
+TypeOfService=
+Priority=
+FirewallMark=
+[IPv6PrefixDelegation]
+RouterPreference=
+DNSLifetimeSec=
+DNS=
+RouterLifetimeSec=
+Domains=
+EmitDNS=
+EmitDomains=
+Managed=
+OtherInformation=
+[IPv6AddressLabel]
+Label=
+Prefix=
+[IPv6AcceptRA]
+UseDomains=
+RouteTable=
+UseDNS=
+[DHCPServer]
+EmitNTP=
+PoolSize=
+PoolOffset=
+Timezone=
+EmitDNS=
+NTP=
+EmitRouter=
+MaxLeaseTimeSec=
+DefaultLeaseTimeSec=
+EmitTimezone=
+DNS=
+[DHCPv4]
+UseHostname=
+UseMTU=
+UseDomainName=
+CriticalConnection=
+UseDNS=