]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/shell: delete tempfile failover in testcases
authorArturo Borrero <arturo.borrero.glez@gmail.com>
Thu, 14 Apr 2016 19:47:05 +0000 (21:47 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 15 Apr 2016 10:55:58 +0000 (12:55 +0200)
It seems both Debian/Fedora (and derivates) contains mktemp (from the coreutils
package) so it makes no sense to have this failover, which looks buggy also.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/netns/0001nft-f_0
tests/shell/testcases/netns/0003many_0
tests/shell/testcases/nft-f/0001define_slash_0
tests/shell/testcases/nft-f/0002rollback_rule_0
tests/shell/testcases/nft-f/0003rollback_jump_0
tests/shell/testcases/nft-f/0004rollback_set_0
tests/shell/testcases/nft-f/0005rollback_map_0

index 721444a611d87e17f8b3675be72e2823f7491f45..e616363e358cfdc9c8203603a0f6955c818284bb 100755 (executable)
@@ -8,13 +8,7 @@ if [ ! -x "$IP" ] ; then
        exit 1
 fi
 
-MKTEMP=$(which mktemp)
-if [ -x $MKTEMP ] ; then
-       tmpfile=$(${MKTEMP})
-else
-       tmpfile=$(/tmp/${RANDOM})
-fi
-
+tmpfile=$(mktemp)
 if [ ! -w $tmpfile ] ; then
        echo "Failed to create tmp file" >&2
        exit 0
index b6706ffa3c81274c4e1205dce47dbf722b3a9cee..ad71ae37992caf9c92f6a8962460c3e6721175e9 100755 (executable)
@@ -11,13 +11,7 @@ if [ ! -x "$IP" ] ; then
        exit 1
 fi
 
-MKTEMP=$(which mktemp)
-if [ -x $MKTEMP ] ; then
-       tmpfile=$(${MKTEMP})
-else
-       tmpfile=$(/tmp/${RANDOM})
-fi
-
+tmpfile=$(mktemp)
 if [ ! -w $tmpfile ] ; then
        echo "Failed to create tmp file" >&2
        exit 0
index 4ce7089c6c2af2c2707885dc07e64332c010e816..bf0763d4bd7c3f3e28b6f37caf7e8c8e52e2093f 100755 (executable)
@@ -2,13 +2,7 @@
 
 # tests for commit 85d6803 (parser_bison: initializer_expr must use rhs_expr)
 
-MKTEMP=$(which mktemp)
-if [ -x $MKTEMP ] ; then
-       tmpfile=$(${MKTEMP})
-else
-       tmpfile=$(/tmp/${RANDOM})
-fi
-
+tmpfile=$(mktemp)
 if [ ! -w $tmpfile ] ; then
        echo "Failed to create tmp file" >&2
        exit 0
index a3f6676076e4afd93cbfc128d89e61db4c2323a2..b1e224c3d19e7e2c4bc3f113a03f959aa4dc99ef 100755 (executable)
@@ -3,13 +3,7 @@
 # test a kernel rollback operation
 # fail reason: rule
 
-MKTEMP=$(which mktemp)
-if [ -x $MKTEMP ] ; then
-       tmpfile=$(${MKTEMP})
-else
-       tmpfile=$(/tmp/${RANDOM})
-fi
-
+tmpfile=$(mktemp)
 if [ ! -w $tmpfile ] ; then
        echo "Failed to create tmp file" >&2
        exit 0
index b3ebe94928d87ca86db6b90dc30c753d8ec5ebf8..567a70e749617e0b0310b063f91af65c888952c9 100755 (executable)
@@ -3,13 +3,7 @@
 # test a kernel rollback operation
 # fail reason: invalid jump
 
-MKTEMP=$(which mktemp)
-if [ -x $MKTEMP ] ; then
-       tmpfile=$(${MKTEMP})
-else
-       tmpfile=$(/tmp/${RANDOM})
-fi
-
+tmpfile=$(mktemp)
 if [ ! -w $tmpfile ] ; then
        echo "Failed to create tmp file" >&2
        exit 0
index 55043ef3399bec80ddf40d9943c63b253da49663..3521aebdb09344dca7244de473f319be057a782c 100755 (executable)
@@ -3,13 +3,7 @@
 # test a kernel rollback operation
 # fail reason: invalid set
 
-MKTEMP=$(which mktemp)
-if [ -x $MKTEMP ] ; then
-       tmpfile=$(${MKTEMP})
-else
-       tmpfile=$(/tmp/${RANDOM})
-fi
-
+tmpfile=$(mktemp)
 if [ ! -w $tmpfile ] ; then
        echo "Failed to create tmp file" >&2
        exit 0
index 38018f6601fb30075f10deb557622662b3f73ab7..21b6a6371554838ebd593ed7ffcef7f579464354 100755 (executable)
@@ -3,13 +3,7 @@
 # test a kernel rollback operation
 # fail reason: invalid map
 
-MKTEMP=$(which mktemp)
-if [ -x $MKTEMP ] ; then
-       tmpfile=$(${MKTEMP})
-else
-       tmpfile=$(/tmp/${RANDOM})
-fi
-
+tmpfile=$(mktemp)
 if [ ! -w $tmpfile ] ; then
        echo "Failed to create tmp file" >&2
        exit 0