diff options
author | Thomas Haller <thaller@redhat.com> | 2023-09-06 13:52:21 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2023-09-07 19:35:21 +0200 |
commit | f5f79773a6ad892f9f1a9f34ef2c5b9da69fc2f0 (patch) | |
tree | dff35383d1b99c13c71f056c0a9b1bab61b4d7ab /tests/shell/testcases/include | |
parent | 8f3893708c427d58c1b0a180d2e5e4ac3ab2e7ee (diff) |
tests/shell: fix "0003includepath_0" for different TMPDIR
We are going to set $TMPDIR to another location. The previous code made
assumptions that the generated path would always be in /tmp. Fix that.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/shell/testcases/include')
-rwxr-xr-x | tests/shell/testcases/include/0003includepath_0 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/shell/testcases/include/0003includepath_0 b/tests/shell/testcases/include/0003includepath_0 index ba722068..20037a8f 100755 --- a/tests/shell/testcases/include/0003includepath_0 +++ b/tests/shell/testcases/include/0003includepath_0 @@ -8,7 +8,7 @@ if [ ! -w $tmpfile1 ] ; then exit 0 fi -tmpfile3=$(echo "$tmpfile1" | cut -d'/' -f 3) +tmpfile3="$(basename "$tmpfile1")" tmpfile2=$(mktemp) if [ ! -w $tmpfile2 ] ; then @@ -24,7 +24,7 @@ RULESET2="include \"$tmpfile3\"" echo "$RULESET1" > $tmpfile1 echo "$RULESET2" > $tmpfile2 -$NFT -I /tmp -f $tmpfile2 +$NFT -I "$(dirname "$tmpfile1")" -f $tmpfile2 if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 |