tests: shell: validate error reporting with include and glob
Pablo Neira Ayuso
maintainerPATCH 1/1 tests: shell: validate error reporting with include and glob
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- tests/shell/testcases/include/0018include_error_0 | 34 ++++++++++++ tests/shell/testcases/include/0019include_error_0 | 63 +++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100755 tests/shell/testcases/include/0018include_error_0 create mode 100755 tests/shell/testcases/include/0019include_error_0
tests/shell/testcases/include/0018include_error_0 new file +34 -0
@@ -0,0 +1,34 @@ +#!/bin/bash + +tmpfile1=$(mktemp) +if [ ! -w $tmpfile1 ] ; then + echo "Failed to create tmp file" >&2 + exit 1 +fi + +touch $tmpfile1 + +RULESET="include \"$tmpfile1\" +) +" + +tmpfile2=$(mktemp) +if [ ! -w $tmpfile2 ] ; then + echo "Failed to create tmp file" >&2 + exit 1 +fi + +tmpfile3=$(mktemp) +if [ ! -w $tmpfile3 ] ; then + echo "Failed to create tmp file" >&2 + exit 1 +fi + +echo "/dev/stdin:2:1-1: Error: syntax error, unexpected ')' +) +^" > $tmpfile3 + +$NFT -I/tmp/ -f - <<< "$RULESET" 2> $tmpfile2 +$DIFF -u $tmpfile2 $tmpfile3 + +rm $tmpfile1 $tmpfile2 $tmpfile3
tests/shell/testcases/include/0019include_error_0 new file +63 -0
63 lines not on this page · raw message
Signature · 1 line
2.11.0