ctdb-tests: Avoid creating files in /tmp.
authorMartin Schwenke <martin@meltin.net>
Tue, 13 Feb 2018 00:55:07 +0000 (11:55 +1100)
committerMartin Schwenke <martins@samba.org>
Thu, 1 Mar 2018 18:39:15 +0000 (19:39 +0100)
Temporary test data should all go somewhere under TEST_VAR_DIR instead
of in the global /tmp.  The existing mktemp could be changed so the
data goes into the test directory but mktemp is overkill in this case.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/eventscripts/stubs/ip

index 2468e44ea6494b8b82c83fbabc9f489b6615a058..af155beb188b4876c2a443c4c23433ad7297dfa7 100755 (executable)
@@ -485,7 +485,8 @@ ip_rule_del ()
     touch "$_f"
     (
        flock 0
-       _tmp="$(mktemp)"
+       _tmp="${_f}.new"
+       : >"$_tmp"
        _found=false
        while read _p _t _s ; do
            if ! $_found && \