From bfa1b2e8e8aaddcf849011a12cb2ac634b27f339 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 11 May 2010 03:53:57 +0200 Subject: [PATCH] randomtest fixes Signed-off-by: Denys Vlasenko --- libbb/read.c | 61 ++++++++++--------- testsuite/ar.tests | 4 +- testsuite/awk.tests | 2 + testsuite/busybox.tests | 7 ++- testsuite/cpio.tests | 2 + testsuite/diff.tests | 10 +++ testsuite/du/du-h-works | 2 + testsuite/du/du-l-works | 2 + testsuite/du/du-m-works | 2 + testsuite/du/du-s-works | 2 + testsuite/du/du-works | 2 + testsuite/echo/echo-does-not-print-newline | 2 + testsuite/echo/echo-prints-slash-zero | 2 + testsuite/find/find-supports-minus-xdev | 2 + testsuite/ls/ls-1-works | 2 + testsuite/ls/ls-h-works | 2 + testsuite/makedevs.tests | 2 +- .../md5sum/md5sum-verifies-non-binary-file | 2 + testsuite/mdev.tests | 22 +++---- testsuite/mount.tests | 15 +++-- testsuite/od.tests | 2 + testsuite/patch.tests | 2 + testsuite/pidof.tests | 4 +- testsuite/sort.tests | 2 +- testsuite/tail/tail-works | 2 + testsuite/tar.tests | 6 +- testsuite/tar/tar_with_prefix_fields | 1 + testsuite/tr.tests | 6 ++ testsuite/tr/tr-d-alnum-works | 2 + testsuite/tr/tr-rejects-wrong-class | 2 + testsuite/tr/tr-works | 2 + 31 files changed, 120 insertions(+), 58 deletions(-) diff --git a/libbb/read.c b/libbb/read.c index 21e005c6f..f3af144f0 100644 --- a/libbb/read.c +++ b/libbb/read.c @@ -321,44 +321,45 @@ int FAST_FUNC setup_unzip_on_fd(int fd /*, int fail_if_not_detected*/) /* .gz and .bz2 both have 2-byte signature, and their * unpack_XXX_stream wants this header skipped. */ xread(fd, &magic, 2); -#if ENABLE_FEATURE_SEAMLESS_GZ + if (ENABLE_FEATURE_SEAMLESS_GZ + && magic[0] == 0x1f && magic[1] == 0x8b + ) { # if BB_MMU - xformer = unpack_gz_stream; + xformer = unpack_gz_stream; # else - xformer_prog = "gunzip"; + xformer_prog = "gunzip"; # endif -#endif - if (!ENABLE_FEATURE_SEAMLESS_GZ - || magic[0] != 0x1f || magic[1] != 0x8b + goto found_magic; + } + if (ENABLE_FEATURE_SEAMLESS_BZ2 + && magic[0] == 'B' && magic[1] == 'Z' ) { - if (!ENABLE_FEATURE_SEAMLESS_BZ2 - || magic[0] != 'B' || magic[1] != 'Z' - ) { - +# if BB_MMU + xformer = unpack_bz2_stream; +# else + xformer_prog = "bunzip2"; +# endif + goto found_magic; + } // TODO: xz format support. rpm adopted it, "rpm -i FILE.rpm" badly needs this. // Signature: 0xFD, '7', 'z', 'X', 'Z', 0x00 // More info at: http://tukaani.org/xz/xz-file-format.txt - if (fail_if_not_detected) - bb_error_msg_and_die("no gzip" - IF_FEATURE_SEAMLESS_BZ2("/bzip2") - " magic"); - xlseek(fd, -2, SEEK_CUR); - return fd; - } -#if BB_MMU - xformer = unpack_bz2_stream; -#else - xformer_prog = "bunzip2"; -#endif - } else { -#if !BB_MMU - /* NOMMU version of open_transformer execs - * an external unzipper that wants - * file position at the start of the file */ - xlseek(fd, -2, SEEK_CUR); -#endif - } + /* No known magic seen */ + if (fail_if_not_detected) + bb_error_msg_and_die("no gzip" + IF_FEATURE_SEAMLESS_BZ2("/bzip2") + " magic"); + xlseek(fd, -2, SEEK_CUR); + return fd; + + found_magic: +# if !BB_MMU + /* NOMMU version of open_transformer execs + * an external unzipper that wants + * file position at the start of the file */ + xlseek(fd, -2, SEEK_CUR); +# endif open_transformer(fd, xformer, xformer_prog); return fd; diff --git a/testsuite/ar.tests b/testsuite/ar.tests index f112eb64a..4630d08a4 100755 --- a/testsuite/ar.tests +++ b/testsuite/ar.tests @@ -18,10 +18,10 @@ testing "ar creates archives" \ rm test.a testing "ar replaces things in archives" \ - "echo 'blah!' >file1 && echo 'blast!'> file2 && ar cr test.a README file1 file2 && mv file2 file1 && ar cr test.a file1 && ar p test.a file1" \ + "echo 'blah!' >file1 && echo 'blast!' >file2 && ar cr test.a README file1 file2 && mv file2 file1 && ar cr test.a file1 && ar p test.a file1" \ "blast!\n" \ "" \ "" -rm test.a +rm test.a file1 file1 2>/dev/null exit $FAILCOUNT diff --git a/testsuite/awk.tests b/testsuite/awk.tests index efa03a79a..0691a7972 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests @@ -18,9 +18,11 @@ testing "awk -F case 7" "awk -F '[#]' '{ print NF }'" "5\n" "" "z##abc##zz\n" # 4294967295 = 0xffffffff testing "awk bitwise op" "awk '{ print or(4294967295,1) }'" "4.29497e+09\n" "" "\n" +optional DESKTOP testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4.29497e+09\n" "" "\n" testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2.14748e+09\n" "" "\n" testing "awk oct const" "awk '{ print or(01234,1) }'" "669\n" "" "\n" +SKIP= # long field seps requiring regex testing "awk long field sep" "awk -F-- '{ print NF, length(\$NF), \$NF }'" \ diff --git a/testsuite/busybox.tests b/testsuite/busybox.tests index 6eeb3251d..18ac36fc4 100755 --- a/testsuite/busybox.tests +++ b/testsuite/busybox.tests @@ -10,8 +10,9 @@ HELPDUMP=`true | busybox 2>&1 | cat` # We need to test under calling the binary under other names. - +optional SHOW_USAGE testing "busybox --help busybox" "true | busybox --help busybox 2>&1 | cat" "$HELPDUMP\n\n" "" "" +SKIP= ln -s `which busybox` busybox-suffix for i in busybox ./busybox-suffix @@ -26,11 +27,11 @@ do testing "$i --help" "$i --help 2>&1" "$HELPDUMP\n\n" "" "" - optional CAT + optional SHOW_USAGE CAT testing "" "$i cat" "moo" "" "moo" testing "$i --help cat" "$i --help cat 2>&1 | grep print" \ "Concatenate FILEs and print them to stdout\n" "" "" - optional "" + SKIP= testing "$i --help unknown" "$i --help unknown 2>&1" \ "unknown: applet not found\n" "" "" diff --git a/testsuite/cpio.tests b/testsuite/cpio.tests index b4c41dd9a..8cb8b787b 100755 --- a/testsuite/cpio.tests +++ b/testsuite/cpio.tests @@ -31,6 +31,7 @@ rm -rf cpio.testdir cpio.testdir2 2>/dev/null # testing "test name" "command" "expected result" "file input" "stdin" +optional FEATURE_LS_SORTFILES testing "cpio extracts zero-sized hardlinks" \ "$ECHO -ne '$hexdump' | bzcat | cpio -i 2>&1; echo \$?; ls -ln cpio.testdir | $FILTER_LS" \ @@ -41,6 +42,7 @@ ls -ln cpio.testdir | $FILTER_LS" \ -rw-r--r-- 2 $user $group 0 y " \ "" "" +SKIP= test x"$SKIP_KNOWN_BUGS" = x"" && { diff --git a/testsuite/diff.tests b/testsuite/diff.tests index 72ebb6c4c..06d5a4fd7 100755 --- a/testsuite/diff.tests +++ b/testsuite/diff.tests @@ -106,6 +106,7 @@ rm -rf diff1 diff2 mkdir diff1 diff2 diff2/subdir echo qwe >diff1/- echo asd >diff2/subdir/- +optional FEATURE_DIFF_DIR testing "diff diff1 diff2/subdir" \ "diff -ur diff1 diff2/subdir | $TRIM_TAB" \ "\ @@ -116,8 +117,10 @@ testing "diff diff1 diff2/subdir" \ +asd " \ "" "" +SKIP= # using directory structure from prev test... +optional FEATURE_DIFF_DIR testing "diff dir dir2/file/-" \ "diff -ur diff1 diff2/subdir/- | $TRIM_TAB" \ "\ @@ -128,10 +131,12 @@ testing "diff dir dir2/file/-" \ +asd " \ "" "" +SKIP= # using directory structure from prev test... mkdir diff1/test mkfifo diff2/subdir/test +optional FEATURE_DIFF_DIR testing "diff of dir and fifo" \ "diff -ur diff1 diff2/subdir | $TRIM_TAB" \ "\ @@ -143,10 +148,12 @@ testing "diff of dir and fifo" \ Only in diff2/subdir: test " \ "" "" +SKIP= # using directory structure from prev test... rmdir diff1/test echo >diff1/test +optional FEATURE_DIFF_DIR testing "diff of file and fifo" \ "diff -ur diff1 diff2/subdir | $TRIM_TAB" \ "\ @@ -158,9 +165,11 @@ testing "diff of file and fifo" \ File diff2/subdir/test is not a regular file or directory and was skipped " \ "" "" +SKIP= # using directory structure from prev test... mkfifo diff1/test2 +optional FEATURE_DIFF_DIR testing "diff -rN does not read non-regular files" \ "diff -urN diff1 diff2/subdir | $TRIM_TAB" \ "\ @@ -173,6 +182,7 @@ File diff2/subdir/test is not a regular file or directory and was skipped File diff1/test2 is not a regular file or directory and was skipped " \ "" "" +SKIP= # clean up rm -rf diff1 diff2 diff --git a/testsuite/du/du-h-works b/testsuite/du/du-h-works index 3f8ff3d0b..a1b4b4905 100644 --- a/testsuite/du/du-h-works +++ b/testsuite/du/du-h-works @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_FEATURE_HUMAN_READABLE + d=/bin du -h "$d" > logfile.gnu busybox du -h "$d" > logfile.bb diff --git a/testsuite/du/du-l-works b/testsuite/du/du-l-works index c3d2ec0c1..64dcf8726 100644 --- a/testsuite/du/du-l-works +++ b/testsuite/du/du-l-works @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K + d=/bin du -l "$d" > logfile.gnu busybox du -l "$d" > logfile.bb diff --git a/testsuite/du/du-m-works b/testsuite/du/du-m-works index bf0a90e1b..6e733c016 100644 --- a/testsuite/du/du-m-works +++ b/testsuite/du/du-m-works @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_FEATURE_HUMAN_READABLE + d=/bin du -m "$d" > logfile.gnu busybox du -m "$d" > logfile.bb diff --git a/testsuite/du/du-s-works b/testsuite/du/du-s-works index ae970772a..0c870ceb5 100644 --- a/testsuite/du/du-s-works +++ b/testsuite/du/du-s-works @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K + d=/bin du -s "$d" > logfile.gnu busybox du -s "$d" > logfile.bb diff --git a/testsuite/du/du-works b/testsuite/du/du-works index 46a336dc3..4db684a9b 100644 --- a/testsuite/du/du-works +++ b/testsuite/du/du-works @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K + d=/bin du "$d" > logfile.gnu busybox du "$d" > logfile.bb diff --git a/testsuite/echo/echo-does-not-print-newline b/testsuite/echo/echo-does-not-print-newline index 2ed03caf5..2857c0d13 100644 --- a/testsuite/echo/echo-does-not-print-newline +++ b/testsuite/echo/echo-does-not-print-newline @@ -1 +1,3 @@ +# FEATURE: CONFIG_FEATURE_FANCY_ECHO + test `busybox echo -n word | wc -c` -eq 4 diff --git a/testsuite/echo/echo-prints-slash-zero b/testsuite/echo/echo-prints-slash-zero index d2466326f..d97ed8e66 100644 --- a/testsuite/echo/echo-prints-slash-zero +++ b/testsuite/echo/echo-prints-slash-zero @@ -1 +1,3 @@ +# FEATURE: CONFIG_FEATURE_FANCY_ECHO + test "`busybox echo -e -n 'msg\n\0' | od -t x1 | head -n 1`" = "0000000 6d 73 67 0a 00" diff --git a/testsuite/find/find-supports-minus-xdev b/testsuite/find/find-supports-minus-xdev index 4c559a1f4..c807fc8f2 100644 --- a/testsuite/find/find-supports-minus-xdev +++ b/testsuite/find/find-supports-minus-xdev @@ -1 +1,3 @@ +# FEATURE: CONFIG_FEATURE_FIND_XDEV + busybox find . -xdev >/dev/null 2>&1 diff --git a/testsuite/ls/ls-1-works b/testsuite/ls/ls-1-works index 885694920..71ab9a66b 100644 --- a/testsuite/ls/ls-1-works +++ b/testsuite/ls/ls-1-works @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_FEATURE_LS_SORTFILES + [ -n "$d" ] || d=.. LC_ALL=C ls -1 "$d" > logfile.gnu LC_ALL=C busybox ls -1 "$d" > logfile.bb diff --git a/testsuite/ls/ls-h-works b/testsuite/ls/ls-h-works index 0c83f7cc5..60016bac1 100644 --- a/testsuite/ls/ls-h-works +++ b/testsuite/ls/ls-h-works @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_FEATURE_LS_SORTFILES CONFIG_FEATURE_HUMAN_READABLE + [ -n "$d" ] || d=.. LC_ALL=C ls -h "$d" > logfile.gnu LC_ALL=C busybox ls -h "$d" > logfile.bb diff --git a/testsuite/makedevs.tests b/testsuite/makedevs.tests index 72fc933d3..f69b4a6b1 100755 --- a/testsuite/makedevs.tests +++ b/testsuite/makedevs.tests @@ -16,7 +16,7 @@ FILTER_LS2="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-4,9-" rm -rf makedevs.testdir mkdir makedevs.testdir -optional FEATURE_MAKEDEVS_TABLE FEATURE_FIND_NOT FEATURE_FIND_TYPE FEATURE_LS_RECURSIVE +optional FEATURE_MAKEDEVS_TABLE FEATURE_FIND_NOT FEATURE_FIND_TYPE FEATURE_LS_RECURSIVE FEATURE_LS_SORTFILES testing "makedevs -d ../makedevs.device_table.txt ." \ "(cd makedevs.testdir && makedevs -d ../makedevs.device_table.txt . 2>&1); find makedevs.testdir ! -type d | sort | xargs ls -lnR | $FILTER_LS" \ diff --git a/testsuite/md5sum/md5sum-verifies-non-binary-file b/testsuite/md5sum/md5sum-verifies-non-binary-file index 8566a234d..1df818eb5 100644 --- a/testsuite/md5sum/md5sum-verifies-non-binary-file +++ b/testsuite/md5sum/md5sum-verifies-non-binary-file @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_FEATURE_MD5_SHA1_SUM_CHECK + touch foo md5sum foo > bar busybox md5sum -c bar diff --git a/testsuite/mdev.tests b/testsuite/mdev.tests index 270f6292e..0b4525483 100755 --- a/testsuite/mdev.tests +++ b/testsuite/mdev.tests @@ -27,7 +27,7 @@ echo "8:0" >mdev.testdir/sys/block/sda/dev # env - PATH=$PATH: on some systems chroot binary won't otherwise be found -optional STATIC +optional STATIC FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME testing "mdev add /block/sda" \ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; ls -ln mdev.testdir/dev | $FILTER_LS" \ @@ -41,7 +41,7 @@ SKIP= rm -rf mdev.testdir/dev/* echo ".* 1:1 666" >mdev.testdir/etc/mdev.conf echo "sda 2:2 444" >>mdev.testdir/etc/mdev.conf -optional STATIC FEATURE_MDEV_CONF +optional STATIC FEATURE_MDEV_CONF FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME testing "mdev stops on first rule" \ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; ls -ln mdev.testdir/dev | $FILTER_LS" \ @@ -55,7 +55,7 @@ SKIP= rm -rf mdev.testdir/dev/* echo "-.* 1:1 666" >mdev.testdir/etc/mdev.conf echo "sda 2:2 444" >>mdev.testdir/etc/mdev.conf -optional STATIC FEATURE_MDEV_CONF +optional STATIC FEATURE_MDEV_CONF FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME testing "mdev does not stop on dash-rule" \ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; ls -ln mdev.testdir/dev | $FILTER_LS" \ @@ -70,7 +70,7 @@ rm -rf mdev.testdir/dev/* echo "\$MODALIAS=qw 1:1 666" >mdev.testdir/etc/mdev.conf echo "\$MODALIAS=qw. 2:2 444" >>mdev.testdir/etc/mdev.conf echo "\$MODALIAS=qw. 3:3 400" >>mdev.testdir/etc/mdev.conf -optional STATIC FEATURE_MDEV_CONF +optional STATIC FEATURE_MDEV_CONF FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME testing "mdev \$ENVVAR=regex match" \ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda MODALIAS=qwe chroot mdev.testdir /mdev 2>&1; ls -ln mdev.testdir/dev | $FILTER_LS" \ @@ -83,7 +83,7 @@ SKIP= # continuing to use directory structure from prev test rm -rf mdev.testdir/dev/* echo "sda 0:0 444 >disk/scsiA" >mdev.testdir/etc/mdev.conf -optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE +optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME testing "mdev move/symlink rule '>bar/baz'" \ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; ls -lnR mdev.testdir/dev | $FILTER_LS2" \ @@ -101,7 +101,7 @@ SKIP= # continuing to use directory structure from prev test rm -rf mdev.testdir/dev/* echo "sda 0:0 444 >disk/" >mdev.testdir/etc/mdev.conf -optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE +optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME testing "mdev move/symlink rule '>bar/'" \ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; ls -lnR mdev.testdir/dev | $FILTER_LS2" \ @@ -120,7 +120,7 @@ SKIP= rm -rf mdev.testdir/dev/* # here we complicate things by having non-matching group 1 and using %0 echo "s([0-9])*d([a-z]+) 0:0 644 >sd/%2_%0" >mdev.testdir/etc/mdev.conf -optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE +optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME testing "mdev regexp substring match + replace" \ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; ls -lnR mdev.testdir/dev | $FILTER_LS2" \ @@ -138,7 +138,7 @@ SKIP= # continuing to use directory structure from prev test rm -rf mdev.testdir/dev/* echo "sda 0:0 644 @echo @echo TEST" >mdev.testdir/etc/mdev.conf -optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE +optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME testing "mdev command" \ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; ls -lnR mdev.testdir/dev | $FILTER_LS" \ @@ -153,7 +153,7 @@ SKIP= # continuing to use directory structure from prev test rm -rf mdev.testdir/dev/* echo "sda 0:0 644 =block/ @echo @echo TEST:\$MDEV" >mdev.testdir/etc/mdev.conf -optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE +optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME testing "mdev move and command" \ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; ls -lnR mdev.testdir/dev | $FILTER_LS2" \ @@ -171,7 +171,7 @@ SKIP= # continuing to use directory structure from prev test rm -rf mdev.testdir/dev/* echo "@8,0 0:1 644" >mdev.testdir/etc/mdev.conf -optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE +optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME testing "mdev #maj,min and no explicit uid" \ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; ls -lnR mdev.testdir/dev | $FILTER_LS" \ @@ -194,7 +194,7 @@ echo "capi 0:0 0660 =capi20" >mdev.testdir/etc/mdev.conf echo "capi([0-9]) 0:0 0660 =capi20.0%1" >>mdev.testdir/etc/mdev.conf echo "capi([0-9]*) 0:0 0660 =capi20.%1" >>mdev.testdir/etc/mdev.conf # mdev invocation with DEVPATH=/class/tty/capi20 was deleting /dev/capi20 -optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE +optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME testing "move rule does not delete node with name == device_name" \ "\ env - PATH=$PATH ACTION=add DEVPATH=/class/tty/capi chroot mdev.testdir /mdev 2>&1; diff --git a/testsuite/mount.tests b/testsuite/mount.tests index 043586f05..ee13ec285 100755 --- a/testsuite/mount.tests +++ b/testsuite/mount.tests @@ -4,16 +4,19 @@ . ./testing.sh +test -f "$bindir/.config" && . "$bindir/.config" + test "`id -u`" = 0 || { - echo "SKIPPED: must be root to test this" + echo "SKIPPED: mount (must be root to test this)" exit 0 } -optional MKFS_MINIX -if [ -n "$SKIP" ] -then - echo "SKIPPED: mount" - exit 0 +if test x"$CONFIG_MKFS_MINIX" != x"y" \ +|| test x"$CONFIG_FEATURE_MINIX2" != x"y" \ +|| test x"$CONFIG_FEATURE_DEVFS" = x"y" \ +; then + echo "SKIPPED: mount" + exit 0 fi testdir=$PWD/testdir diff --git a/testsuite/od.tests b/testsuite/od.tests index 0bf1f4c54..a2d015ad7 100755 --- a/testsuite/od.tests +++ b/testsuite/od.tests @@ -6,6 +6,7 @@ # testing "test name" "options" "expected result" "file input" "stdin" +optional DESKTOP testing "od -b" \ "od -b" \ "\ @@ -13,5 +14,6 @@ testing "od -b" \ 0000005 " \ "" "HELLO" +SKIP= exit $FAILCOUNT diff --git a/testsuite/patch.tests b/testsuite/patch.tests index f3e607186..749d936ea 100755 --- a/testsuite/patch.tests +++ b/testsuite/patch.tests @@ -123,4 +123,6 @@ abc +456 " \ +rm input.orig 2>/dev/null + exit $FAILCOUNT diff --git a/testsuite/pidof.tests b/testsuite/pidof.tests index 45df1a958..624b0a720 100755 --- a/testsuite/pidof.tests +++ b/testsuite/pidof.tests @@ -20,12 +20,14 @@ testing "pidof this" "pidof pidof.tests | grep -o -w $$" "$$\n" "" "" optional FEATURE_PIDOF_SINGLE testing "pidof -s" "pidof -s init" "1\n" "" "" +SKIP= -optional FEATURE_PIDOF_OMIT +optional FEATURE_PIDOF_OMIT FEATURE_PIDOF_SINGLE # This test fails now because process name matching logic has changed, # but new logic is not "wrong" either... see find_pid_by_name.c comments #testing "pidof -o %PPID" "pidof -o %PPID pidof.tests | grep -o -w $$" "" "" "" testing "pidof -o %PPID NOP" "pidof -o %PPID -s init" "1\n" "" "" testing "pidof -o init" "pidof -o 1 init | grep -o -w 1" "" "" "" +SKIP= exit $FAILCOUNT diff --git a/testsuite/sort.tests b/testsuite/sort.tests index 72df80b1f..8a810f8d4 100755 --- a/testsuite/sort.tests +++ b/testsuite/sort.tests @@ -118,7 +118,7 @@ testing "sort key doesn't strip leading blanks, disables fallback global sort" \ "sort -n -k2 -t ' '" " a \n 1 \n 2 \n" "" " 2 \n 1 \n a \n" testing "sort file in place" \ -"strace -oZZZ sort -o input input && cat input" "\ +"sort -o input input && cat input" "\ 111 222 " "\ diff --git a/testsuite/tail/tail-works b/testsuite/tail/tail-works index f3434d1a9..50eca136e 100644 --- a/testsuite/tail/tail-works +++ b/testsuite/tail/tail-works @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_INCLUDE_SUSv2 + $ECHO -ne "abc\ndef\n123\n" >input $ECHO -ne "def\n123\n" >logfile.ok busybox tail -2 input > logfile.bb diff --git a/testsuite/tar.tests b/testsuite/tar.tests index ecd212fbf..8599b79fc 100755 --- a/testsuite/tar.tests +++ b/testsuite/tar.tests @@ -9,7 +9,7 @@ mkdir tar.tempdir && cd tar.tempdir || exit 1 # testing "test name" "script" "expected result" "file input" "stdin" -optional FEATURE_TAR_CREATE +optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES testing "tar hardlinks and repeated files" '\ rm -rf input_* test.tar 2>/dev/null >input_hard1 @@ -42,7 +42,7 @@ drwxr-xr-x input_dir "" "" SKIP= -optional FEATURE_TAR_CREATE +optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES testing "tar hardlinks mode" '\ rm -rf input_* test.tar 2>/dev/null >input_hard1 @@ -73,7 +73,7 @@ dr-xr-x--- input_dir "" "" SKIP= -optional FEATURE_TAR_CREATE +optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES testing "tar symlinks mode" '\ rm -rf input_* test.tar 2>/dev/null >input_file diff --git a/testsuite/tar/tar_with_prefix_fields b/testsuite/tar/tar_with_prefix_fields index 56dcac59d..8c1fda795 100644 --- a/testsuite/tar/tar_with_prefix_fields +++ b/testsuite/tar/tar_with_prefix_fields @@ -1,4 +1,5 @@ # FEATURE: CONFIG_FEATURE_TAR_UNAME_GNAME +# FEATURE: CONFIG_DESKTOP tar1_bz2() { diff --git a/testsuite/tr.tests b/testsuite/tr.tests index 9706056c9..a1f83bfc6 100755 --- a/testsuite/tr.tests +++ b/testsuite/tr.tests @@ -15,17 +15,23 @@ testing "tr understands 0-9A-F" \ "tr -cd '[0-9A-F]'" \ "19AF" "" "19AFH\n" +optional CONFIG_FEATURE_TR_CLASSES testing "tr understands [:xdigit:]" \ "tr -cd '[:xdigit:]'" \ "19AF" "" "19AFH\n" +SKIP= +optional CONFIG_FEATURE_TR_CLASSES testing "tr does not stop after [:digit:]" \ "tr '[:digit:]y-z' 111111111123" \ "111abcx23\n" "" "789abcxyz\n" +SKIP= +optional CONFIG_FEATURE_TR_CLASSES testing "tr has correct xdigit sequence" \ "tr '[:xdigit:]Gg' 1111111151242222333330xX" \ "#1111111151242222x333330X\n" "" \ "#0123456789ABCDEFGabcdefg\n" +SKIP= exit $FAILCOUNT diff --git a/testsuite/tr/tr-d-alnum-works b/testsuite/tr/tr-d-alnum-works index d440f8f3b..6540ea527 100644 --- a/testsuite/tr/tr-d-alnum-works +++ b/testsuite/tr/tr-d-alnum-works @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_FEATURE_TR_CLASSES + echo testing | tr -d '[[:alnum:]]' > logfile.gnu echo testing | busybox tr -d '[[:alnum:]]' > logfile.bb diff --git a/testsuite/tr/tr-rejects-wrong-class b/testsuite/tr/tr-rejects-wrong-class index 97539360d..1d488a3df 100644 --- a/testsuite/tr/tr-rejects-wrong-class +++ b/testsuite/tr/tr-rejects-wrong-class @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_FEATURE_TR_CLASSES + echo t12esting | tr -d '[[:alpha:]]' > logfile.gnu echo t12esting | tr -d '[:alpha:]' >> logfile.gnu echo t12esting | tr -d '[[:alpha:]' >> logfile.gnu diff --git a/testsuite/tr/tr-works b/testsuite/tr/tr-works index 2c0a9d196..3783971ce 100644 --- a/testsuite/tr/tr-works +++ b/testsuite/tr/tr-works @@ -1,3 +1,5 @@ +# FEATURE: CONFIG_FEATURE_TR_CLASSES + run_tr () { echo -n "echo '$1' | tr '$2' '$3': " -- 2.25.1