From 56300b1dc28f4acef88821364419933459d931f6 Mon Sep 17 00:00:00 2001 From: Pádraig Brady
Date: Sun, 30 Aug 2009 01:27:45 +0100
Subject: tests: don't misbehave if $TMPDIR contains spaces
* tests/misc/xattr: Add quotes.
* tests/mv/acl: Likewise.
* tests/mv/backup-is-src: Likewise.
* tests/mv/hard-link-1: Likewise.
* tests/mv/leak-fd: Likewise.
* tests/mv/mv-special-1: Likewise.
* tests/mv/part-fail: Likewise.
* tests/mv/part-hardlink: Likewise.
* tests/mv/part-rename: Likewise.
* tests/mv/part-symlink: Likewise.
* tests/mv/partition-perm: Likewise.
* tests/mv/sticky-to-xpart: Likewise.
---
tests/mv/acl | 12 ++++++------
tests/mv/backup-is-src | 8 ++++----
tests/mv/hard-link-1 | 4 ++--
tests/mv/leak-fd | 2 +-
tests/mv/mv-special-1 | 10 +++++-----
tests/mv/part-fail | 6 +++---
tests/mv/part-hardlink | 6 +++---
tests/mv/part-rename | 2 +-
tests/mv/part-symlink | 10 +++++-----
tests/mv/partition-perm | 6 +++---
tests/mv/sticky-to-xpart | 2 +-
11 files changed, 34 insertions(+), 34 deletions(-)
(limited to 'tests/mv')
diff --git a/tests/mv/acl b/tests/mv/acl
index e4e31dd1d..5ad8de052 100755
--- a/tests/mv/acl
+++ b/tests/mv/acl
@@ -49,24 +49,24 @@ test $skip_partition != none &&
skip_test_ "'$skip' is not on a suitable file system for this test"
# move the access acl of a file
-mv file $other_partition_tmpdir || fail=1
-acl2=`cd $other_partition_tmpdir && getfacl file` || framework_failure
+mv file "$other_partition_tmpdir" || fail=1
+acl2=`cd "$other_partition_tmpdir" && getfacl file` || framework_failure
test "$acl1" = "$acl2" || fail=1
# move the access acl of a directory
mkdir dir || framework_failure
setfacl -m user:bin:rw dir || framework_failure
acl1=`getfacl dir` || framework_failure
-mv dir $other_partition_tmpdir || fail=1
-acl2=`cd $other_partition_tmpdir && getfacl dir` || framework_failure
+mv dir "$other_partition_tmpdir" || fail=1
+acl2=`cd "$other_partition_tmpdir" && getfacl dir` || framework_failure
test "$acl1" = "$acl2" || fail=1
# move the default acl of a directory
mkdir dir2 || framework_failure
setfacl -d -m user:bin:rw dir2 || framework_failure
acl1=`getfacl dir2` || framework_failure
-mv dir2 $other_partition_tmpdir || fail=1
-acl2=`cd $other_partition_tmpdir && getfacl dir2` || framework_failure
+mv dir2 "$other_partition_tmpdir" || fail=1
+acl2=`cd "$other_partition_tmpdir" && getfacl dir2` || framework_failure
test "$acl1" = "$acl2" || fail=1
Exit $fail
diff --git a/tests/mv/backup-is-src b/tests/mv/backup-is-src
index 506c14909..df6561baf 100755
--- a/tests/mv/backup-is-src
+++ b/tests/mv/backup-is-src
@@ -28,12 +28,12 @@ cleanup_() { rm -rf "$other_partition_tmpdir"; }
a="$other_partition_tmpdir/a"
a2="$other_partition_tmpdir/a~"
-rm -f $a $a2 || framework_failure
-echo a > $a || framework_failure
-echo a2 > $a2 || framework_failure
+rm -f "$a" "$a2" || framework_failure
+echo a > "$a" || framework_failure
+echo a2 > "$a2" || framework_failure
# This mv command should exit nonzero.
-mv --b=simple $a2 $a > out 2>&1 && fail=1
+mv --b=simple "$a2" "$a" > out 2>&1 && fail=1
sed \
-e "s,mv:,XXX:," \
diff --git a/tests/mv/hard-link-1 b/tests/mv/hard-link-1
index 7bcc0493a..2df2cf3ff 100755
--- a/tests/mv/hard-link-1
+++ b/tests/mv/hard-link-1
@@ -32,10 +32,10 @@ mkdir $dir || framework_failure
> $dir/a || framework_failure
ln $dir/a $dir/b || framework_failure
-mv $dir $other_partition_tmpdir || fail=1
+mv $dir "$other_partition_tmpdir" || fail=1
# Display inode numbers, one per line.
-ls -1i $other_partition_tmpdir/$dir > out || fail=1
+ls -1i "$other_partition_tmpdir/$dir" > out || fail=1
# Make sure the inode numbers are the same.
a=`sed -n 's/ a$//p' out`
diff --git a/tests/mv/leak-fd b/tests/mv/leak-fd
index 55a4e3a81..76a6b439a 100755
--- a/tests/mv/leak-fd
+++ b/tests/mv/leak-fd
@@ -50,7 +50,7 @@ test -f $last_file || framework_failure
fail=0
-mv * $other_partition_tmpdir || fail=1
+mv * "$other_partition_tmpdir" || fail=1
test -f $last_file/f && fail=1
rm .dirs
diff --git a/tests/mv/mv-special-1 b/tests/mv/mv-special-1
index 208bc7f91..321c54e64 100755
--- a/tests/mv/mv-special-1
+++ b/tests/mv/mv-special-1
@@ -42,13 +42,13 @@ touch $dir/a/b/c/file1 $dir/d/e/f/file2 || framework_failure
# It's not worth making an exception any more.
fail=0
-mv --verbose $null $dir $other_partition_tmpdir > out || fail=1
+mv --verbose $null $dir "$other_partition_tmpdir" > out || fail=1
# Make sure the files are gone.
test -p $null && fail=1
test -d $dir && fail=1
# Make sure they were moved.
-test -p $other_partition_tmpdir/$null || fail=1
-test -d $other_partition_tmpdir/$dir/a/b/c || fail=1
+test -p "$other_partition_tmpdir/$null" || fail=1
+test -d "$other_partition_tmpdir/$dir/a/b/c" || fail=1
# POSIX says rename (A, B) can succeed if A and B are on different file systems,
# so ignore chatter about when files are removed and copied rather than renamed.
@@ -72,7 +72,7 @@ EOF
compare out2 exp || fail=1
-# cd $other_partition_tmpdir
-# ls -l -A -R $other_partition_tmpdir
+# cd "$other_partition_tmpdir"
+# ls -l -A -R "$other_partition_tmpdir"
Exit $fail
diff --git a/tests/mv/part-fail b/tests/mv/part-fail
index b1048e965..290864dff 100755
--- a/tests/mv/part-fail
+++ b/tests/mv/part-fail
@@ -29,12 +29,12 @@ skip_if_root_
cleanup_() { t=$other_partition_tmpdir; chmod -R 700 "$t"; rm -rf "$t"; }
. "$abs_srcdir/other-fs-tmpdir"
-touch k $other_partition_tmpdir/k || framework_failure
-chmod u-w $other_partition_tmpdir || framework_failure
+touch k "$other_partition_tmpdir/k" || framework_failure
+chmod u-w "$other_partition_tmpdir" || framework_failure
fail=0
-mv -f k $other_partition_tmpdir 2> out && fail=1
+mv -f k "$other_partition_tmpdir" 2> out && fail=1
cat <