]> git.ipfire.org Git - thirdparty/nftables.git/commit
tests/py: Support testing JSON input and output as well
authorPhil Sutter <phil@nwl.cc>
Tue, 8 May 2018 11:08:45 +0000 (13:08 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 11 May 2018 10:17:45 +0000 (12:17 +0200)
commitd196dccf1853039656f15c8da94ad349a3b7d07c
treeada3c2446bd764efd12fed37ea7a9bc16ab4b328
parent875232bc3e6bf55cc31f3763449503a80a7c2382
tests/py: Support testing JSON input and output as well

This extends nft-test.py by optional JSON testing capabilities,
activated via '-j'/'--enable-json' parameter).

JSON testing happens for all rules which are supposed to work: After a
rule has been added and the existing tests (payload, ruleset listing
output) have been performed, basically the same test is done again using
a recorded JSON equivalent and (if necessary) a recorded listing output.

The code tries to ease new test case creation overhead by
auto-generating JSON equivalent input via listing the (non-JSON) rule in
JSON format. Also, differing netlink debug and listing output are stored
in *.got files to assist in analyzing/fixing failing test cases.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
136 files changed:
tests/py/any/ct.t.json [new file with mode: 0644]
tests/py/any/ct.t.json.output [new file with mode: 0644]
tests/py/any/dup.t.json [new file with mode: 0644]
tests/py/any/fwd.t.json [new file with mode: 0644]
tests/py/any/fwd.t.json.output [new file with mode: 0644]
tests/py/any/limit.t.json [new file with mode: 0644]
tests/py/any/log.t.json [new file with mode: 0644]
tests/py/any/log.t.json.output [new file with mode: 0644]
tests/py/any/meta.t.json [new file with mode: 0644]
tests/py/any/meta.t.json.output [new file with mode: 0644]
tests/py/any/queue.t.json [new file with mode: 0644]
tests/py/any/queue.t.json.output [new file with mode: 0644]
tests/py/any/quota.t.json [new file with mode: 0644]
tests/py/any/rawpayload.t.json [new file with mode: 0644]
tests/py/any/rawpayload.t.json.output [new file with mode: 0644]
tests/py/any/rt.t.json [new file with mode: 0644]
tests/py/arp/arp.t.json [new file with mode: 0644]
tests/py/arp/arp.t.json.output [new file with mode: 0644]
tests/py/bridge/ether.t.json [new file with mode: 0644]
tests/py/bridge/ether.t.json.output [new file with mode: 0644]
tests/py/bridge/icmpX.t.json [new file with mode: 0644]
tests/py/bridge/icmpX.t.json.output [new file with mode: 0644]
tests/py/bridge/meta.t.json [new file with mode: 0644]
tests/py/bridge/reject.t.json [new file with mode: 0644]
tests/py/bridge/reject.t.json.output [new file with mode: 0644]
tests/py/bridge/vlan.t.json [new file with mode: 0644]
tests/py/inet/ah.t.json [new file with mode: 0644]
tests/py/inet/comp.t.json [new file with mode: 0644]
tests/py/inet/comp.t.json.output [new file with mode: 0644]
tests/py/inet/ct.t.json [new file with mode: 0644]
tests/py/inet/ct.t.json.output [new file with mode: 0644]
tests/py/inet/dccp.t.json [new file with mode: 0644]
tests/py/inet/dccp.t.json.output [new file with mode: 0644]
tests/py/inet/esp.t.json [new file with mode: 0644]
tests/py/inet/ether-ip.t.json [new file with mode: 0644]
tests/py/inet/ether-ip.t.json.output [new file with mode: 0644]
tests/py/inet/ether.t.json [new file with mode: 0644]
tests/py/inet/ether.t.json.output [new file with mode: 0644]
tests/py/inet/fib.t.json [new file with mode: 0644]
tests/py/inet/fib.t.json.output [new file with mode: 0644]
tests/py/inet/icmpX.t.json [new file with mode: 0644]
tests/py/inet/icmpX.t.json.output [new file with mode: 0644]
tests/py/inet/ip.t.json [new file with mode: 0644]
tests/py/inet/ip_tcp.t.json [new file with mode: 0644]
tests/py/inet/ip_tcp.t.json.output [new file with mode: 0644]
tests/py/inet/map.t.json [new file with mode: 0644]
tests/py/inet/map.t.json.output [new file with mode: 0644]
tests/py/inet/meta.t.json [new file with mode: 0644]
tests/py/inet/meta.t.json.output [new file with mode: 0644]
tests/py/inet/reject.t.json [new file with mode: 0644]
tests/py/inet/reject.t.json.output [new file with mode: 0644]
tests/py/inet/rt.t.json [new file with mode: 0644]
tests/py/inet/rt.t.json.output [new file with mode: 0644]
tests/py/inet/sctp.t.json [new file with mode: 0644]
tests/py/inet/tcp.t.json [new file with mode: 0644]
tests/py/inet/tcp.t.json.output [new file with mode: 0644]
tests/py/inet/tcpopt.t.json [new file with mode: 0644]
tests/py/inet/tcpopt.t.json.output [new file with mode: 0644]
tests/py/inet/udp.t.json [new file with mode: 0644]
tests/py/inet/udplite.t.json [new file with mode: 0644]
tests/py/ip/ct.t.json [new file with mode: 0644]
tests/py/ip/ct.t.json.output [new file with mode: 0644]
tests/py/ip/dnat.t.json [new file with mode: 0644]
tests/py/ip/dnat.t.json.output [new file with mode: 0644]
tests/py/ip/dup.t.json [new file with mode: 0644]
tests/py/ip/ether.t.json [new file with mode: 0644]
tests/py/ip/ether.t.json.output [new file with mode: 0644]
tests/py/ip/flowtable.t.json [new file with mode: 0644]
tests/py/ip/hash.t.json [new file with mode: 0644]
tests/py/ip/icmp.t.json [new file with mode: 0644]
tests/py/ip/icmp.t.json.output [new file with mode: 0644]
tests/py/ip/ip.t.json [new file with mode: 0644]
tests/py/ip/ip.t.json.output [new file with mode: 0644]
tests/py/ip/ip_tcp.t.json [new file with mode: 0644]
tests/py/ip/ip_tcp.t.json.output [new file with mode: 0644]
tests/py/ip/masquerade.t.json [new file with mode: 0644]
tests/py/ip/masquerade.t.json.output [new file with mode: 0644]
tests/py/ip/meta.t.json [new file with mode: 0644]
tests/py/ip/meta.t.json.output [new file with mode: 0644]
tests/py/ip/numgen.t.json [new file with mode: 0644]
tests/py/ip/numgen.t.json.output [new file with mode: 0644]
tests/py/ip/objects.t.json [new file with mode: 0644]
tests/py/ip/objects.t.json.output [new file with mode: 0644]
tests/py/ip/redirect.t.json [new file with mode: 0644]
tests/py/ip/redirect.t.json.output [new file with mode: 0644]
tests/py/ip/reject.t.json [new file with mode: 0644]
tests/py/ip/reject.t.json.output [new file with mode: 0644]
tests/py/ip/rt.t.json [new file with mode: 0644]
tests/py/ip/sets.t.json [new file with mode: 0644]
tests/py/ip/snat.t.json [new file with mode: 0644]
tests/py/ip/snat.t.json.output [new file with mode: 0644]
tests/py/ip/tcp.t.json [new file with mode: 0644]
tests/py/ip/tcp.t.json.output [new file with mode: 0644]
tests/py/ip/tcpopt.t.json [new file with mode: 0644]
tests/py/ip/tcpopt.t.json.output [new file with mode: 0644]
tests/py/ip6/dnat.t.json [new file with mode: 0644]
tests/py/ip6/dst.t.json [new file with mode: 0644]
tests/py/ip6/dst.t.json.output [new file with mode: 0644]
tests/py/ip6/dup.t.json [new file with mode: 0644]
tests/py/ip6/ether.t.json [new file with mode: 0644]
tests/py/ip6/ether.t.json.output [new file with mode: 0644]
tests/py/ip6/exthdr.t.json [new file with mode: 0644]
tests/py/ip6/exthdr.t.json.output [new file with mode: 0644]
tests/py/ip6/flowtable.t.json [new file with mode: 0644]
tests/py/ip6/frag.t.json [new file with mode: 0644]
tests/py/ip6/frag.t.json.output [new file with mode: 0644]
tests/py/ip6/hbh.t.json [new file with mode: 0644]
tests/py/ip6/hbh.t.json.output [new file with mode: 0644]
tests/py/ip6/icmpv6.t.json [new file with mode: 0644]
tests/py/ip6/icmpv6.t.json.output [new file with mode: 0644]
tests/py/ip6/ip6.t.json [new file with mode: 0644]
tests/py/ip6/ip6.t.json.output [new file with mode: 0644]
tests/py/ip6/map.t.json [new file with mode: 0644]
tests/py/ip6/map.t.json.output [new file with mode: 0644]
tests/py/ip6/masquerade.t.json [new file with mode: 0644]
tests/py/ip6/masquerade.t.json.output [new file with mode: 0644]
tests/py/ip6/meta.t.json [new file with mode: 0644]
tests/py/ip6/meta.t.json.output [new file with mode: 0644]
tests/py/ip6/mh.t.json [new file with mode: 0644]
tests/py/ip6/mh.t.json.output [new file with mode: 0644]
tests/py/ip6/redirect.t.json [new file with mode: 0644]
tests/py/ip6/redirect.t.json.output [new file with mode: 0644]
tests/py/ip6/reject.t.json [new file with mode: 0644]
tests/py/ip6/reject.t.json.output [new file with mode: 0644]
tests/py/ip6/rt.t.json [new file with mode: 0644]
tests/py/ip6/rt.t.json.output [new file with mode: 0644]
tests/py/ip6/rt0.t.json [new file with mode: 0644]
tests/py/ip6/sets.t.json [new file with mode: 0644]
tests/py/ip6/snat.t.json [new file with mode: 0644]
tests/py/ip6/srh.t.json [new file with mode: 0644]
tests/py/ip6/srh.t.json.output [new file with mode: 0644]
tests/py/ip6/tcpopt.t.json [new file with mode: 0644]
tests/py/ip6/tcpopt.t.json.output [new file with mode: 0644]
tests/py/ip6/vmap.t.json [new file with mode: 0644]
tests/py/ip6/vmap.t.json.output [new file with mode: 0644]
tests/py/nft-test.py