randomtest fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2010-05-11 03:53:57 +02:00
parent 6334390aef
commit bfa1b2e8e8
31 changed files with 123 additions and 61 deletions

View File

@ -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 /* .gz and .bz2 both have 2-byte signature, and their
* unpack_XXX_stream wants this header skipped. */ * unpack_XXX_stream wants this header skipped. */
xread(fd, &magic, 2); xread(fd, &magic, 2);
#if ENABLE_FEATURE_SEAMLESS_GZ if (ENABLE_FEATURE_SEAMLESS_GZ
&& magic[0] == 0x1f && magic[1] == 0x8b
) {
# if BB_MMU # if BB_MMU
xformer = unpack_gz_stream; xformer = unpack_gz_stream;
# else # else
xformer_prog = "gunzip"; xformer_prog = "gunzip";
# endif # endif
goto found_magic;
}
if (ENABLE_FEATURE_SEAMLESS_BZ2
&& magic[0] == 'B' && magic[1] == 'Z'
) {
# if BB_MMU
xformer = unpack_bz2_stream;
# else
xformer_prog = "bunzip2";
# endif # endif
if (!ENABLE_FEATURE_SEAMLESS_GZ goto found_magic;
|| magic[0] != 0x1f || magic[1] != 0x8b }
) {
if (!ENABLE_FEATURE_SEAMLESS_BZ2
|| magic[0] != 'B' || magic[1] != 'Z'
) {
// TODO: xz format support. rpm adopted it, "rpm -i FILE.rpm" badly needs this. // TODO: xz format support. rpm adopted it, "rpm -i FILE.rpm" badly needs this.
// Signature: 0xFD, '7', 'z', 'X', 'Z', 0x00 // Signature: 0xFD, '7', 'z', 'X', 'Z', 0x00
// More info at: http://tukaani.org/xz/xz-file-format.txt // More info at: http://tukaani.org/xz/xz-file-format.txt
/* No known magic seen */
if (fail_if_not_detected) if (fail_if_not_detected)
bb_error_msg_and_die("no gzip" bb_error_msg_and_die("no gzip"
IF_FEATURE_SEAMLESS_BZ2("/bzip2") IF_FEATURE_SEAMLESS_BZ2("/bzip2")
" magic"); " magic");
xlseek(fd, -2, SEEK_CUR); xlseek(fd, -2, SEEK_CUR);
return fd; return fd;
}
#if BB_MMU found_magic:
xformer = unpack_bz2_stream;
#else
xformer_prog = "bunzip2";
#endif
} else {
# if !BB_MMU # if !BB_MMU
/* NOMMU version of open_transformer execs /* NOMMU version of open_transformer execs
* an external unzipper that wants * an external unzipper that wants
* file position at the start of the file */ * file position at the start of the file */
xlseek(fd, -2, SEEK_CUR); xlseek(fd, -2, SEEK_CUR);
# endif # endif
}
open_transformer(fd, xformer, xformer_prog); open_transformer(fd, xformer, xformer_prog);
return fd; return fd;

View File

@ -22,6 +22,6 @@ testing "ar replaces things in archives" \
"blast!\n" \ "blast!\n" \
"" \ "" \
"" ""
rm test.a rm test.a file1 file1 2>/dev/null
exit $FAILCOUNT exit $FAILCOUNT

View File

@ -18,9 +18,11 @@ testing "awk -F case 7" "awk -F '[#]' '{ print NF }'" "5\n" "" "z##abc##zz\n"
# 4294967295 = 0xffffffff # 4294967295 = 0xffffffff
testing "awk bitwise op" "awk '{ print or(4294967295,1) }'" "4.29497e+09\n" "" "\n" 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 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 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" testing "awk oct const" "awk '{ print or(01234,1) }'" "669\n" "" "\n"
SKIP=
# long field seps requiring regex # long field seps requiring regex
testing "awk long field sep" "awk -F-- '{ print NF, length(\$NF), \$NF }'" \ testing "awk long field sep" "awk -F-- '{ print NF, length(\$NF), \$NF }'" \

View File

@ -10,8 +10,9 @@ HELPDUMP=`true | busybox 2>&1 | cat`
# We need to test under calling the binary under other names. # 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" "" "" testing "busybox --help busybox" "true | busybox --help busybox 2>&1 | cat" "$HELPDUMP\n\n" "" ""
SKIP=
ln -s `which busybox` busybox-suffix ln -s `which busybox` busybox-suffix
for i in busybox ./busybox-suffix for i in busybox ./busybox-suffix
@ -26,11 +27,11 @@ do
testing "$i --help" "$i --help 2>&1" "$HELPDUMP\n\n" "" "" testing "$i --help" "$i --help 2>&1" "$HELPDUMP\n\n" "" ""
optional CAT optional SHOW_USAGE CAT
testing "" "$i cat" "moo" "" "moo" testing "" "$i cat" "moo" "" "moo"
testing "$i --help cat" "$i --help cat 2>&1 | grep print" \ testing "$i --help cat" "$i --help cat 2>&1 | grep print" \
"Concatenate FILEs and print them to stdout\n" "" "" "Concatenate FILEs and print them to stdout\n" "" ""
optional "" SKIP=
testing "$i --help unknown" "$i --help unknown 2>&1" \ testing "$i --help unknown" "$i --help unknown 2>&1" \
"unknown: applet not found\n" "" "" "unknown: applet not found\n" "" ""

View File

@ -31,6 +31,7 @@ rm -rf cpio.testdir cpio.testdir2 2>/dev/null
# testing "test name" "command" "expected result" "file input" "stdin" # testing "test name" "command" "expected result" "file input" "stdin"
optional FEATURE_LS_SORTFILES
testing "cpio extracts zero-sized hardlinks" \ testing "cpio extracts zero-sized hardlinks" \
"$ECHO -ne '$hexdump' | bzcat | cpio -i 2>&1; echo \$?; "$ECHO -ne '$hexdump' | bzcat | cpio -i 2>&1; echo \$?;
ls -ln cpio.testdir | $FILTER_LS" \ ls -ln cpio.testdir | $FILTER_LS" \
@ -41,6 +42,7 @@ ls -ln cpio.testdir | $FILTER_LS" \
-rw-r--r-- 2 $user $group 0 y -rw-r--r-- 2 $user $group 0 y
" \ " \
"" "" "" ""
SKIP=
test x"$SKIP_KNOWN_BUGS" = x"" && { test x"$SKIP_KNOWN_BUGS" = x"" && {

View File

@ -106,6 +106,7 @@ rm -rf diff1 diff2
mkdir diff1 diff2 diff2/subdir mkdir diff1 diff2 diff2/subdir
echo qwe >diff1/- echo qwe >diff1/-
echo asd >diff2/subdir/- echo asd >diff2/subdir/-
optional FEATURE_DIFF_DIR
testing "diff diff1 diff2/subdir" \ testing "diff diff1 diff2/subdir" \
"diff -ur diff1 diff2/subdir | $TRIM_TAB" \ "diff -ur diff1 diff2/subdir | $TRIM_TAB" \
"\ "\
@ -116,8 +117,10 @@ testing "diff diff1 diff2/subdir" \
+asd +asd
" \ " \
"" "" "" ""
SKIP=
# using directory structure from prev test... # using directory structure from prev test...
optional FEATURE_DIFF_DIR
testing "diff dir dir2/file/-" \ testing "diff dir dir2/file/-" \
"diff -ur diff1 diff2/subdir/- | $TRIM_TAB" \ "diff -ur diff1 diff2/subdir/- | $TRIM_TAB" \
"\ "\
@ -128,10 +131,12 @@ testing "diff dir dir2/file/-" \
+asd +asd
" \ " \
"" "" "" ""
SKIP=
# using directory structure from prev test... # using directory structure from prev test...
mkdir diff1/test mkdir diff1/test
mkfifo diff2/subdir/test mkfifo diff2/subdir/test
optional FEATURE_DIFF_DIR
testing "diff of dir and fifo" \ testing "diff of dir and fifo" \
"diff -ur diff1 diff2/subdir | $TRIM_TAB" \ "diff -ur diff1 diff2/subdir | $TRIM_TAB" \
"\ "\
@ -143,10 +148,12 @@ testing "diff of dir and fifo" \
Only in diff2/subdir: test Only in diff2/subdir: test
" \ " \
"" "" "" ""
SKIP=
# using directory structure from prev test... # using directory structure from prev test...
rmdir diff1/test rmdir diff1/test
echo >diff1/test echo >diff1/test
optional FEATURE_DIFF_DIR
testing "diff of file and fifo" \ testing "diff of file and fifo" \
"diff -ur diff1 diff2/subdir | $TRIM_TAB" \ "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 File diff2/subdir/test is not a regular file or directory and was skipped
" \ " \
"" "" "" ""
SKIP=
# using directory structure from prev test... # using directory structure from prev test...
mkfifo diff1/test2 mkfifo diff1/test2
optional FEATURE_DIFF_DIR
testing "diff -rN does not read non-regular files" \ testing "diff -rN does not read non-regular files" \
"diff -urN diff1 diff2/subdir | $TRIM_TAB" \ "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 File diff1/test2 is not a regular file or directory and was skipped
" \ " \
"" "" "" ""
SKIP=
# clean up # clean up
rm -rf diff1 diff2 rm -rf diff1 diff2

View File

@ -1,3 +1,5 @@
# FEATURE: CONFIG_FEATURE_HUMAN_READABLE
d=/bin d=/bin
du -h "$d" > logfile.gnu du -h "$d" > logfile.gnu
busybox du -h "$d" > logfile.bb busybox du -h "$d" > logfile.bb

View File

@ -1,3 +1,5 @@
# FEATURE: CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K
d=/bin d=/bin
du -l "$d" > logfile.gnu du -l "$d" > logfile.gnu
busybox du -l "$d" > logfile.bb busybox du -l "$d" > logfile.bb

View File

@ -1,3 +1,5 @@
# FEATURE: CONFIG_FEATURE_HUMAN_READABLE
d=/bin d=/bin
du -m "$d" > logfile.gnu du -m "$d" > logfile.gnu
busybox du -m "$d" > logfile.bb busybox du -m "$d" > logfile.bb

View File

@ -1,3 +1,5 @@
# FEATURE: CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K
d=/bin d=/bin
du -s "$d" > logfile.gnu du -s "$d" > logfile.gnu
busybox du -s "$d" > logfile.bb busybox du -s "$d" > logfile.bb

View File

@ -1,3 +1,5 @@
# FEATURE: CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K
d=/bin d=/bin
du "$d" > logfile.gnu du "$d" > logfile.gnu
busybox du "$d" > logfile.bb busybox du "$d" > logfile.bb

View File

@ -1 +1,3 @@
# FEATURE: CONFIG_FEATURE_FANCY_ECHO
test `busybox echo -n word | wc -c` -eq 4 test `busybox echo -n word | wc -c` -eq 4

View File

@ -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" test "`busybox echo -e -n 'msg\n\0' | od -t x1 | head -n 1`" = "0000000 6d 73 67 0a 00"

View File

@ -1 +1,3 @@
# FEATURE: CONFIG_FEATURE_FIND_XDEV
busybox find . -xdev >/dev/null 2>&1 busybox find . -xdev >/dev/null 2>&1

View File

@ -1,3 +1,5 @@
# FEATURE: CONFIG_FEATURE_LS_SORTFILES
[ -n "$d" ] || d=.. [ -n "$d" ] || d=..
LC_ALL=C ls -1 "$d" > logfile.gnu LC_ALL=C ls -1 "$d" > logfile.gnu
LC_ALL=C busybox ls -1 "$d" > logfile.bb LC_ALL=C busybox ls -1 "$d" > logfile.bb

View File

@ -1,3 +1,5 @@
# FEATURE: CONFIG_FEATURE_LS_SORTFILES CONFIG_FEATURE_HUMAN_READABLE
[ -n "$d" ] || d=.. [ -n "$d" ] || d=..
LC_ALL=C ls -h "$d" > logfile.gnu LC_ALL=C ls -h "$d" > logfile.gnu
LC_ALL=C busybox ls -h "$d" > logfile.bb LC_ALL=C busybox ls -h "$d" > logfile.bb

View File

@ -16,7 +16,7 @@ FILTER_LS2="sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-4,9-"
rm -rf makedevs.testdir rm -rf makedevs.testdir
mkdir 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 ." \ testing "makedevs -d ../makedevs.device_table.txt ." \
"(cd makedevs.testdir && makedevs -d ../makedevs.device_table.txt . 2>&1); "(cd makedevs.testdir && makedevs -d ../makedevs.device_table.txt . 2>&1);
find makedevs.testdir ! -type d | sort | xargs ls -lnR | $FILTER_LS" \ find makedevs.testdir ! -type d | sort | xargs ls -lnR | $FILTER_LS" \

View File

@ -1,3 +1,5 @@
# FEATURE: CONFIG_FEATURE_MD5_SHA1_SUM_CHECK
touch foo touch foo
md5sum foo > bar md5sum foo > bar
busybox md5sum -c bar busybox md5sum -c bar

View File

@ -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 # 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" \ testing "mdev add /block/sda" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \ ls -ln mdev.testdir/dev | $FILTER_LS" \
@ -41,7 +41,7 @@ SKIP=
rm -rf mdev.testdir/dev/* rm -rf mdev.testdir/dev/*
echo ".* 1:1 666" >mdev.testdir/etc/mdev.conf echo ".* 1:1 666" >mdev.testdir/etc/mdev.conf
echo "sda 2:2 444" >>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" \ testing "mdev stops on first rule" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \ ls -ln mdev.testdir/dev | $FILTER_LS" \
@ -55,7 +55,7 @@ SKIP=
rm -rf mdev.testdir/dev/* rm -rf mdev.testdir/dev/*
echo "-.* 1:1 666" >mdev.testdir/etc/mdev.conf echo "-.* 1:1 666" >mdev.testdir/etc/mdev.conf
echo "sda 2:2 444" >>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" \ testing "mdev does not stop on dash-rule" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \ 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 1:1 666" >mdev.testdir/etc/mdev.conf
echo "\$MODALIAS=qw. 2:2 444" >>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 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" \ testing "mdev \$ENVVAR=regex match" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda MODALIAS=qwe chroot mdev.testdir /mdev 2>&1; "env - PATH=$PATH ACTION=add DEVPATH=/block/sda MODALIAS=qwe chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \ ls -ln mdev.testdir/dev | $FILTER_LS" \
@ -83,7 +83,7 @@ SKIP=
# continuing to use directory structure from prev test # continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/* rm -rf mdev.testdir/dev/*
echo "sda 0:0 444 >disk/scsiA" >mdev.testdir/etc/mdev.conf 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'" \ testing "mdev move/symlink rule '>bar/baz'" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \ ls -lnR mdev.testdir/dev | $FILTER_LS2" \
@ -101,7 +101,7 @@ SKIP=
# continuing to use directory structure from prev test # continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/* rm -rf mdev.testdir/dev/*
echo "sda 0:0 444 >disk/" >mdev.testdir/etc/mdev.conf 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/'" \ testing "mdev move/symlink rule '>bar/'" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \ ls -lnR mdev.testdir/dev | $FILTER_LS2" \
@ -120,7 +120,7 @@ SKIP=
rm -rf mdev.testdir/dev/* rm -rf mdev.testdir/dev/*
# here we complicate things by having non-matching group 1 and using %0 # 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 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" \ testing "mdev regexp substring match + replace" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \ ls -lnR mdev.testdir/dev | $FILTER_LS2" \
@ -138,7 +138,7 @@ SKIP=
# continuing to use directory structure from prev test # continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/* rm -rf mdev.testdir/dev/*
echo "sda 0:0 644 @echo @echo TEST" >mdev.testdir/etc/mdev.conf 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" \ testing "mdev command" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS" \ ls -lnR mdev.testdir/dev | $FILTER_LS" \
@ -153,7 +153,7 @@ SKIP=
# continuing to use directory structure from prev test # continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/* rm -rf mdev.testdir/dev/*
echo "sda 0:0 644 =block/ @echo @echo TEST:\$MDEV" >mdev.testdir/etc/mdev.conf 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" \ testing "mdev move and command" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \ ls -lnR mdev.testdir/dev | $FILTER_LS2" \
@ -171,7 +171,7 @@ SKIP=
# continuing to use directory structure from prev test # continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/* rm -rf mdev.testdir/dev/*
echo "@8,0 0:1 644" >mdev.testdir/etc/mdev.conf 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" \ testing "mdev #maj,min and no explicit uid" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS" \ 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.0%1" >>mdev.testdir/etc/mdev.conf
echo "capi([0-9]*) 0:0 0660 =capi20.%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 # 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" \ 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; env - PATH=$PATH ACTION=add DEVPATH=/class/tty/capi chroot mdev.testdir /mdev 2>&1;

View File

@ -4,14 +4,17 @@
. ./testing.sh . ./testing.sh
test -f "$bindir/.config" && . "$bindir/.config"
test "`id -u`" = 0 || { test "`id -u`" = 0 || {
echo "SKIPPED: must be root to test this" echo "SKIPPED: mount (must be root to test this)"
exit 0 exit 0
} }
optional MKFS_MINIX if test x"$CONFIG_MKFS_MINIX" != x"y" \
if [ -n "$SKIP" ] || test x"$CONFIG_FEATURE_MINIX2" != x"y" \
then || test x"$CONFIG_FEATURE_DEVFS" = x"y" \
; then
echo "SKIPPED: mount" echo "SKIPPED: mount"
exit 0 exit 0
fi fi

View File

@ -6,6 +6,7 @@
# testing "test name" "options" "expected result" "file input" "stdin" # testing "test name" "options" "expected result" "file input" "stdin"
optional DESKTOP
testing "od -b" \ testing "od -b" \
"od -b" \ "od -b" \
"\ "\
@ -13,5 +14,6 @@ testing "od -b" \
0000005 0000005
" \ " \
"" "HELLO" "" "HELLO"
SKIP=
exit $FAILCOUNT exit $FAILCOUNT

View File

@ -123,4 +123,6 @@ abc
+456 +456
" \ " \
rm input.orig 2>/dev/null
exit $FAILCOUNT exit $FAILCOUNT

View File

@ -20,12 +20,14 @@ testing "pidof this" "pidof pidof.tests | grep -o -w $$" "$$\n" "" ""
optional FEATURE_PIDOF_SINGLE optional FEATURE_PIDOF_SINGLE
testing "pidof -s" "pidof -s init" "1\n" "" "" 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, # 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 # 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" "pidof -o %PPID pidof.tests | grep -o -w $$" "" "" ""
testing "pidof -o %PPID NOP" "pidof -o %PPID -s init" "1\n" "" "" testing "pidof -o %PPID NOP" "pidof -o %PPID -s init" "1\n" "" ""
testing "pidof -o init" "pidof -o 1 init | grep -o -w 1" "" "" "" testing "pidof -o init" "pidof -o 1 init | grep -o -w 1" "" "" ""
SKIP=
exit $FAILCOUNT exit $FAILCOUNT

View File

@ -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" "sort -n -k2 -t ' '" " a \n 1 \n 2 \n" "" " 2 \n 1 \n a \n"
testing "sort file in place" \ testing "sort file in place" \
"strace -oZZZ sort -o input input && cat input" "\ "sort -o input input && cat input" "\
111 111
222 222
" "\ " "\

View File

@ -1,3 +1,5 @@
# FEATURE: CONFIG_INCLUDE_SUSv2
$ECHO -ne "abc\ndef\n123\n" >input $ECHO -ne "abc\ndef\n123\n" >input
$ECHO -ne "def\n123\n" >logfile.ok $ECHO -ne "def\n123\n" >logfile.ok
busybox tail -2 input > logfile.bb busybox tail -2 input > logfile.bb

View File

@ -9,7 +9,7 @@ mkdir tar.tempdir && cd tar.tempdir || exit 1
# testing "test name" "script" "expected result" "file input" "stdin" # 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" '\ testing "tar hardlinks and repeated files" '\
rm -rf input_* test.tar 2>/dev/null rm -rf input_* test.tar 2>/dev/null
>input_hard1 >input_hard1
@ -42,7 +42,7 @@ drwxr-xr-x input_dir
"" "" "" ""
SKIP= SKIP=
optional FEATURE_TAR_CREATE optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES
testing "tar hardlinks mode" '\ testing "tar hardlinks mode" '\
rm -rf input_* test.tar 2>/dev/null rm -rf input_* test.tar 2>/dev/null
>input_hard1 >input_hard1
@ -73,7 +73,7 @@ dr-xr-x--- input_dir
"" "" "" ""
SKIP= SKIP=
optional FEATURE_TAR_CREATE optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES
testing "tar symlinks mode" '\ testing "tar symlinks mode" '\
rm -rf input_* test.tar 2>/dev/null rm -rf input_* test.tar 2>/dev/null
>input_file >input_file

View File

@ -1,4 +1,5 @@
# FEATURE: CONFIG_FEATURE_TAR_UNAME_GNAME # FEATURE: CONFIG_FEATURE_TAR_UNAME_GNAME
# FEATURE: CONFIG_DESKTOP
tar1_bz2() tar1_bz2()
{ {

View File

@ -15,17 +15,23 @@ testing "tr understands 0-9A-F" \
"tr -cd '[0-9A-F]'" \ "tr -cd '[0-9A-F]'" \
"19AF" "" "19AFH\n" "19AF" "" "19AFH\n"
optional CONFIG_FEATURE_TR_CLASSES
testing "tr understands [:xdigit:]" \ testing "tr understands [:xdigit:]" \
"tr -cd '[:xdigit:]'" \ "tr -cd '[:xdigit:]'" \
"19AF" "" "19AFH\n" "19AF" "" "19AFH\n"
SKIP=
optional CONFIG_FEATURE_TR_CLASSES
testing "tr does not stop after [:digit:]" \ testing "tr does not stop after [:digit:]" \
"tr '[:digit:]y-z' 111111111123" \ "tr '[:digit:]y-z' 111111111123" \
"111abcx23\n" "" "789abcxyz\n" "111abcx23\n" "" "789abcxyz\n"
SKIP=
optional CONFIG_FEATURE_TR_CLASSES
testing "tr has correct xdigit sequence" \ testing "tr has correct xdigit sequence" \
"tr '[:xdigit:]Gg' 1111111151242222333330xX" \ "tr '[:xdigit:]Gg' 1111111151242222333330xX" \
"#1111111151242222x333330X\n" "" \ "#1111111151242222x333330X\n" "" \
"#0123456789ABCDEFGabcdefg\n" "#0123456789ABCDEFGabcdefg\n"
SKIP=
exit $FAILCOUNT exit $FAILCOUNT

View File

@ -1,3 +1,5 @@
# FEATURE: CONFIG_FEATURE_TR_CLASSES
echo testing | tr -d '[[:alnum:]]' > logfile.gnu echo testing | tr -d '[[:alnum:]]' > logfile.gnu
echo testing | busybox tr -d '[[:alnum:]]' > logfile.bb echo testing | busybox tr -d '[[:alnum:]]' > logfile.bb

View File

@ -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 echo t12esting | tr -d '[:alpha:]' >> logfile.gnu
echo t12esting | tr -d '[[:alpha:]' >> logfile.gnu echo t12esting | tr -d '[[:alpha:]' >> logfile.gnu

View File

@ -1,3 +1,5 @@
# FEATURE: CONFIG_FEATURE_TR_CLASSES
run_tr () run_tr ()
{ {
echo -n "echo '$1' | tr '$2' '$3': " echo -n "echo '$1' | tr '$2' '$3': "