. "${TEST_SCRIPTS_DIR}/unit.sh"
-pidfile=$(mktemp --tmpdir="$TEST_VAR_DIR")
+pidfile=$(TMPDIR="$TEST_VAR_DIR" mktemp)
ok_null
unit_test pidfile_test $pidfile
EOF
unit_test run_event_test /a/b/c list
-scriptdir=$(mktemp -d --tmpdir="$TEST_VAR_DIR")
+scriptdir=$(TMPDIR="$TEST_VAR_DIR" mktemp -d)
# Empty directory
ok <<EOF
unit_test run_proc_test 0 -1 /a/b/c
# Non-executable path
-prog=$(mktemp --tmpdir="$TEST_VAR_DIR")
+prog=$(TMPDIR="$TEST_VAR_DIR" mktemp)
cat > "$prog" <<EOF
echo hello
EOF
unit_test run_proc_test 5 -1 "$prog"
# Redirected output
-output=$(mktemp --tmpdir="$TEST_VAR_DIR")
+output=$(TMPDIR="$TEST_VAR_DIR" mktemp)
cat > "$prog" <<EOF
#!/bin/sh
exec >"$output" 2>&1
unit_test run_proc_test 1 -1 "$prog"
# No zombie processes
-pidfile=$(mktemp --tmpdir="$TEST_VAR_DIR")
+pidfile=$(TMPDIR="$TEST_VAR_DIR" mktemp)
cat > "$prog" <<EOF
#!/bin/sh
create_policy_routing_config 1 default
_rt_tables="$CTDB_SYS_ETCDIR/iproute2/rt_tables"
-_rt_orig=$(mktemp --tmpdir="$EVENTSCRIPTS_TESTS_VAR_DIR")
+_rt_orig=$(TMPDIR="$EVENTSCRIPTS_TESTS_VAR_DIR" mktemp)
cp "$_rt_tables" "$_rt_orig"
ctdb_get_1_public_address | {
nfs_first_export=$(showmount -e $test_ip | sed -n -e '2s/ .*//p')
echo "Creating test subdirectory..."
- try_command_on_node $test_node "mktemp -d --tmpdir=$nfs_first_export"
+ try_command_on_node $test_node "TMPDIR=$nfs_first_export mktemp -d"
nfs_test_dir="$out"
try_command_on_node $test_node "chmod 777 $nfs_test_dir"