* [nft PATCH] tests/shell: delete tempfile failover in testcases
@ 2016-04-14 19:47 Arturo Borrero Gonzalez
2016-04-18 18:32 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Arturo Borrero Gonzalez @ 2016-04-14 19:47 UTC (permalink / raw)
To: netfilter-devel
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>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [nft PATCH] tests/shell: delete tempfile failover in testcases
2016-04-14 19:47 [nft PATCH] tests/shell: delete tempfile failover in testcases Arturo Borrero Gonzalez
@ 2016-04-18 18:32 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2016-04-18 18:32 UTC (permalink / raw)
To: Arturo Borrero Gonzalez; +Cc: netfilter-devel
On Thu, Apr 14, 2016 at 09:47:05PM +0200, Arturo Borrero Gonzalez wrote:
> 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.
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-18 18:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-14 19:47 [nft PATCH] tests/shell: delete tempfile failover in testcases Arturo Borrero Gonzalez
2016-04-18 18:32 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).