]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/shell/run-tests.sh: execute tests in sorted order
authorArturo Borrero <arturo.borrero.glez@gmail.com>
Wed, 11 May 2016 12:39:33 +0000 (14:39 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 13 May 2016 09:36:12 +0000 (11:36 +0200)
Let's sort tests files before iterating over them.

Put the find string in a separated function so it's more readable.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/run-tests.sh

index 0bbb136bc425edb990b5c523e0888c460ac8fc7e..057f11ef57b66708dff4f3f4df59c20590df4dbb 100755 (executable)
@@ -61,10 +61,15 @@ kernel_cleanup() {
        nf_tables_ipv4 nf_tables_ipv6 nf_tables
 }
 
+find_tests() {
+       ${FIND} ${TESTDIR} -executable -regex \
+               .*${RETURNCODE_SEPARATOR}[0-9]+ | sort
+}
+
 echo ""
 ok=0
 failed=0
-for testfile in $(${FIND} ${TESTDIR} -executable -regex .*${RETURNCODE_SEPARATOR}[0-9]+)
+for testfile in $(find_tests)
 do
        kernel_cleanup