]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/shell: Allow to specify multiple testcases
authorPhil Sutter <phil@nwl.cc>
Mon, 19 Mar 2018 17:02:07 +0000 (18:02 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 20 Mar 2018 12:08:14 +0000 (13:08 +0100)
Extend run-tests.sh a bit so that all remaining arguments after option
parsing are treated as filenames to test and complain if one doesn't
seem like such. This allows for doing stuff like:

| ./run-tests.sh testcases/include/000*

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/run-tests.sh

index 431d55590a7df8ede364dd8dd14cd255da155787..b52611b4eb69568ba78f50f195753267b4070c4c 100755 (executable)
@@ -55,12 +55,14 @@ if [ "$1" == "-g" ] ; then
        shift
 fi
 
-if [ -x "$1" ] ; then
-       if grep ^.*${RETURNCODE_SEPARATOR}[0-9]\\+$ <<< $1 >/dev/null ; then
-               SINGLE=$1
+for arg in "$@"; do
+       if grep ^.*${RETURNCODE_SEPARATOR}[0-9]\\+$ <<< $arg >/dev/null ; then
+               SINGLE+=" $arg"
                VERBOSE=y
+       else
+               msg_error "unknown parameter '$arg'"
        fi
-fi
+done
 
 kernel_cleanup() {
        $NFT flush ruleset