]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables: tests: shell: Add README
authorArushi Singhal <arushisinghal19971997@gmail.com>
Sat, 7 Jul 2018 08:38:38 +0000 (14:08 +0530)
committerFlorian Westphal <fw@strlen.de>
Sat, 7 Jul 2018 21:51:27 +0000 (23:51 +0200)
1) README is added to run test suite.
2) Rename two test-case scripts to follow proper numerical order.
3) "echo -en "\033[1A\033[K" # clean the [EXECUTING] foobar line" command
should only used when verbose("-v") option is not there else instead of
clearing "[EXECUTING]" prompt it is clearing last prompt of the test file.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/tests/shell/README [new file with mode: 0644]
iptables/tests/shell/run-tests.sh
iptables/tests/shell/testcases/chain/0002newchain_0 [moved from iptables/tests/shell/testcases/chain/0004newchain_0 with 100% similarity]
iptables/tests/shell/testcases/chain/0003rename_1 [moved from iptables/tests/shell/testcases/chain/0005rename_1 with 100% similarity]

diff --git a/iptables/tests/shell/README b/iptables/tests/shell/README
new file mode 100644 (file)
index 0000000..08da486
--- /dev/null
@@ -0,0 +1,17 @@
+To run the test suite (as root):
+ $ cd iptables/tests/shell
+ # ./run-tests.sh
+
+Test files are executable files with the pattern <<name_N>> , where N is the
+expected return code of the executable. Since they are located with `find',
+test-files can be spreaded in any sub-directories.
+
+You can turn on a verbose execution by calling:
+ # ./run-tests.sh -v
+
+And to run test suite for pariticular test files:
+ # ./run-tests.sh <PATH_OF_TESTFILES>
+
+Also, test-files will receive the environment variable $XT_MULTI which contains
+the path to the old iptables (xtables-legacy-multi) or new iptables (xtables-nft-multi)
+binary being tested.
index a984a457768f52214daf277c82a3d3b2bb27925d..a39aecb68b271e37918857570fdddf2a52257c04 100755 (executable)
@@ -67,10 +67,10 @@ do_test() {
                XT_MULTI=$xtables_multi unshare -n ${testfile}
        else
                XT_MULTI=$xtables_multi unshare -n ${testfile} > /dev/null 2>&1
+               echo -en "\033[1A\033[K" # clean the [EXECUTING] foobar line
        fi
 
        rc_got=$?
-       echo -en "\033[1A\033[K" # clean the [EXECUTING] foobar line
 
        if [ "$rc_got" == "$rc_spec" ] ; then
                msg_info "[OK]          $testfile"