diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-12 15:59:32 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-12 15:59:32 +0200 |
commit | e82cf339e476126e4016e417aee3c6eb52c702c9 (patch) | |
tree | af480d4552cb63fcf8ee28600986e9c16c7adb6a | |
parent | a2215b98f7d65bc613b9c8f008d79672402c6a07 (diff) | |
download | busybox-w32-e82cf339e476126e4016e417aee3c6eb52c702c9.tar.gz busybox-w32-e82cf339e476126e4016e417aee3c6eb52c702c9.tar.bz2 busybox-w32-e82cf339e476126e4016e417aee3c6eb52c702c9.zip |
randomtest fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-x | testsuite/ash.tests | 2 | ||||
-rw-r--r-- | testsuite/cut/cut-cuts-a-field | 2 | ||||
-rw-r--r-- | testsuite/date/date-R-works | 9 | ||||
-rw-r--r-- | testsuite/du/du-h-works | 6 | ||||
-rw-r--r-- | testsuite/du/du-k-works | 8 | ||||
-rw-r--r-- | testsuite/du/du-l-works | 10 | ||||
-rw-r--r-- | testsuite/du/du-m-works | 6 | ||||
-rw-r--r-- | testsuite/du/du-s-works | 4 | ||||
-rw-r--r-- | testsuite/du/du-works | 4 | ||||
-rw-r--r-- | testsuite/expand/expand-works-like-GNU | 8 | ||||
-rw-r--r-- | testsuite/hostid/hostid-works | 10 | ||||
-rw-r--r-- | testsuite/hostname/hostname-d-works | 5 | ||||
-rwxr-xr-x | testsuite/rx.tests | 4 | ||||
-rwxr-xr-x | testsuite/sed.tests | 4 | ||||
-rwxr-xr-x | testsuite/tar.tests | 2 | ||||
-rw-r--r-- | testsuite/tr/tr-works | 2 |
16 files changed, 51 insertions, 35 deletions
diff --git a/testsuite/ash.tests b/testsuite/ash.tests index 183394a20..dd626e6d1 100755 --- a/testsuite/ash.tests +++ b/testsuite/ash.tests | |||
@@ -71,7 +71,7 @@ testing "2 bytes which are not valid unicode chars followed by left arrow key" \ | |||
71 | # not checked by the test), then read and execute the rest: "echo A | ..." | 71 | # not checked by the test), then read and execute the rest: "echo A | ..." |
72 | # The bug was that ash was eating the beginning of "echo A" despite the pause. | 72 | # The bug was that ash was eating the beginning of "echo A" despite the pause. |
73 | testing "Invalid unicode chars followed by a pause do not eat next chars" \ | 73 | testing "Invalid unicode chars followed by a pause do not eat next chars" \ |
74 | "{ echo -ne 'echo \xff\n'; sleep 1; echo -ne 'echo A | hexdump -C >ash.output; exit; exit; exit; exit\n'; } \ | 74 | "{ $ECHO -ne 'echo \xff\n'; sleep 1; $ECHO -ne 'echo A | hexdump -C >ash.output; exit; exit; exit; exit\n'; } \ |
75 | | script -q -c 'ash' /dev/null >/dev/null; cat ash.output" \ | 75 | | script -q -c 'ash' /dev/null >/dev/null; cat ash.output" \ |
76 | "\ | 76 | "\ |
77 | 00000000 41 0a |A.| | 77 | 00000000 41 0a |A.| |
diff --git a/testsuite/cut/cut-cuts-a-field b/testsuite/cut/cut-cuts-a-field index 4c7f44007..e200b6b78 100644 --- a/testsuite/cut/cut-cuts-a-field +++ b/testsuite/cut/cut-cuts-a-field | |||
@@ -1 +1 @@ | |||
test $(echo -e "f1\tf2\tf3" | busybox cut -f 2) = f2 | test $($ECHO -e "f1\tf2\tf3" | busybox cut -f 2) = f2 | ||
diff --git a/testsuite/date/date-R-works b/testsuite/date/date-R-works index 34cd735e5..d05634456 100644 --- a/testsuite/date/date-R-works +++ b/testsuite/date/date-R-works | |||
@@ -1 +1,8 @@ | |||
1 | test x"`date -R`" = x"`busybox date -R`" | 1 | dt1="`date -R`" |
2 | # Wait for the start of next second | ||
3 | dt="$dt1" | ||
4 | while test x"$dt" = x"$dt1"; do | ||
5 | dt="`date -R`" | ||
6 | done | ||
7 | |||
8 | test x"$dt" = x"`busybox date -R`" | ||
diff --git a/testsuite/du/du-h-works b/testsuite/du/du-h-works index a1b4b4905..c18433c29 100644 --- a/testsuite/du/du-h-works +++ b/testsuite/du/du-h-works | |||
@@ -1,6 +1,4 @@ | |||
1 | # FEATURE: CONFIG_FEATURE_HUMAN_READABLE | 1 | # FEATURE: CONFIG_FEATURE_HUMAN_READABLE |
2 | 2 | ||
3 | d=/bin | 3 | dd if=/dev/zero of=file bs=1M count=1 2>/dev/null |
4 | du -h "$d" > logfile.gnu | 4 | test x"`busybox du -h .`" = x"1.0M ." |
5 | busybox du -h "$d" > logfile.bb | ||
6 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/du/du-k-works b/testsuite/du/du-k-works index 6c2c5d073..a52264945 100644 --- a/testsuite/du/du-k-works +++ b/testsuite/du/du-k-works | |||
@@ -1,4 +1,4 @@ | |||
1 | d=/bin | 1 | dd if=/dev/zero of=file1 bs=1k count=64 2>/dev/null |
2 | du -k "$d" > logfile.gnu | 2 | dd if=/dev/zero of=file2 bs=1k count=16 2>/dev/null |
3 | busybox du -k "$d" > logfile.bb | 3 | test x"`busybox du -k .`" = x"80 ." \ |
4 | cmp logfile.gnu logfile.bb | 4 | -o x"`busybox du -k .`" = x"88 ." \ |
diff --git a/testsuite/du/du-l-works b/testsuite/du/du-l-works index 64dcf8726..6b150e0dd 100644 --- a/testsuite/du/du-l-works +++ b/testsuite/du/du-l-works | |||
@@ -1,6 +1,8 @@ | |||
1 | # FEATURE: CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K | 1 | # FEATURE: CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K |
2 | 2 | ||
3 | d=/bin | 3 | dd if=/dev/zero of=file1 bs=1k count=64 2>/dev/null |
4 | du -l "$d" > logfile.gnu | 4 | ln file1 file1.1 |
5 | busybox du -l "$d" > logfile.bb | 5 | dd if=/dev/zero of=file2 bs=1k count=16 2>/dev/null |
6 | cmp logfile.gnu logfile.bb | 6 | test x"`busybox du -l .`" = x"144 ." \ |
7 | -o x"`busybox du -l .`" = x"148 ." \ | ||
8 | -o x"`busybox du -l .`" = x"152 ." \ | ||
diff --git a/testsuite/du/du-m-works b/testsuite/du/du-m-works index 6e733c016..9fa7437ac 100644 --- a/testsuite/du/du-m-works +++ b/testsuite/du/du-m-works | |||
@@ -1,6 +1,4 @@ | |||
1 | # FEATURE: CONFIG_FEATURE_HUMAN_READABLE | 1 | # FEATURE: CONFIG_FEATURE_HUMAN_READABLE |
2 | 2 | ||
3 | d=/bin | 3 | dd if=/dev/zero of=file bs=1M count=1 2>/dev/null |
4 | du -m "$d" > logfile.gnu | 4 | test x"`busybox du -m .`" = x"1 ." |
5 | busybox du -m "$d" > logfile.bb | ||
6 | cmp logfile.gnu logfile.bb | ||
diff --git a/testsuite/du/du-s-works b/testsuite/du/du-s-works index 0c870ceb5..534432cb0 100644 --- a/testsuite/du/du-s-works +++ b/testsuite/du/du-s-works | |||
@@ -3,4 +3,6 @@ | |||
3 | d=/bin | 3 | d=/bin |
4 | du -s "$d" > logfile.gnu | 4 | du -s "$d" > logfile.gnu |
5 | busybox du -s "$d" > logfile.bb | 5 | busybox du -s "$d" > logfile.bb |
6 | cmp logfile.gnu logfile.bb | 6 | cmp logfile.gnu logfile.bb && exit 0 |
7 | diff -u logfile.gnu logfile.bb | ||
8 | exit 1 | ||
diff --git a/testsuite/du/du-works b/testsuite/du/du-works index 4db684a9b..e320f1dd0 100644 --- a/testsuite/du/du-works +++ b/testsuite/du/du-works | |||
@@ -3,4 +3,6 @@ | |||
3 | d=/bin | 3 | d=/bin |
4 | du "$d" > logfile.gnu | 4 | du "$d" > logfile.gnu |
5 | busybox du "$d" > logfile.bb | 5 | busybox du "$d" > logfile.bb |
6 | cmp logfile.gnu logfile.bb | 6 | cmp logfile.gnu logfile.bb && exit 0 |
7 | diff -u logfile.gnu logfile.bb | ||
8 | exit 1 | ||
diff --git a/testsuite/expand/expand-works-like-GNU b/testsuite/expand/expand-works-like-GNU index 843111275..b0278d88d 100644 --- a/testsuite/expand/expand-works-like-GNU +++ b/testsuite/expand/expand-works-like-GNU | |||
@@ -1,8 +1,8 @@ | |||
1 | # FEATURE: CONFIG_UNEXPAND | 1 | # FEATURE: CONFIG_UNEXPAND |
2 | 2 | ||
3 | rm -f foo bar | 3 | rm -f foo bar |
4 | echo -e "\ty" | expand -t 3 ../../busybox > foo | 4 | $ECHO -e "\ty" | expand -t 3 ../../busybox > foo |
5 | echo -e "\ty" | busybox unexpand -t 3 ../../busybox > bar | 5 | $ECHO -e "\ty" | busybox unexpand -t 3 ../../busybox > bar |
6 | set +e | 6 | set +e |
7 | test ! -f foo -a -f bar | 7 | test ! -f foo -a -f bar |
8 | if [ $? = 0 ] ; then | 8 | if [ $? = 0 ] ; then |
@@ -10,8 +10,8 @@ if [ $? = 0 ] ; then | |||
10 | diff -q foo bar | 10 | diff -q foo bar |
11 | fi | 11 | fi |
12 | rm -f foo bar | 12 | rm -f foo bar |
13 | echo -e "\ty\tx" | expand -it 3 ../../busybox > foo | 13 | $ECHO -e "\ty\tx" | expand -it 3 ../../busybox > foo |
14 | echo -e "\ty\tx" | busybox unexpand -it 3 ../../busybox > bar | 14 | $ECHO -e "\ty\tx" | busybox unexpand -it 3 ../../busybox > bar |
15 | set +e | 15 | set +e |
16 | test ! -f foo -a -f bar | 16 | test ! -f foo -a -f bar |
17 | if [ $? = 0 ] ; then | 17 | if [ $? = 0 ] ; then |
diff --git a/testsuite/hostid/hostid-works b/testsuite/hostid/hostid-works index e85698e66..bcfd717af 100644 --- a/testsuite/hostid/hostid-works +++ b/testsuite/hostid/hostid-works | |||
@@ -1,2 +1,8 @@ | |||
1 | test x$(hostid) = x$(busybox hostid) | 1 | h=x$(busybox hostid) |
2 | 2 | # Is $h a sequence of hex numbers? | |
3 | x="${h//[0123456789abcdef]/x}" | ||
4 | x="${x//xxx/x}" | ||
5 | x="${x//xxx/x}" | ||
6 | x="${x//xxx/x}" | ||
7 | x="${x//xx/x}" | ||
8 | test x"$x" = x"x" | ||
diff --git a/testsuite/hostname/hostname-d-works b/testsuite/hostname/hostname-d-works index a9aeb92cb..e062242bb 100644 --- a/testsuite/hostname/hostname-d-works +++ b/testsuite/hostname/hostname-d-works | |||
@@ -1,2 +1,3 @@ | |||
1 | test x$(hostname -d) = x$(busybox hostname -d) | 1 | f=$(busybox hostname -f) |
2 | 2 | d=$(busybox hostname -d) | |
3 | test x"${f#*.}" = x"$d" | ||
diff --git a/testsuite/rx.tests b/testsuite/rx.tests index c2b8814a2..985fcdc01 100755 --- a/testsuite/rx.tests +++ b/testsuite/rx.tests | |||
@@ -18,9 +18,9 @@ testing "rx" \ | |||
18 | 00000000 43 06 06 |C..|\n\ | 18 | 00000000 43 06 06 |C..|\n\ |
19 | 00000003\n\ | 19 | 00000003\n\ |
20 | ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????" \ | 20 | ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????" \ |
21 | "" "\1\1\376\ | 21 | "" "\01\01\0376\ |
22 | ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????\ | 22 | ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????\ |
23 | \x1A\x1A\x1A\x1A\x1A\x4B\xB0\4" | 23 | \x1A\x1A\x1A\x1A\x1A\x4B\xB0\04" |
24 | 24 | ||
25 | rm -f rx.OUTFILE 2>/dev/null | 25 | rm -f rx.OUTFILE 2>/dev/null |
26 | 26 | ||
diff --git a/testsuite/sed.tests b/testsuite/sed.tests index 5b0750cac..88b9c4e4b 100755 --- a/testsuite/sed.tests +++ b/testsuite/sed.tests | |||
@@ -110,7 +110,7 @@ testing "sed embedded NUL" "sed -e 's/woo/bang/'" "\0bang\0woo\0" "" \ | |||
110 | testing "sed embedded NUL g" "sed -e 's/woo/bang/g'" "bang\0bang\0" "" \ | 110 | testing "sed embedded NUL g" "sed -e 's/woo/bang/g'" "bang\0bang\0" "" \ |
111 | "woo\0woo\0" | 111 | "woo\0woo\0" |
112 | test x"$SKIP_KNOWN_BUGS" = x"" && { | 112 | test x"$SKIP_KNOWN_BUGS" = x"" && { |
113 | echo -e "/woo/a he\0llo" > sed.commands | 113 | $ECHO -e "/woo/a he\0llo" > sed.commands |
114 | testing "sed NUL in command" "sed -f sed.commands" "woo\nhe\0llo\n" "" "woo" | 114 | testing "sed NUL in command" "sed -f sed.commands" "woo\nhe\0llo\n" "" "woo" |
115 | rm sed.commands | 115 | rm sed.commands |
116 | } | 116 | } |
@@ -153,7 +153,7 @@ testing "sed clusternewline" \ | |||
153 | "one\none\n111\n222\ntwo\ntwo" "one" "two" | 153 | "one\none\n111\n222\ntwo\ntwo" "one" "two" |
154 | } | 154 | } |
155 | testing "sed subst+write" \ | 155 | testing "sed subst+write" \ |
156 | "sed -e 's/i/z/' -e 'woutputw' input -; echo -n X; cat outputw" \ | 156 | "sed -e 's/i/z/' -e 'woutputw' input -; $ECHO -n X; cat outputw" \ |
157 | "thzngy\nagaznXthzngy\nagazn" "thingy" "again" | 157 | "thzngy\nagaznXthzngy\nagazn" "thingy" "again" |
158 | rm outputw | 158 | rm outputw |
159 | testing "sed trailing NUL" \ | 159 | testing "sed trailing NUL" \ |
diff --git a/testsuite/tar.tests b/testsuite/tar.tests index d1d4165ca..f40079037 100755 --- a/testsuite/tar.tests +++ b/testsuite/tar.tests | |||
@@ -84,7 +84,7 @@ chmod 550 input_dir | |||
84 | ln input_file input_dir | 84 | ln input_file input_dir |
85 | ln input_soft input_dir | 85 | ln input_soft input_dir |
86 | tar cf test.tar input_* | 86 | tar cf test.tar input_* |
87 | tar tvf test.tar | sed "s/.*[0-9] input/input/" | 87 | tar tvf test.tar | sed "s/.*[0-9] input/input/" | sort |
88 | tar xf test.tar 2>&1 | 88 | tar xf test.tar 2>&1 |
89 | echo Ok: $? | 89 | echo Ok: $? |
90 | ls -l . input_dir/* | grep input_ | sed "s/\\(^[^ ]*\\) .* input/\\1 input/" | 90 | ls -l . input_dir/* | grep input_ | sed "s/\\(^[^ ]*\\) .* input/\\1 input/" |
diff --git a/testsuite/tr/tr-works b/testsuite/tr/tr-works index 3783971ce..5e4a30ee4 100644 --- a/testsuite/tr/tr-works +++ b/testsuite/tr/tr-works | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | run_tr () | 3 | run_tr () |
4 | { | 4 | { |
5 | echo -n "echo '$1' | tr '$2' '$3': " | 5 | $ECHO -n "echo '$1' | tr '$2' '$3': " |
6 | echo "$1" | $bb tr "$2" "$3" | 6 | echo "$1" | $bb tr "$2" "$3" |
7 | echo | 7 | echo |
8 | } | 8 | } |