Fix some test cases
authorDan Fandrich <dan@coneharvesters.com>
Fri, 3 Sep 2010 01:38:00 +0000 (18:38 -0700)
committerDenys Vlasenko <dvlasenk@redhat.com>
Fri, 3 Sep 2010 15:09:51 +0000 (17:09 +0200)
The tar tests still don't pass, but at least now it's because of
a problem with Busybox and not the tests themselves.

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
testsuite/makedevs.tests
testsuite/printf.tests
testsuite/tar.tests

index eb51410..fd12460 100755 (executable)
@@ -4,6 +4,11 @@
 
 . ./testing.sh
 
+test x"`id -u`" = x"0" || {
+       echo "SKIPPED: makedevs (must be root to test this)"
+       exit 0
+}
+
 unset LANG
 unset LC_COLLATE
 unset LC_ALL
index b48e293..9a3c874 100755 (executable)
@@ -89,9 +89,9 @@ testing "printf understands %Ld" \
 
 testing "printf handles %d bad_input" \
        "${bb}printf '%d\n' 1 - 2 bad 3 123bad 4 2>&1; echo \$?" \
-"1\n""printf: -: invalid number\n""0\n"\
-"2\n""printf: bad: invalid number\n""0\n"\
-"3\n""printf: 123bad: invalid number\n""0\n"\
+"1\n""printf: invalid number '-'\n""0\n"\
+"2\n""printf: invalid number 'bad'\n""0\n"\
+"3\n""printf: invalid number '123bad'\n""0\n"\
 "4\n""1\n" \
        "" ""
 
index cef16b6..8b2523f 100755 (executable)
@@ -55,11 +55,13 @@ rm -rf input_* test.tar 2>/dev/null
 chmod 741 input_hard1
 ln input_hard1 input_hard2
 mkdir input_dir
-chmod 550 input_dir
 ln input_hard1 input_dir
 ln input_hard2 input_dir
+chmod 550 input_dir
 tar cf test.tar input_*
 tar tvf test.tar | sed "s/.*[0-9] input/input/"
+chmod 770 input_dir
+rm -rf input_*
 tar xf test.tar 2>&1
 echo Ok: $?
 ls -l . input_dir/* | grep input_ | sed "s/\\(^[^ ]*\\) .* input/\\1 input/"
@@ -86,11 +88,13 @@ rm -rf input_* test.tar 2>/dev/null
 chmod 741 input_file
 ln -s input_file input_soft
 mkdir input_dir
-chmod 550 input_dir
 ln input_file input_dir
 ln input_soft input_dir
+chmod 550 input_dir
 tar cf test.tar input_*
 tar tvf test.tar | sed "s/.*[0-9] input/input/" | sort
+chmod 770 input_dir
+rm -rf input_*
 tar xf test.tar 2>&1
 echo Ok: $?
 ls -l . input_dir/* | grep input_ | sed "s/\\(^[^ ]*\\) .* input/\\1 input/"