1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

ctdb-tests: Improve portability by not using mktemp --tmpdir option

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 2f2c35a1cb4afe38e869882e8f18a62d4daac981)
This commit is contained in:
Martin Schwenke 2018-07-01 13:28:40 +10:00 committed by Karolin Seeger
parent ebeecc3431
commit 58671b0079
5 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
pidfile=$(mktemp --tmpdir="$TEST_VAR_DIR")
pidfile=$(TMPDIR="$TEST_VAR_DIR" mktemp)
ok_null
unit_test pidfile_test $pidfile

View File

@ -8,7 +8,7 @@ run_event_init() failed, ret=2
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

View File

@ -9,7 +9,7 @@ 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
@ -49,7 +49,7 @@ 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
@ -110,7 +110,7 @@ EOF
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

View File

@ -9,7 +9,7 @@ setup
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 | {

View File

@ -633,7 +633,7 @@ nfs_test_setup ()
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"