aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/basename/basename-works2
-rw-r--r--testsuite/cmp/cmp-detects-difference8
-rw-r--r--testsuite/cp/cp-a-files-to-dir8
-rw-r--r--testsuite/cp/cp-a-preserves-links2
-rw-r--r--testsuite/cp/cp-d-files-to-dir4
-rw-r--r--testsuite/cp/cp-does-not-copy-unreadable-file2
-rw-r--r--testsuite/cp/cp-preserves-links2
-rw-r--r--testsuite/date/date-R-works2
-rw-r--r--testsuite/date/date-format-works1
-rw-r--r--testsuite/date/date-u-works2
-rw-r--r--testsuite/date/date-works2
-rw-r--r--testsuite/dirname/dirname-works2
-rw-r--r--testsuite/du/du-h-works3
-rw-r--r--testsuite/du/du-k-works3
-rw-r--r--testsuite/du/du-l-works3
-rw-r--r--testsuite/du/du-m-works3
-rw-r--r--testsuite/du/du-s-works3
-rw-r--r--testsuite/du/du-works3
-rw-r--r--testsuite/echo/echo-prints-argument2
-rw-r--r--testsuite/expr/expr-works59
-rw-r--r--testsuite/grep/grep-matches-NUL8
-rw-r--r--testsuite/head/head-n-works3
-rw-r--r--testsuite/head/head-works3
-rw-r--r--testsuite/hostid/hostid-works2
-rw-r--r--testsuite/hostname/hostname-d-works2
-rw-r--r--testsuite/hostname/hostname-i-works2
-rw-r--r--testsuite/hostname/hostname-s-works1
-rw-r--r--testsuite/hostname/hostname-works1
-rw-r--r--testsuite/id/id-g-works1
-rw-r--r--testsuite/id/id-u-works1
-rw-r--r--testsuite/id/id-un-works1
-rw-r--r--testsuite/id/id-ur-works1
-rw-r--r--testsuite/ln/ln-creates-hard-links4
-rw-r--r--testsuite/ln/ln-creates-soft-links4
-rw-r--r--testsuite/ln/ln-force-creates-hard-links5
-rw-r--r--testsuite/ln/ln-force-creates-soft-links5
-rw-r--r--testsuite/ln/ln-preserves-hard-links8
-rw-r--r--testsuite/ln/ln-preserves-soft-links9
-rw-r--r--testsuite/ls/ls-1-works3
-rw-r--r--testsuite/ls/ls-h-works3
-rw-r--r--testsuite/ls/ls-l-works3
-rw-r--r--testsuite/ls/ls-s-works3
-rw-r--r--testsuite/mv/mv-files-to-dir16
-rw-r--r--testsuite/mv/mv-follows-links4
-rw-r--r--testsuite/mv/mv-moves-empty-file4
-rw-r--r--testsuite/mv/mv-moves-hardlinks4
-rw-r--r--testsuite/mv/mv-moves-large-file4
-rw-r--r--testsuite/mv/mv-moves-small-file4
-rw-r--r--testsuite/mv/mv-moves-symlinks6
-rw-r--r--testsuite/mv/mv-moves-unreadable-files5
-rw-r--r--testsuite/mv/mv-preserves-hard-links6
-rw-r--r--testsuite/mv/mv-preserves-links5
-rw-r--r--testsuite/mv/mv-refuses-mv-dir-to-subdir23
-rw-r--r--testsuite/mv/mv-removes-source-file4
-rw-r--r--testsuite/pwd/pwd-prints-working-directory2
-rwxr-xr-xtestsuite/runtest34
-rw-r--r--testsuite/sed/sed-append-next-line7
-rw-r--r--testsuite/sort/sort-n-works3
-rw-r--r--testsuite/sort/sort-r-works3
-rw-r--r--testsuite/sort/sort-works3
-rw-r--r--testsuite/strings/strings-works-like-GNU7
-rw-r--r--testsuite/tail/tail-n-works3
-rw-r--r--testsuite/tail/tail-works3
-rw-r--r--testsuite/tar/tar-extracts-multiple-files3
-rw-r--r--testsuite/tr/tr-d-works4
-rw-r--r--testsuite/tr/tr-non-gnu1
-rw-r--r--testsuite/tr/tr-works9
-rw-r--r--testsuite/uptime/uptime-works2
-rw-r--r--testsuite/uuencode/uuencode-sets-standard-input-mode-correctly2
-rw-r--r--testsuite/which/which-uses-default-path3
-rw-r--r--testsuite/xargs/xargs-works3
71 files changed, 316 insertions, 50 deletions
diff --git a/testsuite/basename/basename-works b/testsuite/basename/basename-works
new file mode 100644
index 000000000..38907d4c1
--- /dev/null
+++ b/testsuite/basename/basename-works
@@ -0,0 +1,2 @@
1test x$(basename $(pwd)) = x$(busybox basename $(pwd))
2
diff --git a/testsuite/cmp/cmp-detects-difference b/testsuite/cmp/cmp-detects-difference
index aa0744487..b9bb628f1 100644
--- a/testsuite/cmp/cmp-detects-difference
+++ b/testsuite/cmp/cmp-detects-difference
@@ -1,3 +1,9 @@
1echo foo >foo 1echo foo >foo
2echo bar >bar 2echo bar >bar
3! busybox cmp -s foo bar 3set +e
4busybox cmp -s foo bar
5if [ $? != 0 ] ; then
6 exit 0;
7fi
8
9exit 1;
diff --git a/testsuite/cp/cp-a-files-to-dir b/testsuite/cp/cp-a-files-to-dir
index 8fb3c201d..39f8f8103 100644
--- a/testsuite/cp/cp-a-files-to-dir
+++ b/testsuite/cp/cp-a-files-to-dir
@@ -8,7 +8,7 @@ busybox cp -a file1 file2 link1 dir1 there
8test -f there/file1 8test -f there/file1
9test -f there/file2 9test -f there/file2
10test ! -s there/dir1/file3 10test ! -s there/dir1/file3
11test -l there/link1 11test -L there/link1
12test `readlink there/link1` = "file2" 12test xfile2 = x`readlink there/link1`
13test ! file3 -ot there/dir1/file3 13test ! dir1/file3 -ot there/dir1/file3
14test ! file3 -nt there/dir1/file3 14test ! dir1/file3 -nt there/dir1/file3
diff --git a/testsuite/cp/cp-a-preserves-links b/testsuite/cp/cp-a-preserves-links
index aae8313c6..0c0cd9653 100644
--- a/testsuite/cp/cp-a-preserves-links
+++ b/testsuite/cp/cp-a-preserves-links
@@ -2,4 +2,4 @@ touch foo
2ln -s foo bar 2ln -s foo bar
3busybox cp -a bar baz 3busybox cp -a bar baz
4test -L baz 4test -L baz
5test `readlink baz` = "foo" 5test xfoo = x`readlink baz`
diff --git a/testsuite/cp/cp-d-files-to-dir b/testsuite/cp/cp-d-files-to-dir
index 9407ead00..9571a567e 100644
--- a/testsuite/cp/cp-d-files-to-dir
+++ b/testsuite/cp/cp-d-files-to-dir
@@ -7,5 +7,5 @@ busybox cp -d file1 file2 file3 link1 there
7test -f there/file1 7test -f there/file1
8test -f there/file2 8test -f there/file2
9test ! -s there/file3 9test ! -s there/file3
10test -l there/link1 10test -L there/link1
11test `readlink there/link1` = "file2" 11test xfile2 = x`readlink there/link1`
diff --git a/testsuite/cp/cp-does-not-copy-unreadable-file b/testsuite/cp/cp-does-not-copy-unreadable-file
index 68c576727..ce11bfab0 100644
--- a/testsuite/cp/cp-does-not-copy-unreadable-file
+++ b/testsuite/cp/cp-does-not-copy-unreadable-file
@@ -1,4 +1,6 @@
1touch foo 1touch foo
2chmod a-r foo 2chmod a-r foo
3set +e
3busybox cp foo bar 4busybox cp foo bar
5set -e
4test ! -f bar 6test ! -f bar
diff --git a/testsuite/cp/cp-preserves-links b/testsuite/cp/cp-preserves-links
index d3223b132..301dc5fd8 100644
--- a/testsuite/cp/cp-preserves-links
+++ b/testsuite/cp/cp-preserves-links
@@ -2,4 +2,4 @@ touch foo
2ln -s foo bar 2ln -s foo bar
3busybox cp -d bar baz 3busybox cp -d bar baz
4test -L baz 4test -L baz
5test `readlink baz` = "foo" 5test xfoo = x`readlink baz`
diff --git a/testsuite/date/date-R-works b/testsuite/date/date-R-works
new file mode 100644
index 000000000..ec3a06751
--- /dev/null
+++ b/testsuite/date/date-R-works
@@ -0,0 +1,2 @@
1test x"`date -R`" = x"`busybox date -R`"
2
diff --git a/testsuite/date/date-format-works b/testsuite/date/date-format-works
new file mode 100644
index 000000000..f28d06cfc
--- /dev/null
+++ b/testsuite/date/date-format-works
@@ -0,0 +1 @@
test x"`date +%d/%m/%y`" = x"`busybox date +%d/%m/%y`"
diff --git a/testsuite/date/date-u-works b/testsuite/date/date-u-works
new file mode 100644
index 000000000..7d9902a3f
--- /dev/null
+++ b/testsuite/date/date-u-works
@@ -0,0 +1,2 @@
1test x"`date -u`" = x"`busybox date -u`"
2
diff --git a/testsuite/date/date-works b/testsuite/date/date-works
new file mode 100644
index 000000000..2f6dd1eca
--- /dev/null
+++ b/testsuite/date/date-works
@@ -0,0 +1,2 @@
1test x"`date`" = x"`busybox date`"
2
diff --git a/testsuite/dirname/dirname-works b/testsuite/dirname/dirname-works
new file mode 100644
index 000000000..f339c8f73
--- /dev/null
+++ b/testsuite/dirname/dirname-works
@@ -0,0 +1,2 @@
1test x$(dirname $(pwd)) = x$(busybox dirname $(pwd))
2
diff --git a/testsuite/du/du-h-works b/testsuite/du/du-h-works
new file mode 100644
index 000000000..8ec5d4c24
--- /dev/null
+++ b/testsuite/du/du-h-works
@@ -0,0 +1,3 @@
1du -h .. > logfile.gnu
2busybox du -h .. > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/du/du-k-works b/testsuite/du/du-k-works
new file mode 100644
index 000000000..43b119c7c
--- /dev/null
+++ b/testsuite/du/du-k-works
@@ -0,0 +1,3 @@
1du -k .. > logfile.gnu
2busybox du -k .. > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/du/du-l-works b/testsuite/du/du-l-works
new file mode 100644
index 000000000..c5d439853
--- /dev/null
+++ b/testsuite/du/du-l-works
@@ -0,0 +1,3 @@
1du -l .. > logfile.gnu
2busybox du -l .. > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/du/du-m-works b/testsuite/du/du-m-works
new file mode 100644
index 000000000..e3e2d3a56
--- /dev/null
+++ b/testsuite/du/du-m-works
@@ -0,0 +1,3 @@
1du -m .. > logfile.gnu
2busybox du -m .. > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/du/du-s-works b/testsuite/du/du-s-works
new file mode 100644
index 000000000..16b0a3e5a
--- /dev/null
+++ b/testsuite/du/du-s-works
@@ -0,0 +1,3 @@
1du -s .. > logfile.gnu
2busybox du -s .. > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/du/du-works b/testsuite/du/du-works
new file mode 100644
index 000000000..87ba63032
--- /dev/null
+++ b/testsuite/du/du-works
@@ -0,0 +1,3 @@
1du .. > logfile.gnu
2busybox du .. > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/echo/echo-prints-argument b/testsuite/echo/echo-prints-argument
index 98779dbbb..479dac89c 100644
--- a/testsuite/echo/echo-prints-argument
+++ b/testsuite/echo/echo-prints-argument
@@ -1 +1 @@
test `busybox echo fubar` = fubar test xfubar = x`busybox echo fubar`
diff --git a/testsuite/expr/expr-works b/testsuite/expr/expr-works
new file mode 100644
index 000000000..af49ac4d5
--- /dev/null
+++ b/testsuite/expr/expr-works
@@ -0,0 +1,59 @@
1# busybox expr
2busybox expr 1 \| 1
3busybox expr 1 \| 0
4busybox expr 0 \| 1
5busybox expr 1 \& 1
6busybox expr 0 \< 1
7busybox expr 1 \> 0
8busybox expr 0 \<= 1
9busybox expr 1 \<= 1
10busybox expr 1 \>= 0
11busybox expr 1 \>= 1
12busybox expr 1 + 2
13busybox expr 2 - 1
14busybox expr 2 \* 3
15busybox expr 12 / 2
16busybox expr 12 % 5
17
18
19set +e
20busybox expr 0 \| 0
21if [ $? != 1 ] ; then
22 exit 1;
23fi;
24
25busybox expr 1 \& 0
26if [ $? != 1 ] ; then
27 exit 1;
28fi;
29
30busybox expr 0 \& 1
31if [ $? != 1 ] ; then
32 exit 1;
33fi;
34
35busybox expr 0 \& 0
36if [ $? != 1 ] ; then
37 exit 1;
38fi;
39
40busybox expr 1 \< 0
41if [ $? != 1 ] ; then
42 exit 1;
43fi;
44
45busybox expr 0 \> 1
46if [ $? != 1 ] ; then
47 exit 1;
48fi;
49
50busybox expr 1 \<= 0
51if [ $? != 1 ] ; then
52 exit 1;
53fi;
54
55busybox expr 0 \>= 1
56if [ $? != 1 ] ; then
57 exit 1;
58fi;
59
diff --git a/testsuite/grep/grep-matches-NUL b/testsuite/grep/grep-matches-NUL
index 597d22cb4..082bd8700 100644
--- a/testsuite/grep/grep-matches-NUL
+++ b/testsuite/grep/grep-matches-NUL
@@ -1,2 +1,8 @@
1# XFAIL 1set +e
2echo -e '\0' | busybox grep . 2echo -e '\0' | busybox grep .
3if [ $? != 0 ] ; then
4 exit 0;
5fi
6
7exit 1;
8
diff --git a/testsuite/head/head-n-works b/testsuite/head/head-n-works
new file mode 100644
index 000000000..121a1fa1d
--- /dev/null
+++ b/testsuite/head/head-n-works
@@ -0,0 +1,3 @@
1head -n 2 ../README > logfile.gnu
2busybox head -n 2 ../README > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/head/head-works b/testsuite/head/head-works
new file mode 100644
index 000000000..ea10adeb4
--- /dev/null
+++ b/testsuite/head/head-works
@@ -0,0 +1,3 @@
1head ../README > logfile.gnu
2busybox head ../README > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/hostid/hostid-works b/testsuite/hostid/hostid-works
new file mode 100644
index 000000000..e85698e66
--- /dev/null
+++ b/testsuite/hostid/hostid-works
@@ -0,0 +1,2 @@
1test x$(hostid) = x$(busybox hostid)
2
diff --git a/testsuite/hostname/hostname-d-works b/testsuite/hostname/hostname-d-works
new file mode 100644
index 000000000..a9aeb92cb
--- /dev/null
+++ b/testsuite/hostname/hostname-d-works
@@ -0,0 +1,2 @@
1test x$(hostname -d) = x$(busybox hostname -d)
2
diff --git a/testsuite/hostname/hostname-i-works b/testsuite/hostname/hostname-i-works
new file mode 100644
index 000000000..68a3e6789
--- /dev/null
+++ b/testsuite/hostname/hostname-i-works
@@ -0,0 +1,2 @@
1test x$(hostname -i) = x$(busybox hostname -i)
2
diff --git a/testsuite/hostname/hostname-s-works b/testsuite/hostname/hostname-s-works
new file mode 100644
index 000000000..172b94409
--- /dev/null
+++ b/testsuite/hostname/hostname-s-works
@@ -0,0 +1 @@
test x$(hostname -s) = x$(busybox hostname -s)
diff --git a/testsuite/hostname/hostname-works b/testsuite/hostname/hostname-works
new file mode 100644
index 000000000..f51a406ea
--- /dev/null
+++ b/testsuite/hostname/hostname-works
@@ -0,0 +1 @@
test x$(hostname) = x$(busybox hostname)
diff --git a/testsuite/id/id-g-works b/testsuite/id/id-g-works
new file mode 100644
index 000000000..671fc5361
--- /dev/null
+++ b/testsuite/id/id-g-works
@@ -0,0 +1 @@
test x$(id -g) = x$(busybox id -g)
diff --git a/testsuite/id/id-u-works b/testsuite/id/id-u-works
new file mode 100644
index 000000000..2358cb0d7
--- /dev/null
+++ b/testsuite/id/id-u-works
@@ -0,0 +1 @@
test x$(id -u) = x$(busybox id -u)
diff --git a/testsuite/id/id-un-works b/testsuite/id/id-un-works
new file mode 100644
index 000000000..db390e733
--- /dev/null
+++ b/testsuite/id/id-un-works
@@ -0,0 +1 @@
test x$(id -un) = x$(busybox id -un)
diff --git a/testsuite/id/id-ur-works b/testsuite/id/id-ur-works
new file mode 100644
index 000000000..6b0fcb038
--- /dev/null
+++ b/testsuite/id/id-ur-works
@@ -0,0 +1 @@
test x$(id -ur) = x$(busybox id -ur)
diff --git a/testsuite/ln/ln-creates-hard-links b/testsuite/ln/ln-creates-hard-links
new file mode 100644
index 000000000..2f6e23f9a
--- /dev/null
+++ b/testsuite/ln/ln-creates-hard-links
@@ -0,0 +1,4 @@
1echo file number one > file1
2busybox ln file1 link1
3test -f file1
4test -f link1
diff --git a/testsuite/ln/ln-creates-soft-links b/testsuite/ln/ln-creates-soft-links
new file mode 100644
index 000000000..e875e4c8a
--- /dev/null
+++ b/testsuite/ln/ln-creates-soft-links
@@ -0,0 +1,4 @@
1echo file number one > file1
2busybox ln -s file1 link1
3test -L link1
4test xfile1 = x`readlink link1`
diff --git a/testsuite/ln/ln-force-creates-hard-links b/testsuite/ln/ln-force-creates-hard-links
new file mode 100644
index 000000000..c96b7d6cf
--- /dev/null
+++ b/testsuite/ln/ln-force-creates-hard-links
@@ -0,0 +1,5 @@
1echo file number one > file1
2echo file number two > link1
3busybox ln -f file1 link1
4test -f file1
5test -f link1
diff --git a/testsuite/ln/ln-force-creates-soft-links b/testsuite/ln/ln-force-creates-soft-links
new file mode 100644
index 000000000..cab8d1db7
--- /dev/null
+++ b/testsuite/ln/ln-force-creates-soft-links
@@ -0,0 +1,5 @@
1echo file number one > file1
2echo file number two > link1
3busybox ln -f -s file1 link1
4test -L link1
5test xfile1 = x`readlink link1`
diff --git a/testsuite/ln/ln-preserves-hard-links b/testsuite/ln/ln-preserves-hard-links
new file mode 100644
index 000000000..47fb98961
--- /dev/null
+++ b/testsuite/ln/ln-preserves-hard-links
@@ -0,0 +1,8 @@
1echo file number one > file1
2echo file number two > link1
3set +e
4busybox ln file1 link1
5if [ $? != 0 ] ; then
6 exit 0;
7fi
8exit 1;
diff --git a/testsuite/ln/ln-preserves-soft-links b/testsuite/ln/ln-preserves-soft-links
new file mode 100644
index 000000000..a8123ece3
--- /dev/null
+++ b/testsuite/ln/ln-preserves-soft-links
@@ -0,0 +1,9 @@
1echo file number one > file1
2echo file number two > link1
3set +e
4busybox ln -s file1 link1
5if [ $? != 0 ] ; then
6 exit 0;
7fi
8exit 1;
9
diff --git a/testsuite/ls/ls-1-works b/testsuite/ls/ls-1-works
new file mode 100644
index 000000000..8651ecd72
--- /dev/null
+++ b/testsuite/ls/ls-1-works
@@ -0,0 +1,3 @@
1ls -1 .. > logfile.gnu
2busybox ls -1 .. > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/ls/ls-h-works b/testsuite/ls/ls-h-works
new file mode 100644
index 000000000..f54a7be0b
--- /dev/null
+++ b/testsuite/ls/ls-h-works
@@ -0,0 +1,3 @@
1ls -h .. > logfile.gnu
2busybox ls -h .. > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/ls/ls-l-works b/testsuite/ls/ls-l-works
new file mode 100644
index 000000000..50e44597e
--- /dev/null
+++ b/testsuite/ls/ls-l-works
@@ -0,0 +1,3 @@
1ls -l .. > logfile.gnu
2busybox ls -l .. > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/ls/ls-s-works b/testsuite/ls/ls-s-works
new file mode 100644
index 000000000..98a612d06
--- /dev/null
+++ b/testsuite/ls/ls-s-works
@@ -0,0 +1,3 @@
1ls -1s .. > logfile.gnu
2busybox ls -1s .. > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/mv/mv-files-to-dir b/testsuite/mv/mv-files-to-dir
new file mode 100644
index 000000000..c8eaba88e
--- /dev/null
+++ b/testsuite/mv/mv-files-to-dir
@@ -0,0 +1,16 @@
1echo file number one > file1
2echo file number two > file2
3ln -s file2 link1
4mkdir dir1
5touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3
6mkdir there
7busybox mv file1 file2 link1 dir1 there
8test -f there/file1
9test -f there/file2
10test -f there/dir1/file3
11test -L there/link1
12test xfile2 = x`readlink there/link1`
13test ! -e file1
14test ! -e file2
15test ! -e link1
16test ! -e dir1/file3
diff --git a/testsuite/mv/mv-follows-links b/testsuite/mv/mv-follows-links
new file mode 100644
index 000000000..1fb355b81
--- /dev/null
+++ b/testsuite/mv/mv-follows-links
@@ -0,0 +1,4 @@
1touch foo
2ln -s foo bar
3busybox mv bar baz
4test -f baz
diff --git a/testsuite/mv/mv-moves-empty-file b/testsuite/mv/mv-moves-empty-file
new file mode 100644
index 000000000..48afca4d5
--- /dev/null
+++ b/testsuite/mv/mv-moves-empty-file
@@ -0,0 +1,4 @@
1touch foo
2busybox mv foo bar
3test ! -e foo
4test -f bar
diff --git a/testsuite/mv/mv-moves-hardlinks b/testsuite/mv/mv-moves-hardlinks
new file mode 100644
index 000000000..eaa8215a4
--- /dev/null
+++ b/testsuite/mv/mv-moves-hardlinks
@@ -0,0 +1,4 @@
1touch foo
2ln foo bar
3busybox mv bar baz
4test ! -f bar -a -f baz
diff --git a/testsuite/mv/mv-moves-large-file b/testsuite/mv/mv-moves-large-file
new file mode 100644
index 000000000..77d088ff1
--- /dev/null
+++ b/testsuite/mv/mv-moves-large-file
@@ -0,0 +1,4 @@
1dd if=/dev/zero of=foo seek=10k count=1 2>/dev/null
2busybox mv foo bar
3test ! -e foo
4test -f bar
diff --git a/testsuite/mv/mv-moves-small-file b/testsuite/mv/mv-moves-small-file
new file mode 100644
index 000000000..065c7f1e9
--- /dev/null
+++ b/testsuite/mv/mv-moves-small-file
@@ -0,0 +1,4 @@
1echo I WANT > foo
2busybox mv foo bar
3test ! -e foo
4test -f bar
diff --git a/testsuite/mv/mv-moves-symlinks b/testsuite/mv/mv-moves-symlinks
new file mode 100644
index 000000000..c413af07c
--- /dev/null
+++ b/testsuite/mv/mv-moves-symlinks
@@ -0,0 +1,6 @@
1touch foo
2ln -s foo bar
3busybox mv bar baz
4test -f foo
5test ! -e bar
6test -L baz
diff --git a/testsuite/mv/mv-moves-unreadable-files b/testsuite/mv/mv-moves-unreadable-files
new file mode 100644
index 000000000..bc9c3133c
--- /dev/null
+++ b/testsuite/mv/mv-moves-unreadable-files
@@ -0,0 +1,5 @@
1touch foo
2chmod a-r foo
3busybox mv foo bar
4test ! -e foo
5test -f bar
diff --git a/testsuite/mv/mv-preserves-hard-links b/testsuite/mv/mv-preserves-hard-links
new file mode 100644
index 000000000..b3ba3aa29
--- /dev/null
+++ b/testsuite/mv/mv-preserves-hard-links
@@ -0,0 +1,6 @@
1# FEATURE: CONFIG_FEATURE_PRESERVE_HARDLINKS
2touch foo
3ln foo bar
4mkdir baz
5busybox mv foo bar baz
6test baz/foo -ef baz/bar
diff --git a/testsuite/mv/mv-preserves-links b/testsuite/mv/mv-preserves-links
new file mode 100644
index 000000000..ea565d2f1
--- /dev/null
+++ b/testsuite/mv/mv-preserves-links
@@ -0,0 +1,5 @@
1touch foo
2ln -s foo bar
3busybox mv bar baz
4test -L baz
5test xfoo = x`readlink baz`
diff --git a/testsuite/mv/mv-refuses-mv-dir-to-subdir b/testsuite/mv/mv-refuses-mv-dir-to-subdir
new file mode 100644
index 000000000..7c572c4f8
--- /dev/null
+++ b/testsuite/mv/mv-refuses-mv-dir-to-subdir
@@ -0,0 +1,23 @@
1echo file number one > file1
2echo file number two > file2
3ln -s file2 link1
4mkdir dir1
5touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3
6mkdir there
7busybox mv file1 file2 link1 dir1 there
8test -f there/file1
9test -f there/file2
10test -f there/dir1/file3
11test -L there/link1
12test xfile2 = x`readlink there/link1`
13test ! -e file1
14test ! -e file2
15test ! -e link1
16test ! -e dir1/file3
17set +e
18busybox mv there there/dir1
19if [ $? != 0 ] ; then
20 exit 0;
21fi
22
23exit 1;
diff --git a/testsuite/mv/mv-removes-source-file b/testsuite/mv/mv-removes-source-file
new file mode 100644
index 000000000..48afca4d5
--- /dev/null
+++ b/testsuite/mv/mv-removes-source-file
@@ -0,0 +1,4 @@
1touch foo
2busybox mv foo bar
3test ! -e foo
4test -f bar
diff --git a/testsuite/pwd/pwd-prints-working-directory b/testsuite/pwd/pwd-prints-working-directory
index 7bea10741..8575347d6 100644
--- a/testsuite/pwd/pwd-prints-working-directory
+++ b/testsuite/pwd/pwd-prints-working-directory
@@ -1 +1 @@
test `pwd` = `busybox pwd` test $(pwd) = $(busybox pwd)
diff --git a/testsuite/runtest b/testsuite/runtest
index f57f464ee..89aba3985 100755
--- a/testsuite/runtest
+++ b/testsuite/runtest
@@ -2,37 +2,19 @@
2 2
3PATH=$(dirname $(pwd)):$PATH 3PATH=$(dirname $(pwd)):$PATH
4 4
5show_result ()
6{
7 local resolution=$1
8 local testcase=$2
9 local status=0
10
11 if [ $resolution = XPASS -o $resolution = FAIL ]; then
12 status=1
13 fi
14
15 if [ "$verbose" -o $status -eq 1 ]; then
16 echo "$resolution: $testcase"
17 fi
18
19 return $status
20}
21
22run_applet_testcase () 5run_applet_testcase ()
23{ 6{
24 local applet=$1 7 local applet=$1
25 local testcase=$2 8 local testcase=$2
26 9
27 local status=0 10 local status=0
28 local X=
29 local RES= 11 local RES=
30 12
31 local uc_applet=$(echo $applet | tr a-z A-Z) 13 local uc_applet=$(echo $applet | tr a-z A-Z)
32 local testname=$(basename $testcase) 14 local testname=$(basename $testcase)
33 15
34 if grep -q "^# CONFIG_${uc_applet} is not set$" ../.config; then 16 if grep -q "^# CONFIG_${uc_applet} is not set$" ../.config; then
35 show_result UNTESTED $testname 17 echo UNTESTED: $testname
36 return 0 18 return 0
37 fi 19 fi
38 20
@@ -40,15 +22,11 @@ run_applet_testcase ()
40 local feature=`sed -ne 's/^# FEATURE: //p' $testcase` 22 local feature=`sed -ne 's/^# FEATURE: //p' $testcase`
41 23
42 if grep -q "^# ${feature} is not set$" ../.config; then 24 if grep -q "^# ${feature} is not set$" ../.config; then
43 show_result UNTESTED $testname 25 echo UNTESTED: $testname
44 return 0 26 return 0
45 fi 27 fi
46 fi 28 fi
47 29
48 if grep -q "^# XFAIL$" $testcase; then
49 X=X
50 fi
51
52 rm -rf tmp 30 rm -rf tmp
53 mkdir -p tmp 31 mkdir -p tmp
54 pushd tmp >/dev/null 32 pushd tmp >/dev/null
@@ -56,14 +34,14 @@ run_applet_testcase ()
56 sh -x -e ../$testcase >.logfile.txt 2>&1 34 sh -x -e ../$testcase >.logfile.txt 2>&1
57 35
58 if [ $? != 0 ] ; then 36 if [ $? != 0 ] ; then
59 show_result ${X}FAIL $testname 37 echo FAIL: $testname
60 if [ "$verbose" == 1 ]; then 38 if [ "$verbose" = 1 ]; then
61 cat .logfile.txt 39 cat .logfile.txt
62 exit 1; 40 #exit 1;
63 fi; 41 fi;
64 status=$? 42 status=$?
65 else 43 else
66 show_result ${X}PASS $testname 44 echo PASS: $testname
67 rm -f .logfile.txt 45 rm -f .logfile.txt
68 status=$? 46 status=$?
69 fi 47 fi
diff --git a/testsuite/sed/sed-append-next-line b/testsuite/sed/sed-append-next-line
index e7f72f476..0621a319f 100644
--- a/testsuite/sed/sed-append-next-line
+++ b/testsuite/sed/sed-append-next-line
@@ -1,10 +1,11 @@
1# XFAIL
2# This will fail if CONFIG_FEATURE_SED_GNU_COMPATABILITY is defined 1# This will fail if CONFIG_FEATURE_SED_GNU_COMPATABILITY is defined
3busybox sed 'N;p'>output <<EOF 2busybox sed 'N;p'>output <<EOF
4a 3a
5b 4b
6c 5c
7EOF 6EOF
7
8set +e
8cmp -s output - <<EOF 9cmp -s output - <<EOF
9a 10a
10b 11b
@@ -12,3 +13,7 @@ a
12b 13b
13c 14c
14EOF 15EOF
16if [ $? != 0 ] ; then
17 exit 0;
18fi
19exit 1;
diff --git a/testsuite/sort/sort-n-works b/testsuite/sort/sort-n-works
new file mode 100644
index 000000000..c9b63a36a
--- /dev/null
+++ b/testsuite/sort/sort-n-works
@@ -0,0 +1,3 @@
1sort -n ../README > logfile.gnu
2busybox sort -n ../README > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/sort/sort-r-works b/testsuite/sort/sort-r-works
new file mode 100644
index 000000000..6422ba940
--- /dev/null
+++ b/testsuite/sort/sort-r-works
@@ -0,0 +1,3 @@
1sort -r ../README > logfile.gnu
2busybox sort -r ../README > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/sort/sort-works b/testsuite/sort/sort-works
new file mode 100644
index 000000000..0110aa010
--- /dev/null
+++ b/testsuite/sort/sort-works
@@ -0,0 +1,3 @@
1sort ../README > logfile.gnu
2busybox sort ../README > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/strings/strings-works-like-GNU b/testsuite/strings/strings-works-like-GNU
index 02e423134..2d6471033 100644
--- a/testsuite/strings/strings-works-like-GNU
+++ b/testsuite/strings/strings-works-like-GNU
@@ -1,8 +1,9 @@
1rm -f foo bar 1rm -f foo bar
2strings -af ../../busybox > foo 2strings -af ../../busybox > foo
3busybox strings -af ../../busybox > bar 3busybox strings -af ../../busybox > bar
4set +e
4test ! -f foo -a -f bar 5test ! -f foo -a -f bar
5if [ $? = 0 ] ; then 6if [ $? = 0 ] ; then
6 diff -q foo bar 7 set -e
7fi; 8 diff -q foo bar
8 9fi
diff --git a/testsuite/tail/tail-n-works b/testsuite/tail/tail-n-works
new file mode 100644
index 000000000..321db7f8a
--- /dev/null
+++ b/testsuite/tail/tail-n-works
@@ -0,0 +1,3 @@
1tail -n 2 ../README > logfile.gnu
2busybox tail -n 2 ../README > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/tail/tail-works b/testsuite/tail/tail-works
new file mode 100644
index 000000000..321db7f8a
--- /dev/null
+++ b/testsuite/tail/tail-works
@@ -0,0 +1,3 @@
1tail -n 2 ../README > logfile.gnu
2busybox tail -n 2 ../README > logfile.bb
3cmp logfile.gnu logfile.bb
diff --git a/testsuite/tar/tar-extracts-multiple-files b/testsuite/tar/tar-extracts-multiple-files
index e26901e8c..46701dc3f 100644
--- a/testsuite/tar/tar-extracts-multiple-files
+++ b/testsuite/tar/tar-extracts-multiple-files
@@ -1,5 +1,6 @@
1touch foo bar 1touch foo bar
2tar cf foo.tar foo bar 2tar cf foo.tar foo bar
3rm foo bar 3rm foo bar
4busybox tar xf foo.tar 4busybox tar -xf foo.tar
5test -f foo -a -f bar 5test -f foo -a -f bar
6exit 99;
diff --git a/testsuite/tr/tr-d-works b/testsuite/tr/tr-d-works
new file mode 100644
index 000000000..d939e8b0f
--- /dev/null
+++ b/testsuite/tr/tr-d-works
@@ -0,0 +1,4 @@
1echo testing | tr -d aeiou > logfile.gnu
2echo testing | busybox tr -d aeiou > logfile.bb
3
4cmp logfile.gnu logfile.bb
diff --git a/testsuite/tr/tr-non-gnu b/testsuite/tr/tr-non-gnu
new file mode 100644
index 000000000..ffa6951ae
--- /dev/null
+++ b/testsuite/tr/tr-non-gnu
@@ -0,0 +1 @@
echo fdhrnzvfu bffvsentr | busybox tr '[a-z]' '[n-z][a-m]'
diff --git a/testsuite/tr/tr-works b/testsuite/tr/tr-works
new file mode 100644
index 000000000..8753a3f28
--- /dev/null
+++ b/testsuite/tr/tr-works
@@ -0,0 +1,9 @@
1echo "cbaab" | tr abc zyx > logfile.gnu
2echo "TESTING A B C" | tr [A-Z] [a-z] >> logfile.gnu
3echo abc[] | tr a[b AXB >> logfile.gnu
4
5echo "cbaab" | busybox tr abc zyx > logfile.bb
6echo "TESTING A B C" | busybox tr [A-Z] [a-z] >> logfile.bb
7echo abc[] | busybox tr a[b AXB >> logfile.bb
8
9cmp logfile.gnu logfile.bb
diff --git a/testsuite/uptime/uptime-works b/testsuite/uptime/uptime-works
new file mode 100644
index 000000000..80e578778
--- /dev/null
+++ b/testsuite/uptime/uptime-works
@@ -0,0 +1,2 @@
1busybox uptime
2
diff --git a/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly b/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly
index 0ccf23b59..1a48a6656 100644
--- a/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly
+++ b/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly
@@ -1,6 +1,4 @@
1saved_umask=$(umask) 1saved_umask=$(umask)
2umask 0 2umask 0
3busybox uuencode foo </dev/null | head -n 1 | grep -q 666 3busybox uuencode foo </dev/null | head -n 1 | grep -q 666
4status=$?
5umask $saved_umask 4umask $saved_umask
6return $status
diff --git a/testsuite/which/which-uses-default-path b/testsuite/which/which-uses-default-path
index f612aeb54..63ceb9f8f 100644
--- a/testsuite/which/which-uses-default-path
+++ b/testsuite/which/which-uses-default-path
@@ -2,6 +2,3 @@ BUSYBOX=$(type -p busybox)
2SAVED_PATH=$PATH 2SAVED_PATH=$PATH
3unset PATH 3unset PATH
4$BUSYBOX which ls 4$BUSYBOX which ls
5STATUS=$?
6export PATH=$SAVED_PATH
7return $STATUS
diff --git a/testsuite/xargs/xargs-works b/testsuite/xargs/xargs-works
new file mode 100644
index 000000000..4ad581804
--- /dev/null
+++ b/testsuite/xargs/xargs-works
@@ -0,0 +1,3 @@
1find -name \*works -type f | xargs md5sum > logfile.gnu
2find -name \*works -type f | busybox xargs md5sum > logfile.bb
3diff -u logfile.gnu logfile.bb