Regression test portability: mktemp
Linux mktemp accepts to run without a template, NetBSD mandates it. Since the template option has the same syntax, add it everywhere. While there, also do this in scripts outside of regression testing. BUG: 764655 Change-Id: I3ec140afbc9009257c81a56d77afcc21fef74cc4 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8432 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net>
This commit is contained in:
parent
a521fc1d22
commit
33be39b42f
@ -18,7 +18,7 @@ function mount_client()
|
||||
GFID_CMD=$3;
|
||||
OUTPUT=$4;
|
||||
|
||||
T=$(mktemp -d);
|
||||
T=$(mktemp -d -t ${0##*/}.XXXXXX);
|
||||
|
||||
glusterfs -s $VOLFILE_SERVER --volfile-id $VOLUME $T;
|
||||
|
||||
|
@ -75,7 +75,7 @@ function mount_client()
|
||||
GFID_FILE=$3
|
||||
SYNC_CMD=$4
|
||||
|
||||
T=$(mktemp -d);
|
||||
T=$(mktemp -d -t ${0##*/}.XXXXXX);
|
||||
|
||||
glusterfs --aux-gfid-mount -s $1 --volfile-id $2 $T;
|
||||
|
||||
|
@ -55,7 +55,7 @@ function mount_client()
|
||||
GFID_FILE=$3
|
||||
SYNC_CMD=$4
|
||||
|
||||
T=$(mktemp -d);
|
||||
T=$(mktemp -d -t ${0##*/}.XXXXXX);
|
||||
|
||||
glusterfs --aux-gfid-mount -s $1 --volfile-id $VOLUME_NAME $T;
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
##---------------------------------------------------------------------------
|
||||
|
||||
QUOTA_CONFIG_XATTR="trusted.glusterfs.quota.limit-set";
|
||||
MOUNT_DIR=`mktemp --directory --tmpdir`;
|
||||
MOUNT_DIR=`mktemp -d -t ${0##*/}.XXXXXX`;
|
||||
OPTSPEC="volname:,version:,gd-workdir:,volume-op:"
|
||||
PROGNAME="Quota-xattr-heal-add-brick"
|
||||
VOL_NAME=
|
||||
|
@ -24,7 +24,7 @@ function cmd_master()
|
||||
cmd_line=$(cat <<EOF
|
||||
function do_verify() {
|
||||
v=\$1;
|
||||
d=\$(mktemp -d 2>/dev/null);
|
||||
d=\$(mktemp -d -t ${0##*/}.XXXXXX 2>/dev/null);
|
||||
glusterfs -s localhost --xlator-option="*dht.lookup-unhashed=off" --volfile-id \$v -l $slave_log_file \$d;
|
||||
i=\$(stat -c "%i" \$d);
|
||||
if [[ "\$i" -ne "1" ]]; then
|
||||
@ -80,7 +80,7 @@ function slave_stats()
|
||||
local ver;
|
||||
local status;
|
||||
|
||||
d=$(mktemp -d 2>/dev/null);
|
||||
d=$(mktemp -d -t ${0##*/}.XXXXXX 2>/dev/null);
|
||||
glusterfs --xlator-option="*dht.lookup-unhashed=off" --volfile-server $SLAVEHOST --volfile-id $SLAVEVOL -l $slave_log_file $d;
|
||||
i=$(stat -c "%i" $d);
|
||||
if [[ "$i" -ne "1" ]]; then
|
||||
|
@ -14,7 +14,7 @@ function fragment_size
|
||||
|
||||
cleanup
|
||||
|
||||
tmp=`mktemp -d`
|
||||
tmp=`mktemp -d -t ${0##*/}.XXXXXX`
|
||||
if [ ! -d $tmp ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
@ -143,7 +143,7 @@ EXPECT 'Started' volinfo_field $V0 'Status'
|
||||
TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0
|
||||
|
||||
# Create local files for comparisons etc.
|
||||
tmpdir=$(mktemp -d)
|
||||
tmpdir=$(mktemp -d -t ${0##*/}.XXXXXX)
|
||||
trap "rm -rf $tmpdir" EXIT
|
||||
TEST create_file $tmpdir/create-write 10
|
||||
TEST create_file $tmpdir/truncate 10
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
cleanup
|
||||
|
||||
tmp=`mktemp -d`
|
||||
tmp=`mktemp -d -t ${0##*/}.XXXXXX`
|
||||
if [ ! -d $tmp ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
@ -17,7 +17,7 @@ TEST $CLI volume set $V0 changelog on
|
||||
TEST $CLI volume set $V0 changelog.fsync-interval 1
|
||||
|
||||
# perform I/O on the background
|
||||
f=$(basename `mktemp`)
|
||||
f=$(basename `mktemp -t ${0##*/}.XXXXXX`)
|
||||
dd if=/dev/urandom of=$M0/$f count=100000 bs=4k &
|
||||
|
||||
# this is the best we can do without inducing _error points_ in the code
|
||||
|
Loading…
x
Reference in New Issue
Block a user