diff options
author | Jim Meyering <jim@meyering.net> | 2007-09-12 14:52:26 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-09-15 08:40:39 +0200 |
commit | a669dfdabb3fa1be2e1367d53a797d495e7bd5c9 (patch) | |
tree | c88d6414649f7f4f5571138e193c72da44a03876 /tests/mv | |
parent | 0539705768992ebcc290bc859f64e27898c7f958 (diff) | |
download | coreutils-a669dfdabb3fa1be2e1367d53a797d495e7bd5c9.tar.xz |
More misc, test-related changes. (some to allow running tests as root)
Diffstat (limited to 'tests/mv')
-rw-r--r-- | tests/mv/Makefile.am | 14 | ||||
-rwxr-xr-x | tests/mv/childproof | 2 | ||||
-rwxr-xr-x | tests/mv/dup-source | 2 | ||||
-rwxr-xr-x | tests/mv/hard-2 | 2 | ||||
-rwxr-xr-x | tests/mv/hard-3 | 2 | ||||
-rwxr-xr-x | tests/mv/i-2 | 2 | ||||
-rwxr-xr-x | tests/mv/i-3 | 5 | ||||
-rwxr-xr-x | tests/mv/leak-fd | 2 | ||||
-rwxr-xr-x | tests/mv/part-fail | 2 | ||||
-rwxr-xr-x | tests/mv/perm-1 | 2 |
10 files changed, 22 insertions, 13 deletions
diff --git a/tests/mv/Makefile.am b/tests/mv/Makefile.am index d043c8bad..4fa09fbd2 100644 --- a/tests/mv/Makefile.am +++ b/tests/mv/Makefile.am @@ -32,10 +32,18 @@ TESTS = \ perm-1 \ i-link-no \ part-fail \ - dup-source childproof i-4 i-5 update i-2 mv-special-1 \ - into-self into-self-2 into-self-3 into-self-4 \ + dup-source childproof update mv-special-1 \ + into-self \ + into-self-2 \ + into-self-3 \ + into-self-4 \ + i-1 \ + i-2 \ + i-3 \ + i-4 \ + i-5 \ backup-is-src \ - i-1 hard-link-1 force partition-perm to-symlink dir-file diag \ + hard-link-1 force partition-perm to-symlink dir-file diag \ part-symlink part-rename trailing-slash EXTRA_DIST = $(TESTS) vfat diff --git a/tests/mv/childproof b/tests/mv/childproof index 6d93974a4..cdce93253 100755 --- a/tests/mv/childproof +++ b/tests/mv/childproof @@ -26,8 +26,8 @@ if test "$VERBOSE" = yes; then fi . $srcdir/../lang-default -PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check . $srcdir/../test-lib.sh +skip_if_root_ mkdir a b c || framework_failure echo a > a/f || framework_failure diff --git a/tests/mv/dup-source b/tests/mv/dup-source index a851ba8cf..a3eff6bdc 100755 --- a/tests/mv/dup-source +++ b/tests/mv/dup-source @@ -26,8 +26,8 @@ if test "$VERBOSE" = yes; then fi . $srcdir/../lang-default -PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check . $srcdir/../test-lib.sh +skip_if_root_ fail=0 diff --git a/tests/mv/hard-2 b/tests/mv/hard-2 index 62467e628..7833e43f7 100755 --- a/tests/mv/hard-2 +++ b/tests/mv/hard-2 @@ -23,8 +23,8 @@ if test "$VERBOSE" = yes; then cp --version fi -PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check . $srcdir/../test-lib.sh +skip_if_root_ mkdir dst || framework_failure (cd dst && touch a b c) || framework_failure diff --git a/tests/mv/hard-3 b/tests/mv/hard-3 index cb02422cd..8d532a7c9 100755 --- a/tests/mv/hard-3 +++ b/tests/mv/hard-3 @@ -35,8 +35,8 @@ if test "$VERBOSE" = yes; then cp --version fi -PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check . $srcdir/../test-lib.sh +skip_if_root_ mkdir -p x dst/x || framework_failure touch dst/x/b || framework_failure diff --git a/tests/mv/i-2 b/tests/mv/i-2 index 6c654c98f..49f9d985f 100755 --- a/tests/mv/i-2 +++ b/tests/mv/i-2 @@ -27,8 +27,8 @@ fi # Make sure we get English translations. . $srcdir/../lang-default -PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check . $srcdir/../test-lib.sh +skip_if_root_ for i in a b c d e f g h; do echo $i > $i || framework_failure diff --git a/tests/mv/i-3 b/tests/mv/i-3 index 8a75de7f2..15f25ced8 100755 --- a/tests/mv/i-3 +++ b/tests/mv/i-3 @@ -23,8 +23,9 @@ if test "$VERBOSE" = yes; then fi . $srcdir/../lang-default -PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check +. $srcdir/../input-tty . $srcdir/../test-lib.sh +skip_if_root_ touch f g h i || framework_failure chmod 0 g i || framework_failure @@ -40,7 +41,7 @@ kill $pid # Make sure out contains the prompt. case "`cat out`" in - "mv: overwrite \`g', overriding mode 0000?"*) ;; + "mv: try to overwrite \`g', overriding mode 0000"*) ;; *) fail=1 ;; esac diff --git a/tests/mv/leak-fd b/tests/mv/leak-fd index 515ad20fb..7a0a0ba5d 100755 --- a/tests/mv/leak-fd +++ b/tests/mv/leak-fd @@ -27,8 +27,8 @@ fi # framework-failure on systems with a smaller command-line length . $srcdir/../expensive -PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check . $srcdir/../test-lib.sh +skip_if_root_ cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_top_srcdir/tests/other-fs-tmpdir" diff --git a/tests/mv/part-fail b/tests/mv/part-fail index 1a43bafcd..4f12c1415 100755 --- a/tests/mv/part-fail +++ b/tests/mv/part-fail @@ -25,8 +25,8 @@ if test "$VERBOSE" = yes; then fi . $srcdir/../lang-default -PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check . $srcdir/../test-lib.sh +skip_if_root_ cleanup_() { t=$other_partition_tmpdir; chmod -R 700 "$t"; rm -rf "$t"; } . "$abs_top_srcdir/tests/other-fs-tmpdir" diff --git a/tests/mv/perm-1 b/tests/mv/perm-1 index af859197c..08a4eaa5b 100755 --- a/tests/mv/perm-1 +++ b/tests/mv/perm-1 @@ -23,8 +23,8 @@ if test "$VERBOSE" = yes; then fi . $srcdir/../lang-default -PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check . $srcdir/../test-lib.sh +skip_if_root_ mkdir -p no-write/dir || framework_failure chmod u-w no-write || framework_failure |