summaryrefslogtreecommitdiffstats
path: root/tests/echo/run-tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/echo/run-tests.sh')
-rwxr-xr-xtests/echo/run-tests.sh45
1 files changed, 0 insertions, 45 deletions
diff --git a/tests/echo/run-tests.sh b/tests/echo/run-tests.sh
deleted file mode 100755
index da7934d1..00000000
--- a/tests/echo/run-tests.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/bash
-
-cd $(dirname $0)
-nft=../../src/nft
-nft_opts="-nn -a --echo"
-debug=false
-
-debug_echo() {
- $debug || return
-
- echo "$@"
-}
-
-trap "$nft flush ruleset" EXIT
-
-for testcase in testcases/*.t; do
- echo "running tests from file $(basename $testcase)"
- # files are like this:
- #
- # <input command>[;;<output regexp>]
-
- $nft flush ruleset
-
- while read line; do
- [[ -z "$line" || "$line" == "#"* ]] && continue
-
- # XXX: this only works if there is no semicolon in output
- input="${line%;;*}"
- output="${line##*;;}"
-
- [[ -z $output ]] && output="$input"
-
- debug_echo "calling '$nft $nft_opts $input'"
- cmd_out=$($nft $nft_opts $input)
- # strip trailing whitespace (happens when adding a named set)
- cmd_out="${cmd_out% }"
- debug_echo "got output '$cmd_out'"
- [[ $cmd_out == $output ]] || {
- echo "Warning: Output differs:"
- echo "# nft $nft_opts $input"
- echo "- $output"
- echo "+ $cmd_out"
- }
- done <$testcase
-done