[nft PATCH] tests/shell: delete tempfile failover in testcases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 tests/shell/testcases/netns/0001nft-f_0         |    8 +-------
 tests/shell/testcases/netns/0003many_0          |    8 +-------
 tests/shell/testcases/nft-f/0001define_slash_0  |    8 +-------
 tests/shell/testcases/nft-f/0002rollback_rule_0 |    8 +-------
 tests/shell/testcases/nft-f/0003rollback_jump_0 |    8 +-------
 tests/shell/testcases/nft-f/0004rollback_set_0  |    8 +-------
 tests/shell/testcases/nft-f/0005rollback_map_0  |    8 +-------
 7 files changed, 7 insertions(+), 49 deletions(-)

diff --git a/tests/shell/testcases/netns/0001nft-f_0 b/tests/shell/testcases/netns/0001nft-f_0
index 721444a..e616363 100755
--- a/tests/shell/testcases/netns/0001nft-f_0
+++ b/tests/shell/testcases/netns/0001nft-f_0
@@ -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
diff --git a/tests/shell/testcases/netns/0003many_0 b/tests/shell/testcases/netns/0003many_0
index b6706ff..ad71ae3 100755
--- a/tests/shell/testcases/netns/0003many_0
+++ b/tests/shell/testcases/netns/0003many_0
@@ -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
diff --git a/tests/shell/testcases/nft-f/0001define_slash_0 b/tests/shell/testcases/nft-f/0001define_slash_0
index 4ce7089..bf0763d 100755
--- a/tests/shell/testcases/nft-f/0001define_slash_0
+++ b/tests/shell/testcases/nft-f/0001define_slash_0
@@ -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
diff --git a/tests/shell/testcases/nft-f/0002rollback_rule_0 b/tests/shell/testcases/nft-f/0002rollback_rule_0
index a3f6676..b1e224c 100755
--- a/tests/shell/testcases/nft-f/0002rollback_rule_0
+++ b/tests/shell/testcases/nft-f/0002rollback_rule_0
@@ -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
diff --git a/tests/shell/testcases/nft-f/0003rollback_jump_0 b/tests/shell/testcases/nft-f/0003rollback_jump_0
index b3ebe94..567a70e 100755
--- a/tests/shell/testcases/nft-f/0003rollback_jump_0
+++ b/tests/shell/testcases/nft-f/0003rollback_jump_0
@@ -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
diff --git a/tests/shell/testcases/nft-f/0004rollback_set_0 b/tests/shell/testcases/nft-f/0004rollback_set_0
index 55043ef..3521aeb 100755
--- a/tests/shell/testcases/nft-f/0004rollback_set_0
+++ b/tests/shell/testcases/nft-f/0004rollback_set_0
@@ -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
diff --git a/tests/shell/testcases/nft-f/0005rollback_map_0 b/tests/shell/testcases/nft-f/0005rollback_map_0
index 38018f6..21b6a63 100755
--- a/tests/shell/testcases/nft-f/0005rollback_map_0
+++ b/tests/shell/testcases/nft-f/0005rollback_map_0
@@ -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

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux