diff options
author | Liping Zhang <zlpnobody@gmail.com> | 2016-11-08 23:06:37 +0800 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-12-04 21:24:48 +0100 |
commit | 8c01e1d6ec92720a7cd5c134a9fcea3953772e92 (patch) | |
tree | d853244f09b2e40bca4b40f80d4f92efee86898d | |
parent | 0a47216feab142ec56e7351b68cb33504615c4fd (diff) |
tests: shell: add test case for inserting element into verdict map
"dalegaard@gmail.com" reports that when inserting an element into a
verdict map, kernel crash will happen. Now add this test case so we
can avoid future regressions fail.
Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
Acked-by: Arturo Borrero Gonzalez <arturo@debian.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rwxr-xr-x | tests/shell/testcases/sets/0008create_verdict_map_0 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/shell/testcases/sets/0008create_verdict_map_0 b/tests/shell/testcases/sets/0008create_verdict_map_0 new file mode 100755 index 00000000..8ebb4509 --- /dev/null +++ b/tests/shell/testcases/sets/0008create_verdict_map_0 @@ -0,0 +1,25 @@ +#!/bin/bash + +tmpfile=$(mktemp) +if [ ! -w $tmpfile ] ; then + echo "Failed to create tmp file" >&2 + exit 0 +fi + +trap "rm -rf $tmpfile" EXIT # cleanup if aborted + +echo " +table ip t { + map sourcemap { + type ipv4_addr : verdict; + } + chain postrouting { + ip saddr vmap @sourcemap accept + } +} +add chain t c +add element t sourcemap { 100.123.10.2 : jump c } +" > $tmpfile + +set -e +$NFT -f $tmpfile |