]> git.ipfire.org Git - thirdparty/nftables.git/commit
tests: validate generated netlink instructions
authorFlorian Westphal <fw@strlen.de>
Fri, 10 Jul 2015 09:56:31 +0000 (11:56 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 20 Jul 2015 15:26:37 +0000 (17:26 +0200)
commit0abfb2b7e01ca07efe1be16a1a5bd8925340dc41
tree0b4b3f892c990e66f4a01a5d5ba15d3a9c720d47
parentefd09355038d53fdd3841ab5ccae1543c4967daf
tests: validate generated netlink instructions

compare netlink instructions generated by given nft command line
with recorded version.

Example: udp dport 80 accept in ip family should look like

ip test-ip4 input
  [ payload load 1b @ network header + 9 => reg 1 ]
  [ cmp eq reg 1 0x00000011 ]
  [ payload load 2b @ transport header + 2 => reg 1 ]
  [ cmp eq reg 1 0x00005000 ]
  [ immediate reg 0 accept ]

This is stored in udp.t.payload.ip

Other suffixes:
.payload.ip6
.payload.inet
.payload ('any')

The test script first looks for 'testname.t.payload.$family', if that
doesn't exist 'testname.t.payload' is used.

This allows for family independent test (e.g. meta), where we don't
expect/have any family specific expressions.

Signed-off-by: Florian Westphal <fw@strlen.de>
65 files changed:
tests/regression/any/ct.t.payload [new file with mode: 0644]
tests/regression/any/frag.t.payload [new file with mode: 0644]
tests/regression/any/limit.t.payload [new file with mode: 0644]
tests/regression/any/log.t.payload [new file with mode: 0644]
tests/regression/any/meta.t.payload [new file with mode: 0644]
tests/regression/any/queue.t.payload [new file with mode: 0644]
tests/regression/arp/arp.t.payload [new file with mode: 0644]
tests/regression/arp/chains.t.payload [new file with mode: 0644]
tests/regression/bridge/chains.t.payload [new file with mode: 0644]
tests/regression/bridge/reject.t.payload [new file with mode: 0644]
tests/regression/inet/ah.t.payload.inet [new file with mode: 0644]
tests/regression/inet/ah.t.payload.ip [new file with mode: 0644]
tests/regression/inet/ah.t.payload.ip6 [new file with mode: 0644]
tests/regression/inet/comp.t.payload.inet [new file with mode: 0644]
tests/regression/inet/comp.t.payload.ip [new file with mode: 0644]
tests/regression/inet/comp.t.payload.ip6 [new file with mode: 0644]
tests/regression/inet/dccp.t.payload.inet [new file with mode: 0644]
tests/regression/inet/dccp.t.payload.ip [new file with mode: 0644]
tests/regression/inet/dccp.t.payload.ip6 [new file with mode: 0644]
tests/regression/inet/esp.t.payload.inet [new file with mode: 0644]
tests/regression/inet/esp.t.payload.ip [new file with mode: 0644]
tests/regression/inet/esp.t.payload.ip6 [new file with mode: 0644]
tests/regression/inet/reject.t.payload.inet [new file with mode: 0644]
tests/regression/inet/sctp.t.payload.inet [new file with mode: 0644]
tests/regression/inet/sctp.t.payload.ip [new file with mode: 0644]
tests/regression/inet/sctp.t.payload.ip6 [new file with mode: 0644]
tests/regression/inet/tcp.t.payload.inet [new file with mode: 0644]
tests/regression/inet/tcp.t.payload.ip [new file with mode: 0644]
tests/regression/inet/tcp.t.payload.ip6 [new file with mode: 0644]
tests/regression/inet/udp.t.payload.ip [new file with mode: 0644]
tests/regression/inet/udplite.t.payload.inet [new file with mode: 0644]
tests/regression/inet/udplite.t.payload.ip [new file with mode: 0644]
tests/regression/inet/udplite.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip/dnat.t.payload.ip [new file with mode: 0644]
tests/regression/ip/icmp.t.payload.ip [new file with mode: 0644]
tests/regression/ip/ip.t.payload [new file with mode: 0644]
tests/regression/ip/ip.t.payload.inet [new file with mode: 0644]
tests/regression/ip/masquerade.t.payload [new file with mode: 0644]
tests/regression/ip/redirect.t.payload [new file with mode: 0644]
tests/regression/ip/reject.t.payload [new file with mode: 0644]
tests/regression/ip/sets.t.payload.inet [new file with mode: 0644]
tests/regression/ip/sets.t.payload.ip [new file with mode: 0644]
tests/regression/ip/snat.t.payload [new file with mode: 0644]
tests/regression/ip6/dnat.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/dst.t.payload.inet [new file with mode: 0644]
tests/regression/ip6/dst.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/hbh.t.payload.inet [new file with mode: 0644]
tests/regression/ip6/hbh.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/icmpv6.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/ip6.t.payload.inet [new file with mode: 0644]
tests/regression/ip6/ip6.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/masquerade.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/mh.t.payload.inet [new file with mode: 0644]
tests/regression/ip6/mh.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/redirect.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/reject.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/rt.t.payload.inet [new file with mode: 0644]
tests/regression/ip6/rt.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/sets.t.payload [new file with mode: 0644]
tests/regression/ip6/sets.t.payload.inet [new file with mode: 0644]
tests/regression/ip6/sets.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/snat.t.payload.ip6 [new file with mode: 0644]
tests/regression/ip6/vmap.t.payload.inet [new file with mode: 0644]
tests/regression/ip6/vmap.t.payload.ip6 [new file with mode: 0644]
tests/regression/nft-test.py