summaryrefslogtreecommitdiff
path: root/release/src/router/busybox/testsuite
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 12:04:58 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 12:04:58 +0100
commit008d0be72b2f160382c6e880765e96b64a050c65 (patch)
tree36f48a98a3815a408e2ce1693dd182af90f80305 /release/src/router/busybox/testsuite
parent611becfb8726c60cb060368541ad98191d4532f5 (diff)
downloadtomato-008d0be72b2f160382c6e880765e96b64a050c65.tar.gz
tomato-008d0be72b2f160382c6e880765e96b64a050c65.tar.bz2
imported original firmware WRT54GL_v4.30.11_11_US
Diffstat (limited to 'release/src/router/busybox/testsuite')
-rw-r--r--release/src/router/busybox/testsuite/README31
-rwxr-xr-xrelease/src/router/busybox/testsuite/TODO18
-rwxr-xr-xrelease/src/router/busybox/testsuite/basename/basename-does-not-remove-identical-extension1
-rwxr-xr-xrelease/src/router/busybox/testsuite/bunzip2/bunzip2-reads-from-standard-input2
-rwxr-xr-xrelease/src/router/busybox/testsuite/bunzip2/bunzip2-removes-compressed-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/bunzip2/bzcat-does-not-remove-compressed-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/cat/cat-prints-a-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/cat/cat-prints-a-file-and-standard-input7
-rwxr-xr-xrelease/src/router/busybox/testsuite/cmp/cmp-detects-difference3
-rwxr-xr-xrelease/src/router/busybox/testsuite/cp/cp-copies-empty-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/cp/cp-copies-large-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/cp/cp-copies-small-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/cp/cp-does-not-copy-unreadable-file4
-rwxr-xr-xrelease/src/router/busybox/testsuite/cp/cp-follows-links4
-rwxr-xr-xrelease/src/router/busybox/testsuite/cp/cp-preserves-hard-links6
-rwxr-xr-xrelease/src/router/busybox/testsuite/cp/cp-preserves-links4
-rwxr-xr-xrelease/src/router/busybox/testsuite/cp/cp-preserves-source-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/cut/cut-cuts-a-character1
-rwxr-xr-xrelease/src/router/busybox/testsuite/cut/cut-cuts-a-closed-range1
-rwxr-xr-xrelease/src/router/busybox/testsuite/cut/cut-cuts-a-field1
-rwxr-xr-xrelease/src/router/busybox/testsuite/cut/cut-cuts-an-open-range1
-rwxr-xr-xrelease/src/router/busybox/testsuite/cut/cut-cuts-an-unclosed-range1
-rwxr-xr-xrelease/src/router/busybox/testsuite/dd/dd-accepts-if2
-rwxr-xr-xrelease/src/router/busybox/testsuite/dd/dd-accepts-of2
-rwxr-xr-xrelease/src/router/busybox/testsuite/dd/dd-copies-from-standard-input-to-standard-output1
-rwxr-xr-xrelease/src/router/busybox/testsuite/dd/dd-prints-count-to-standard-error2
-rwxr-xr-xrelease/src/router/busybox/testsuite/dirname/dirname-handles-absolute-path1
-rwxr-xr-xrelease/src/router/busybox/testsuite/dirname/dirname-handles-empty-path1
-rwxr-xr-xrelease/src/router/busybox/testsuite/dirname/dirname-handles-multiple-slashes1
-rwxr-xr-xrelease/src/router/busybox/testsuite/dirname/dirname-handles-relative-path1
-rwxr-xr-xrelease/src/router/busybox/testsuite/dirname/dirname-handles-root1
-rwxr-xr-xrelease/src/router/busybox/testsuite/dirname/dirname-handles-single-component1
-rwxr-xr-xrelease/src/router/busybox/testsuite/echo/echo-does-not-print-newline1
-rwxr-xr-xrelease/src/router/busybox/testsuite/echo/echo-prints-argument1
-rwxr-xr-xrelease/src/router/busybox/testsuite/echo/echo-prints-arguments1
-rwxr-xr-xrelease/src/router/busybox/testsuite/echo/echo-prints-newline1
-rwxr-xr-xrelease/src/router/busybox/testsuite/false/false-is-silent1
-rwxr-xr-xrelease/src/router/busybox/testsuite/false/false-returns-failure1
-rwxr-xr-xrelease/src/router/busybox/testsuite/find/find-supports-minus-xdev2
-rwxr-xr-xrelease/src/router/busybox/testsuite/grep/egrep-is-not-case-insensitive2
-rwxr-xr-xrelease/src/router/busybox/testsuite/grep/egrep-supports-extended-regexps2
-rwxr-xr-xrelease/src/router/busybox/testsuite/grep/grep-handles-binary-files1
-rwxr-xr-xrelease/src/router/busybox/testsuite/grep/grep-handles-multiple-regexps1
-rwxr-xr-xrelease/src/router/busybox/testsuite/grep/grep-is-also-egrep2
-rwxr-xr-xrelease/src/router/busybox/testsuite/grep/grep-matches-NUL2
-rwxr-xr-xrelease/src/router/busybox/testsuite/gunzip/gunzip-reads-from-standard-input2
-rwxr-xr-xrelease/src/router/busybox/testsuite/gzip/gzip-accepts-multiple-files3
-rwxr-xr-xrelease/src/router/busybox/testsuite/gzip/gzip-accepts-single-minus1
-rwxr-xr-xrelease/src/router/busybox/testsuite/gzip/gzip-removes-original-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/md5sum/md5sum-verifies-non-binary-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/mkdir/mkdir-makes-a-directory2
-rwxr-xr-xrelease/src/router/busybox/testsuite/mkdir/mkdir-makes-parent-directories2
-rwxr-xr-xrelease/src/router/busybox/testsuite/msh/msh-supports-underscores-in-variable-names1
-rwxr-xr-xrelease/src/router/busybox/testsuite/mv/mv-moves-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/pwd/pwd-prints-working-directory1
-rwxr-xr-xrelease/src/router/busybox/testsuite/rm/rm-removes-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/rmdir/rmdir-removes-parent-directories3
-rwxr-xr-xrelease/src/router/busybox/testsuite/runtest113
-rwxr-xr-xrelease/src/router/busybox/testsuite/sed/sed-accepts-blanks-before-command1
-rwxr-xr-xrelease/src/router/busybox/testsuite/sed/sed-aic-commands134
-rwxr-xr-xrelease/src/router/busybox/testsuite/sed/sed-chains-substs1
-rwxr-xr-xrelease/src/router/busybox/testsuite/sed/sed-does-not-substitute-in-deleted-line2
-rwxr-xr-xrelease/src/router/busybox/testsuite/sed/sed-handles-embedded-slashes1
-rwxr-xr-xrelease/src/router/busybox/testsuite/sed/sed-handles-empty-lines1
-rwxr-xr-xrelease/src/router/busybox/testsuite/sed/sed-handles-unsatisfied-backrefs6
-rwxr-xr-xrelease/src/router/busybox/testsuite/sed/sed-prints-line-once-for-multiple-substs4
-rwxr-xr-xrelease/src/router/busybox/testsuite/sed/sed-recurses-properly2
-rwxr-xr-xrelease/src/router/busybox/testsuite/sed/sed-requires-newline-after-edit-command1
-rwxr-xr-xrelease/src/router/busybox/testsuite/sed/sed-splits-edit-commands-on-command-line9
-rwxr-xr-xrelease/src/router/busybox/testsuite/strings/strings-works-like-GNU8
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-archives-multiple-files6
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-complains-about-missing-file4
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-demands-at-least-one-ctx1
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-demands-at-most-one-ctx1
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-extracts-file5
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-extracts-from-standard-input5
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-extracts-multiple-files5
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-extracts-to-standard-output3
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-handles-cz-options4
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-handles-empty-include-and-non-empty-exclude-list5
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-handles-exclude-and-extract-lists7
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-handles-multiple-X-options8
-rwxr-xr-xrelease/src/router/busybox/testsuite/tar/tar-handles-nested-exclude8
-rwxr-xr-xrelease/src/router/busybox/testsuite/tee/tee-appends-input5
-rwxr-xr-xrelease/src/router/busybox/testsuite/tee/tee-tees-input3
-rwxr-xr-xrelease/src/router/busybox/testsuite/touch/touch-creates-file2
-rwxr-xr-xrelease/src/router/busybox/testsuite/touch/touch-does-not-create-file2
-rwxr-xr-xrelease/src/router/busybox/testsuite/touch/touch-touches-files-after-non-existent-file3
-rwxr-xr-xrelease/src/router/busybox/testsuite/true/true-is-silent1
-rwxr-xr-xrelease/src/router/busybox/testsuite/true/true-returns-success1
-rwxr-xr-xrelease/src/router/busybox/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly6
-rwxr-xr-xrelease/src/router/busybox/testsuite/wc/wc-counts-all1
-rwxr-xr-xrelease/src/router/busybox/testsuite/wc/wc-counts-characters1
-rwxr-xr-xrelease/src/router/busybox/testsuite/wc/wc-counts-lines1
-rwxr-xr-xrelease/src/router/busybox/testsuite/wc/wc-counts-words1
-rwxr-xr-xrelease/src/router/busybox/testsuite/wc/wc-prints-longest-line-length1
-rwxr-xr-xrelease/src/router/busybox/testsuite/wget/wget--O-overrides--P3
-rwxr-xr-xrelease/src/router/busybox/testsuite/wget/wget-handles-empty-path1
-rwxr-xr-xrelease/src/router/busybox/testsuite/wget/wget-retrieves-google-index2
-rwxr-xr-xrelease/src/router/busybox/testsuite/wget/wget-supports--P3
-rwxr-xr-xrelease/src/router/busybox/testsuite/which/which-uses-default-path7
101 files changed, 553 insertions, 0 deletions
diff --git a/release/src/router/busybox/testsuite/README b/release/src/router/busybox/testsuite/README
new file mode 100644
index 00000000..40439bfe
--- /dev/null
+++ b/release/src/router/busybox/testsuite/README
@@ -0,0 +1,31 @@
+To run the test suite, change to this directory and run "./runtest". It will
+run all of the test cases, and list those with unexpected outcomes. Adding the
+-v option will cause it to show expected outcomes as well. To only run the test
+cases for particular applets, specify them as parameters to runtest.
+
+The test cases for an applet reside in the subdirectory of the applet name. The
+name of the test case should be the assertion that is tested. The test case
+should be a shell fragment that returns successfully if the test case passes,
+and unsuccessfully otherwise.
+
+If the test case relies on a certain feature, it should include the string
+"FEATURE: " followed by the name of the feature in a comment. If it is always
+expected to fail, it should include the string "XFAIL" in a comment.
+
+For the entire testsuite, the copyright is as follows:
+
+Copyright (C) 2001, 2002 Matt Kraai
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
diff --git a/release/src/router/busybox/testsuite/TODO b/release/src/router/busybox/testsuite/TODO
new file mode 100755
index 00000000..ced57159
--- /dev/null
+++ b/release/src/router/busybox/testsuite/TODO
@@ -0,0 +1,18 @@
+This testsuite is quite obviously a work in progress. As such,
+there are a number of good extensions. If you are looking for
+something to do, feel free to tackle one or more of the following:
+
+Buildroot support
+ Erik has put together a handy package for constructing and
+ testing busybox called buildroot. Integrating this into
+ the testsuite would allow for greater test coverage (e.g.,
+ init, mount, and other privileged applications).
+
+libbb unit testing
+ Being able to test the functions of libbb individually may
+ help to prevent regressions.
+
+Standardization
+ This testsuite is totally bastardized. It would be better
+ to use an existing test framework, such as dejagnu, greg,
+ or a XUnit clone (shunit?).
diff --git a/release/src/router/busybox/testsuite/basename/basename-does-not-remove-identical-extension b/release/src/router/busybox/testsuite/basename/basename-does-not-remove-identical-extension
new file mode 100755
index 00000000..4448fdec
--- /dev/null
+++ b/release/src/router/busybox/testsuite/basename/basename-does-not-remove-identical-extension
@@ -0,0 +1 @@
+test xfoo = x`busybox basename foo foo`
diff --git a/release/src/router/busybox/testsuite/bunzip2/bunzip2-reads-from-standard-input b/release/src/router/busybox/testsuite/bunzip2/bunzip2-reads-from-standard-input
new file mode 100755
index 00000000..e212a120
--- /dev/null
+++ b/release/src/router/busybox/testsuite/bunzip2/bunzip2-reads-from-standard-input
@@ -0,0 +1,2 @@
+echo foo | bzip2 | busybox bunzip2 > output
+echo foo | cmp - output
diff --git a/release/src/router/busybox/testsuite/bunzip2/bunzip2-removes-compressed-file b/release/src/router/busybox/testsuite/bunzip2/bunzip2-removes-compressed-file
new file mode 100755
index 00000000..f1d15503
--- /dev/null
+++ b/release/src/router/busybox/testsuite/bunzip2/bunzip2-removes-compressed-file
@@ -0,0 +1,3 @@
+echo foo | bzip2 >foo.bz2
+busybox bunzip2 foo.bz2
+test ! -f foo.bz2
diff --git a/release/src/router/busybox/testsuite/bunzip2/bzcat-does-not-remove-compressed-file b/release/src/router/busybox/testsuite/bunzip2/bzcat-does-not-remove-compressed-file
new file mode 100755
index 00000000..7d4016ec
--- /dev/null
+++ b/release/src/router/busybox/testsuite/bunzip2/bzcat-does-not-remove-compressed-file
@@ -0,0 +1,3 @@
+echo foo | bzip2 >foo.bz2
+busybox bzcat foo.bz2
+test -f foo.bz2
diff --git a/release/src/router/busybox/testsuite/cat/cat-prints-a-file b/release/src/router/busybox/testsuite/cat/cat-prints-a-file
new file mode 100755
index 00000000..e3f35a86
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cat/cat-prints-a-file
@@ -0,0 +1,3 @@
+echo I WANT > foo
+busybox cat foo >bar
+cmp foo bar
diff --git a/release/src/router/busybox/testsuite/cat/cat-prints-a-file-and-standard-input b/release/src/router/busybox/testsuite/cat/cat-prints-a-file-and-standard-input
new file mode 100755
index 00000000..bc923188
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cat/cat-prints-a-file-and-standard-input
@@ -0,0 +1,7 @@
+echo I WANT > foo
+echo SOMETHING | busybox cat foo - >bar
+cat >baz <<EOF
+I WANT
+SOMETHING
+EOF
+cmp bar baz
diff --git a/release/src/router/busybox/testsuite/cmp/cmp-detects-difference b/release/src/router/busybox/testsuite/cmp/cmp-detects-difference
new file mode 100755
index 00000000..aa074448
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cmp/cmp-detects-difference
@@ -0,0 +1,3 @@
+echo foo >foo
+echo bar >bar
+! busybox cmp -s foo bar
diff --git a/release/src/router/busybox/testsuite/cp/cp-copies-empty-file b/release/src/router/busybox/testsuite/cp/cp-copies-empty-file
new file mode 100755
index 00000000..ad25aa12
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cp/cp-copies-empty-file
@@ -0,0 +1,3 @@
+touch foo
+busybox cp foo bar
+cmp foo bar
diff --git a/release/src/router/busybox/testsuite/cp/cp-copies-large-file b/release/src/router/busybox/testsuite/cp/cp-copies-large-file
new file mode 100755
index 00000000..c2225c6d
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cp/cp-copies-large-file
@@ -0,0 +1,3 @@
+dd if=/dev/zero of=foo seek=10k count=1 2>/dev/null
+busybox cp foo bar
+cmp foo bar
diff --git a/release/src/router/busybox/testsuite/cp/cp-copies-small-file b/release/src/router/busybox/testsuite/cp/cp-copies-small-file
new file mode 100755
index 00000000..d52a887c
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cp/cp-copies-small-file
@@ -0,0 +1,3 @@
+echo I WANT > foo
+busybox cp foo bar
+cmp foo bar
diff --git a/release/src/router/busybox/testsuite/cp/cp-does-not-copy-unreadable-file b/release/src/router/busybox/testsuite/cp/cp-does-not-copy-unreadable-file
new file mode 100755
index 00000000..68c57672
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cp/cp-does-not-copy-unreadable-file
@@ -0,0 +1,4 @@
+touch foo
+chmod a-r foo
+busybox cp foo bar
+test ! -f bar
diff --git a/release/src/router/busybox/testsuite/cp/cp-follows-links b/release/src/router/busybox/testsuite/cp/cp-follows-links
new file mode 100755
index 00000000..2d9f05e9
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cp/cp-follows-links
@@ -0,0 +1,4 @@
+touch foo
+ln -s foo bar
+busybox cp bar baz
+test -f baz
diff --git a/release/src/router/busybox/testsuite/cp/cp-preserves-hard-links b/release/src/router/busybox/testsuite/cp/cp-preserves-hard-links
new file mode 100755
index 00000000..4de7b85d
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cp/cp-preserves-hard-links
@@ -0,0 +1,6 @@
+# FEATURE: CONFIG_FEATURE_PRESERVE_HARDLINKS
+touch foo
+ln foo bar
+mkdir baz
+busybox cp -d foo bar baz
+test baz/foo -ef baz/bar
diff --git a/release/src/router/busybox/testsuite/cp/cp-preserves-links b/release/src/router/busybox/testsuite/cp/cp-preserves-links
new file mode 100755
index 00000000..a5269e8d
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cp/cp-preserves-links
@@ -0,0 +1,4 @@
+touch foo
+ln -s foo bar
+busybox cp -d bar baz
+test -L baz
diff --git a/release/src/router/busybox/testsuite/cp/cp-preserves-source-file b/release/src/router/busybox/testsuite/cp/cp-preserves-source-file
new file mode 100755
index 00000000..f0f5065f
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cp/cp-preserves-source-file
@@ -0,0 +1,3 @@
+touch foo
+busybox cp foo bar
+test -f foo
diff --git a/release/src/router/busybox/testsuite/cut/cut-cuts-a-character b/release/src/router/busybox/testsuite/cut/cut-cuts-a-character
new file mode 100755
index 00000000..d6c5efa3
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cut/cut-cuts-a-character
@@ -0,0 +1 @@
+test $(echo abcd | busybox cut -c 3) = c
diff --git a/release/src/router/busybox/testsuite/cut/cut-cuts-a-closed-range b/release/src/router/busybox/testsuite/cut/cut-cuts-a-closed-range
new file mode 100755
index 00000000..9680b765
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cut/cut-cuts-a-closed-range
@@ -0,0 +1 @@
+test $(echo abcd | busybox cut -c 1-2) = ab
diff --git a/release/src/router/busybox/testsuite/cut/cut-cuts-a-field b/release/src/router/busybox/testsuite/cut/cut-cuts-a-field
new file mode 100755
index 00000000..4c7f4400
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cut/cut-cuts-a-field
@@ -0,0 +1 @@
+test $(echo -e "f1\tf2\tf3" | busybox cut -f 2) = f2
diff --git a/release/src/router/busybox/testsuite/cut/cut-cuts-an-open-range b/release/src/router/busybox/testsuite/cut/cut-cuts-an-open-range
new file mode 100755
index 00000000..1fbf2774
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cut/cut-cuts-an-open-range
@@ -0,0 +1 @@
+test $(echo abcd | busybox cut -c -3) = abc
diff --git a/release/src/router/busybox/testsuite/cut/cut-cuts-an-unclosed-range b/release/src/router/busybox/testsuite/cut/cut-cuts-an-unclosed-range
new file mode 100755
index 00000000..a2b0cdb0
--- /dev/null
+++ b/release/src/router/busybox/testsuite/cut/cut-cuts-an-unclosed-range
@@ -0,0 +1 @@
+test $(echo abcd | busybox cut -c 3-) = cd
diff --git a/release/src/router/busybox/testsuite/dd/dd-accepts-if b/release/src/router/busybox/testsuite/dd/dd-accepts-if
new file mode 100755
index 00000000..03d1af85
--- /dev/null
+++ b/release/src/router/busybox/testsuite/dd/dd-accepts-if
@@ -0,0 +1,2 @@
+echo I WANT >foo
+test "$(busybox dd if=foo 2>/dev/null)" = "I WANT"
diff --git a/release/src/router/busybox/testsuite/dd/dd-accepts-of b/release/src/router/busybox/testsuite/dd/dd-accepts-of
new file mode 100755
index 00000000..84405e62
--- /dev/null
+++ b/release/src/router/busybox/testsuite/dd/dd-accepts-of
@@ -0,0 +1,2 @@
+echo I WANT | busybox dd of=foo 2>/dev/null
+echo I WANT | cmp foo -
diff --git a/release/src/router/busybox/testsuite/dd/dd-copies-from-standard-input-to-standard-output b/release/src/router/busybox/testsuite/dd/dd-copies-from-standard-input-to-standard-output
new file mode 100755
index 00000000..d890eb04
--- /dev/null
+++ b/release/src/router/busybox/testsuite/dd/dd-copies-from-standard-input-to-standard-output
@@ -0,0 +1 @@
+test "$(echo I WANT | busybox dd 2>/dev/null)" = "I WANT"
diff --git a/release/src/router/busybox/testsuite/dd/dd-prints-count-to-standard-error b/release/src/router/busybox/testsuite/dd/dd-prints-count-to-standard-error
new file mode 100755
index 00000000..2187dc02
--- /dev/null
+++ b/release/src/router/busybox/testsuite/dd/dd-prints-count-to-standard-error
@@ -0,0 +1,2 @@
+echo I WANT | busybox dd of=foo >/dev/null 2>bar
+grep -q records bar
diff --git a/release/src/router/busybox/testsuite/dirname/dirname-handles-absolute-path b/release/src/router/busybox/testsuite/dirname/dirname-handles-absolute-path
new file mode 100755
index 00000000..ca1a51b3
--- /dev/null
+++ b/release/src/router/busybox/testsuite/dirname/dirname-handles-absolute-path
@@ -0,0 +1 @@
+test $(busybox dirname /foo/bar/baz) = /foo/bar
diff --git a/release/src/router/busybox/testsuite/dirname/dirname-handles-empty-path b/release/src/router/busybox/testsuite/dirname/dirname-handles-empty-path
new file mode 100755
index 00000000..04134a58
--- /dev/null
+++ b/release/src/router/busybox/testsuite/dirname/dirname-handles-empty-path
@@ -0,0 +1 @@
+test $(busybox dirname '') = .
diff --git a/release/src/router/busybox/testsuite/dirname/dirname-handles-multiple-slashes b/release/src/router/busybox/testsuite/dirname/dirname-handles-multiple-slashes
new file mode 100755
index 00000000..286f2536
--- /dev/null
+++ b/release/src/router/busybox/testsuite/dirname/dirname-handles-multiple-slashes
@@ -0,0 +1 @@
+test $(busybox dirname foo/bar///baz) = foo/bar
diff --git a/release/src/router/busybox/testsuite/dirname/dirname-handles-relative-path b/release/src/router/busybox/testsuite/dirname/dirname-handles-relative-path
new file mode 100755
index 00000000..ffe4ab45
--- /dev/null
+++ b/release/src/router/busybox/testsuite/dirname/dirname-handles-relative-path
@@ -0,0 +1 @@
+test $(busybox dirname foo/bar/baz) = foo/bar
diff --git a/release/src/router/busybox/testsuite/dirname/dirname-handles-root b/release/src/router/busybox/testsuite/dirname/dirname-handles-root
new file mode 100755
index 00000000..6bd62b8a
--- /dev/null
+++ b/release/src/router/busybox/testsuite/dirname/dirname-handles-root
@@ -0,0 +1 @@
+test $(busybox dirname /) = /
diff --git a/release/src/router/busybox/testsuite/dirname/dirname-handles-single-component b/release/src/router/busybox/testsuite/dirname/dirname-handles-single-component
new file mode 100755
index 00000000..24f9ae16
--- /dev/null
+++ b/release/src/router/busybox/testsuite/dirname/dirname-handles-single-component
@@ -0,0 +1 @@
+test $(busybox dirname foo) = .
diff --git a/release/src/router/busybox/testsuite/echo/echo-does-not-print-newline b/release/src/router/busybox/testsuite/echo/echo-does-not-print-newline
new file mode 100755
index 00000000..2ed03caf
--- /dev/null
+++ b/release/src/router/busybox/testsuite/echo/echo-does-not-print-newline
@@ -0,0 +1 @@
+test `busybox echo -n word | wc -c` -eq 4
diff --git a/release/src/router/busybox/testsuite/echo/echo-prints-argument b/release/src/router/busybox/testsuite/echo/echo-prints-argument
new file mode 100755
index 00000000..98779dbb
--- /dev/null
+++ b/release/src/router/busybox/testsuite/echo/echo-prints-argument
@@ -0,0 +1 @@
+test `busybox echo fubar` = fubar
diff --git a/release/src/router/busybox/testsuite/echo/echo-prints-arguments b/release/src/router/busybox/testsuite/echo/echo-prints-arguments
new file mode 100755
index 00000000..4e4e3b43
--- /dev/null
+++ b/release/src/router/busybox/testsuite/echo/echo-prints-arguments
@@ -0,0 +1 @@
+test "`busybox echo foo bar`" = "foo bar"
diff --git a/release/src/router/busybox/testsuite/echo/echo-prints-newline b/release/src/router/busybox/testsuite/echo/echo-prints-newline
new file mode 100755
index 00000000..838671ef
--- /dev/null
+++ b/release/src/router/busybox/testsuite/echo/echo-prints-newline
@@ -0,0 +1 @@
+test `busybox echo word | wc -c` -eq 5
diff --git a/release/src/router/busybox/testsuite/false/false-is-silent b/release/src/router/busybox/testsuite/false/false-is-silent
new file mode 100755
index 00000000..8a9aa0c7
--- /dev/null
+++ b/release/src/router/busybox/testsuite/false/false-is-silent
@@ -0,0 +1 @@
+busybox false 2>&1 | cmp - /dev/null
diff --git a/release/src/router/busybox/testsuite/false/false-returns-failure b/release/src/router/busybox/testsuite/false/false-returns-failure
new file mode 100755
index 00000000..1a061f28
--- /dev/null
+++ b/release/src/router/busybox/testsuite/false/false-returns-failure
@@ -0,0 +1 @@
+! busybox false
diff --git a/release/src/router/busybox/testsuite/find/find-supports-minus-xdev b/release/src/router/busybox/testsuite/find/find-supports-minus-xdev
new file mode 100755
index 00000000..1c8818cd
--- /dev/null
+++ b/release/src/router/busybox/testsuite/find/find-supports-minus-xdev
@@ -0,0 +1,2 @@
+# XFAIL
+busybox find . -xdev >/dev/null 2>&1
diff --git a/release/src/router/busybox/testsuite/grep/egrep-is-not-case-insensitive b/release/src/router/busybox/testsuite/grep/egrep-is-not-case-insensitive
new file mode 100755
index 00000000..88160739
--- /dev/null
+++ b/release/src/router/busybox/testsuite/grep/egrep-is-not-case-insensitive
@@ -0,0 +1,2 @@
+# FEATURE: CONFIG_FEATURE_GREP_EGREP_ALIAS
+test x`echo foo | busybox egrep FOO` = x
diff --git a/release/src/router/busybox/testsuite/grep/egrep-supports-extended-regexps b/release/src/router/busybox/testsuite/grep/egrep-supports-extended-regexps
new file mode 100755
index 00000000..6ef8b915
--- /dev/null
+++ b/release/src/router/busybox/testsuite/grep/egrep-supports-extended-regexps
@@ -0,0 +1,2 @@
+# FEATURE: CONFIG_FEATURE_GREP_EGREP_ALIAS
+echo foo | busybox egrep fo+
diff --git a/release/src/router/busybox/testsuite/grep/grep-handles-binary-files b/release/src/router/busybox/testsuite/grep/grep-handles-binary-files
new file mode 100755
index 00000000..edb2042e
--- /dev/null
+++ b/release/src/router/busybox/testsuite/grep/grep-handles-binary-files
@@ -0,0 +1 @@
+echo -e '\0foo' | busybox grep foo
diff --git a/release/src/router/busybox/testsuite/grep/grep-handles-multiple-regexps b/release/src/router/busybox/testsuite/grep/grep-handles-multiple-regexps
new file mode 100755
index 00000000..5c1b8de1
--- /dev/null
+++ b/release/src/router/busybox/testsuite/grep/grep-handles-multiple-regexps
@@ -0,0 +1 @@
+echo foo | busybox grep -e foo -e bar
diff --git a/release/src/router/busybox/testsuite/grep/grep-is-also-egrep b/release/src/router/busybox/testsuite/grep/grep-is-also-egrep
new file mode 100755
index 00000000..2e6977c2
--- /dev/null
+++ b/release/src/router/busybox/testsuite/grep/grep-is-also-egrep
@@ -0,0 +1,2 @@
+# FEATURE: CONFIG_FEATURE_GREP_EGREP_ALIAS
+echo foo | busybox egrep foo
diff --git a/release/src/router/busybox/testsuite/grep/grep-matches-NUL b/release/src/router/busybox/testsuite/grep/grep-matches-NUL
new file mode 100755
index 00000000..597d22cb
--- /dev/null
+++ b/release/src/router/busybox/testsuite/grep/grep-matches-NUL
@@ -0,0 +1,2 @@
+# XFAIL
+echo -e '\0' | busybox grep .
diff --git a/release/src/router/busybox/testsuite/gunzip/gunzip-reads-from-standard-input b/release/src/router/busybox/testsuite/gunzip/gunzip-reads-from-standard-input
new file mode 100755
index 00000000..7c498c0c
--- /dev/null
+++ b/release/src/router/busybox/testsuite/gunzip/gunzip-reads-from-standard-input
@@ -0,0 +1,2 @@
+echo foo | gzip | busybox gunzip > output
+echo foo | cmp - output
diff --git a/release/src/router/busybox/testsuite/gzip/gzip-accepts-multiple-files b/release/src/router/busybox/testsuite/gzip/gzip-accepts-multiple-files
new file mode 100755
index 00000000..8f0d9c84
--- /dev/null
+++ b/release/src/router/busybox/testsuite/gzip/gzip-accepts-multiple-files
@@ -0,0 +1,3 @@
+touch foo bar
+busybox gzip foo bar
+test -f foo.gz -a -f bar.gz
diff --git a/release/src/router/busybox/testsuite/gzip/gzip-accepts-single-minus b/release/src/router/busybox/testsuite/gzip/gzip-accepts-single-minus
new file mode 100755
index 00000000..8b51fdfe
--- /dev/null
+++ b/release/src/router/busybox/testsuite/gzip/gzip-accepts-single-minus
@@ -0,0 +1 @@
+echo foo | busybox gzip - >/dev/null
diff --git a/release/src/router/busybox/testsuite/gzip/gzip-removes-original-file b/release/src/router/busybox/testsuite/gzip/gzip-removes-original-file
new file mode 100755
index 00000000..b9cb995b
--- /dev/null
+++ b/release/src/router/busybox/testsuite/gzip/gzip-removes-original-file
@@ -0,0 +1,3 @@
+touch foo
+busybox gzip foo
+test ! -f foo
diff --git a/release/src/router/busybox/testsuite/md5sum/md5sum-verifies-non-binary-file b/release/src/router/busybox/testsuite/md5sum/md5sum-verifies-non-binary-file
new file mode 100755
index 00000000..8566a234
--- /dev/null
+++ b/release/src/router/busybox/testsuite/md5sum/md5sum-verifies-non-binary-file
@@ -0,0 +1,3 @@
+touch foo
+md5sum foo > bar
+busybox md5sum -c bar
diff --git a/release/src/router/busybox/testsuite/mkdir/mkdir-makes-a-directory b/release/src/router/busybox/testsuite/mkdir/mkdir-makes-a-directory
new file mode 100755
index 00000000..6ca5c4d5
--- /dev/null
+++ b/release/src/router/busybox/testsuite/mkdir/mkdir-makes-a-directory
@@ -0,0 +1,2 @@
+busybox mkdir foo
+test -d foo
diff --git a/release/src/router/busybox/testsuite/mkdir/mkdir-makes-parent-directories b/release/src/router/busybox/testsuite/mkdir/mkdir-makes-parent-directories
new file mode 100755
index 00000000..992facb4
--- /dev/null
+++ b/release/src/router/busybox/testsuite/mkdir/mkdir-makes-parent-directories
@@ -0,0 +1,2 @@
+busybox mkdir -p foo/bar
+test -d foo -a -d foo/bar
diff --git a/release/src/router/busybox/testsuite/msh/msh-supports-underscores-in-variable-names b/release/src/router/busybox/testsuite/msh/msh-supports-underscores-in-variable-names
new file mode 100755
index 00000000..9c7834b3
--- /dev/null
+++ b/release/src/router/busybox/testsuite/msh/msh-supports-underscores-in-variable-names
@@ -0,0 +1 @@
+test "`busybox msh -c 'FOO_BAR=foo; echo $FOO_BAR'`" = foo
diff --git a/release/src/router/busybox/testsuite/mv/mv-moves-file b/release/src/router/busybox/testsuite/mv/mv-moves-file
new file mode 100755
index 00000000..edb4c375
--- /dev/null
+++ b/release/src/router/busybox/testsuite/mv/mv-moves-file
@@ -0,0 +1,3 @@
+touch foo
+busybox mv foo bar
+test ! -f foo -a -f bar
diff --git a/release/src/router/busybox/testsuite/pwd/pwd-prints-working-directory b/release/src/router/busybox/testsuite/pwd/pwd-prints-working-directory
new file mode 100755
index 00000000..7bea1074
--- /dev/null
+++ b/release/src/router/busybox/testsuite/pwd/pwd-prints-working-directory
@@ -0,0 +1 @@
+test `pwd` = `busybox pwd`
diff --git a/release/src/router/busybox/testsuite/rm/rm-removes-file b/release/src/router/busybox/testsuite/rm/rm-removes-file
new file mode 100755
index 00000000..46571a98
--- /dev/null
+++ b/release/src/router/busybox/testsuite/rm/rm-removes-file
@@ -0,0 +1,3 @@
+touch foo
+busybox rm foo
+test ! -f foo
diff --git a/release/src/router/busybox/testsuite/rmdir/rmdir-removes-parent-directories b/release/src/router/busybox/testsuite/rmdir/rmdir-removes-parent-directories
new file mode 100755
index 00000000..222f5dec
--- /dev/null
+++ b/release/src/router/busybox/testsuite/rmdir/rmdir-removes-parent-directories
@@ -0,0 +1,3 @@
+mkdir -p foo/bar
+busybox rmdir -p foo/bar
+test ! -d foo
diff --git a/release/src/router/busybox/testsuite/runtest b/release/src/router/busybox/testsuite/runtest
new file mode 100755
index 00000000..2cf85f5d
--- /dev/null
+++ b/release/src/router/busybox/testsuite/runtest
@@ -0,0 +1,113 @@
+#!/bin/sh
+
+PATH=$(dirname $(pwd)):$PATH
+
+show_result ()
+{
+ local resolution=$1
+ local testcase=$2
+ local status=0
+
+ if [ $resolution = XPASS -o $resolution = FAIL ]; then
+ status=1
+ fi
+
+ if [ "$verbose" -o $status -eq 1 ]; then
+ echo "$resolution: $testcase"
+ fi
+
+ return $status
+}
+
+run_applet_testcase ()
+{
+ local applet=$1
+ local testcase=$2
+
+ local status=0
+ local X=
+
+ local uc_applet=$(echo $applet | tr a-z A-Z)
+ local testname=$(basename $testcase)
+
+ if grep -q "^# CONFIG_${uc_applet} is not set$" ../.config; then
+ show_result UNTESTED $testname
+ return 0
+ fi
+
+ if grep -q "^# FEATURE: " $testcase; then
+ local feature=`sed -ne 's/^# FEATURE: //p' $testcase`
+
+ if grep -q "^# ${feature} is not set$" ../.config; then
+ show_result UNTESTED $testname
+ return 0
+ fi
+ fi
+
+ if grep -q "^# XFAIL$" $testcase; then
+ X=X
+ fi
+
+ mkdir tmp
+ pushd tmp >/dev/null
+
+ if . ../$testcase >/dev/null 2>&1; then
+ show_result ${X}PASS $testname
+ status=$?
+ else
+ show_result ${X}FAIL $testname
+ status=$?
+ fi
+
+ popd >/dev/null
+ rm -rf tmp
+
+ return $status
+}
+
+run_applet_tests ()
+{
+ local applet=$1
+
+ local status=0
+
+ for testcase in $applet/*; do
+ if [ "$testcase" = "$applet/CVS" ]; then
+ continue
+ fi
+
+ if run_applet_testcase $applet $testcase; then
+ :
+ else
+ status=1
+ fi
+ done
+
+ return $status
+}
+
+
+status=0
+
+if [ x"$1" = x"-v" ]; then
+ verbose=1
+ shift
+fi
+
+if [ $# -ne 0 ]; then
+ applets="$@"
+else
+ applets="*"
+fi
+
+for applet in $applets; do
+ if [ "$applet" != CVS -a -d "$applet" ]; then
+ if run_applet_tests $applet; then
+ :
+ else
+ status=1
+ fi
+ fi
+done
+
+exit $status
diff --git a/release/src/router/busybox/testsuite/sed/sed-accepts-blanks-before-command b/release/src/router/busybox/testsuite/sed/sed-accepts-blanks-before-command
new file mode 100755
index 00000000..9597c2f8
--- /dev/null
+++ b/release/src/router/busybox/testsuite/sed/sed-accepts-blanks-before-command
@@ -0,0 +1 @@
+busybox sed -e '1 d' </dev/null
diff --git a/release/src/router/busybox/testsuite/sed/sed-aic-commands b/release/src/router/busybox/testsuite/sed/sed-aic-commands
new file mode 100755
index 00000000..b41c14ab
--- /dev/null
+++ b/release/src/router/busybox/testsuite/sed/sed-aic-commands
@@ -0,0 +1,134 @@
+cat - >input <<EOF
+2i\\
+before 2
+5c\\
+Change 5
+10a\\
+After 10
+22i\\
+before 22\\
+Continued
+25c\\
+Change 25\\
+Continued
+20a\\
+After 20\\
+Continued
+ 32i\\
+before 32\\
+Continued 1\\
+Continued 2\\
+Continued 3
+ 35c\\
+Change 35\\
+Continued 1\\
+Continued 2\\
+Continued 3
+ 30a\\
+After 30\\
+Continued 1\\
+Continued 2\\
+Continued 3
+EOF
+busybox sed -f input >output <<EOF
+ 1 y
+ 2 y
+ 3 y
+ 4 y
+ 5 y
+ 6 y
+ 7 y
+ 8 y
+ 9 y
+ 10 y
+ 11 y
+ 12 y
+ 13 y
+ 14 y
+ 15 y
+ 16 y
+ 17 y
+ 18 y
+ 19 y
+ 20 y
+ 21 y
+ 22 y
+ 23 y
+ 24 y
+ 25 y
+ 26 y
+ 27 y
+ 28 y
+ 29 y
+ 30 y
+ 31 y
+ 32 y
+ 33 y
+ 34 y
+ 35 y
+ 36 y
+ 37 y
+ 38 y
+ 39 y
+ 40 y
+EOF
+cmp -s output - <<EOF
+ 1 y
+before 2
+ 2 y
+ 3 y
+ 4 y
+Change 5
+ 6 y
+ 7 y
+ 8 y
+ 9 y
+ 10 y
+After 10
+ 11 y
+ 12 y
+ 13 y
+ 14 y
+ 15 y
+ 16 y
+ 17 y
+ 18 y
+ 19 y
+ 20 y
+After 20
+Continued
+ 21 y
+before 22
+Continued
+ 22 y
+ 23 y
+ 24 y
+Change 25
+Continued
+ 26 y
+ 27 y
+ 28 y
+ 29 y
+ 30 y
+After 30
+Continued 1
+Continued 2
+Continued 3
+ 31 y
+before 32
+Continued 1
+Continued 2
+Continued 3
+ 32 y
+ 33 y
+ 34 y
+Change 35
+Continued 1
+Continued 2
+Continued 3
+ 36 y
+ 37 y
+ 38 y
+ 39 y
+ 40 y
+EOF
diff --git a/release/src/router/busybox/testsuite/sed/sed-chains-substs b/release/src/router/busybox/testsuite/sed/sed-chains-substs
new file mode 100755
index 00000000..266936ac
--- /dev/null
+++ b/release/src/router/busybox/testsuite/sed/sed-chains-substs
@@ -0,0 +1 @@
+test "$(echo foo | busybox sed -e s/foo/bar/ -e s/bar/baz/)" = baz
diff --git a/release/src/router/busybox/testsuite/sed/sed-does-not-substitute-in-deleted-line b/release/src/router/busybox/testsuite/sed/sed-does-not-substitute-in-deleted-line
new file mode 100755
index 00000000..6f106e10
--- /dev/null
+++ b/release/src/router/busybox/testsuite/sed/sed-does-not-substitute-in-deleted-line
@@ -0,0 +1,2 @@
+echo foo | busybox sed -e /foo/d -e s/foo/bar/ >foo
+cmp foo /dev/null
diff --git a/release/src/router/busybox/testsuite/sed/sed-handles-embedded-slashes b/release/src/router/busybox/testsuite/sed/sed-handles-embedded-slashes
new file mode 100755
index 00000000..cc287613
--- /dev/null
+++ b/release/src/router/busybox/testsuite/sed/sed-handles-embedded-slashes
@@ -0,0 +1 @@
+test "$(echo fu/bar | busybox sed -e 's/[/]//')" = fubar
diff --git a/release/src/router/busybox/testsuite/sed/sed-handles-empty-lines b/release/src/router/busybox/testsuite/sed/sed-handles-empty-lines
new file mode 100755
index 00000000..2bb8f045
--- /dev/null
+++ b/release/src/router/busybox/testsuite/sed/sed-handles-empty-lines
@@ -0,0 +1 @@
+test `echo | busybox sed -e 's/$/@/'` = @
diff --git a/release/src/router/busybox/testsuite/sed/sed-handles-unsatisfied-backrefs b/release/src/router/busybox/testsuite/sed/sed-handles-unsatisfied-backrefs
new file mode 100755
index 00000000..61bff883
--- /dev/null
+++ b/release/src/router/busybox/testsuite/sed/sed-handles-unsatisfied-backrefs
@@ -0,0 +1,6 @@
+busybox sed -e 's/.*root=/\1/' >output <<EOF
+BOOT_IMAGE=vmlinuz root=/dev/hda5 initrd=init1
+EOF
+cmp -s output - <<EOF
+/dev/hda5 initrd=init1
+EOF
diff --git a/release/src/router/busybox/testsuite/sed/sed-prints-line-once-for-multiple-substs b/release/src/router/busybox/testsuite/sed/sed-prints-line-once-for-multiple-substs
new file mode 100755
index 00000000..ba8955d6
--- /dev/null
+++ b/release/src/router/busybox/testsuite/sed/sed-prints-line-once-for-multiple-substs
@@ -0,0 +1,4 @@
+busybox sed -e s/1/2/g -e s/3/4/g >output <<EOF
+1
+EOF
+echo 2 | cmp -s output -
diff --git a/release/src/router/busybox/testsuite/sed/sed-recurses-properly b/release/src/router/busybox/testsuite/sed/sed-recurses-properly
new file mode 100755
index 00000000..bb70f4f9
--- /dev/null
+++ b/release/src/router/busybox/testsuite/sed/sed-recurses-properly
@@ -0,0 +1,2 @@
+# XFAIL
+test "`echo '12345' | busybox sed -e 's/[[:space:]]*/,/g')` = ',1,2,3,4,5,'"
diff --git a/release/src/router/busybox/testsuite/sed/sed-requires-newline-after-edit-command b/release/src/router/busybox/testsuite/sed/sed-requires-newline-after-edit-command
new file mode 100755
index 00000000..37ebc660
--- /dev/null
+++ b/release/src/router/busybox/testsuite/sed/sed-requires-newline-after-edit-command
@@ -0,0 +1 @@
+! busybox sed -e 'i\foo' </dev/null
diff --git a/release/src/router/busybox/testsuite/sed/sed-splits-edit-commands-on-command-line b/release/src/router/busybox/testsuite/sed/sed-splits-edit-commands-on-command-line
new file mode 100755
index 00000000..6421fa55
--- /dev/null
+++ b/release/src/router/busybox/testsuite/sed/sed-splits-edit-commands-on-command-line
@@ -0,0 +1,9 @@
+echo 2 | busybox sed -e 'i\
+1
+a\
+3' > output
+cmp output - <<EOF
+1
+2
+3
+EOF
diff --git a/release/src/router/busybox/testsuite/strings/strings-works-like-GNU b/release/src/router/busybox/testsuite/strings/strings-works-like-GNU
new file mode 100755
index 00000000..02e42313
--- /dev/null
+++ b/release/src/router/busybox/testsuite/strings/strings-works-like-GNU
@@ -0,0 +1,8 @@
+rm -f foo bar
+strings -af ../../busybox > foo
+busybox strings -af ../../busybox > bar
+test ! -f foo -a -f bar
+if [ $? = 0 ] ; then
+ diff -q foo bar
+fi;
+
diff --git a/release/src/router/busybox/testsuite/tar/tar-archives-multiple-files b/release/src/router/busybox/testsuite/tar/tar-archives-multiple-files
new file mode 100755
index 00000000..245d9e98
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-archives-multiple-files
@@ -0,0 +1,6 @@
+# FEATURE: CONFIG_FEATURE_TAR_CREATE
+touch foo bar
+busybox tar cf foo.tar foo bar
+rm foo bar
+tar xf foo.tar
+test -f foo -a -f bar
diff --git a/release/src/router/busybox/testsuite/tar/tar-complains-about-missing-file b/release/src/router/busybox/testsuite/tar/tar-complains-about-missing-file
new file mode 100755
index 00000000..dd1f2fa8
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-complains-about-missing-file
@@ -0,0 +1,4 @@
+# XFAIL
+touch foo
+tar cf foo.tar foo
+! busybox tar xf foo.tar bar
diff --git a/release/src/router/busybox/testsuite/tar/tar-demands-at-least-one-ctx b/release/src/router/busybox/testsuite/tar/tar-demands-at-least-one-ctx
new file mode 100755
index 00000000..85e7f605
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-demands-at-least-one-ctx
@@ -0,0 +1 @@
+! busybox tar v
diff --git a/release/src/router/busybox/testsuite/tar/tar-demands-at-most-one-ctx b/release/src/router/busybox/testsuite/tar/tar-demands-at-most-one-ctx
new file mode 100755
index 00000000..130d0e7f
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-demands-at-most-one-ctx
@@ -0,0 +1 @@
+! busybox tar tx
diff --git a/release/src/router/busybox/testsuite/tar/tar-extracts-file b/release/src/router/busybox/testsuite/tar/tar-extracts-file
new file mode 100755
index 00000000..ca72f248
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-extracts-file
@@ -0,0 +1,5 @@
+touch foo
+tar cf foo.tar foo
+rm foo
+busybox tar xf foo.tar
+test -f foo
diff --git a/release/src/router/busybox/testsuite/tar/tar-extracts-from-standard-input b/release/src/router/busybox/testsuite/tar/tar-extracts-from-standard-input
new file mode 100755
index 00000000..a30e9f0b
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-extracts-from-standard-input
@@ -0,0 +1,5 @@
+touch foo
+tar cf foo.tar foo
+rm foo
+cat foo.tar | busybox tar x
+test -f foo
diff --git a/release/src/router/busybox/testsuite/tar/tar-extracts-multiple-files b/release/src/router/busybox/testsuite/tar/tar-extracts-multiple-files
new file mode 100755
index 00000000..e26901e8
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-extracts-multiple-files
@@ -0,0 +1,5 @@
+touch foo bar
+tar cf foo.tar foo bar
+rm foo bar
+busybox tar xf foo.tar
+test -f foo -a -f bar
diff --git a/release/src/router/busybox/testsuite/tar/tar-extracts-to-standard-output b/release/src/router/busybox/testsuite/tar/tar-extracts-to-standard-output
new file mode 100755
index 00000000..ca48e364
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-extracts-to-standard-output
@@ -0,0 +1,3 @@
+echo foo > foo
+tar cf foo.tar foo
+cat foo.tar | busybox tar Ox | cmp foo -
diff --git a/release/src/router/busybox/testsuite/tar/tar-handles-cz-options b/release/src/router/busybox/testsuite/tar/tar-handles-cz-options
new file mode 100755
index 00000000..b2806bbe
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-handles-cz-options
@@ -0,0 +1,4 @@
+# XFAIL
+touch foo
+busybox tar czf foo.tar.gz foo
+gzip -d foo.tar.gz
diff --git a/release/src/router/busybox/testsuite/tar/tar-handles-empty-include-and-non-empty-exclude-list b/release/src/router/busybox/testsuite/tar/tar-handles-empty-include-and-non-empty-exclude-list
new file mode 100755
index 00000000..b76f0230
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-handles-empty-include-and-non-empty-exclude-list
@@ -0,0 +1,5 @@
+# FEATURE: CONFIG_FEATURE_TAR_EXCLUDE
+touch foo
+tar cf foo.tar foo
+echo foo >foo.exclude
+busybox tar xf foo.tar -X foo.exclude
diff --git a/release/src/router/busybox/testsuite/tar/tar-handles-exclude-and-extract-lists b/release/src/router/busybox/testsuite/tar/tar-handles-exclude-and-extract-lists
new file mode 100755
index 00000000..e715a477
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-handles-exclude-and-extract-lists
@@ -0,0 +1,7 @@
+# FEATURE: CONFIG_FEATURE_TAR_EXCLUDE
+touch foo bar baz
+tar cf foo.tar foo bar baz
+echo foo >foo.exclude
+rm foo bar baz
+busybox tar xf foo.tar foo bar -X foo.exclude
+test ! -f foo -a -f bar -a ! -f baz
diff --git a/release/src/router/busybox/testsuite/tar/tar-handles-multiple-X-options b/release/src/router/busybox/testsuite/tar/tar-handles-multiple-X-options
new file mode 100755
index 00000000..8321af85
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-handles-multiple-X-options
@@ -0,0 +1,8 @@
+touch foo
+touch bar
+tar cf foo.tar foo bar
+echo foo > foo.exclude
+echo bar > bar.exclude
+rm foo bar
+busybox tar xf foo.tar -X foo.exclude -X bar.exclude
+test ! -f foo -a ! -f bar
diff --git a/release/src/router/busybox/testsuite/tar/tar-handles-nested-exclude b/release/src/router/busybox/testsuite/tar/tar-handles-nested-exclude
new file mode 100755
index 00000000..ad39506c
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tar/tar-handles-nested-exclude
@@ -0,0 +1,8 @@
+# FEATURE: CONFIG_FEATURE_TAR_EXCLUDE
+mkdir foo
+touch foo/bar
+tar cf foo.tar foo
+rm -rf foo
+echo foo/bar >foobar.exclude
+busybox tar xf foo.tar foo -X foobar.exclude
+test -d foo -a ! -f foo/bar
diff --git a/release/src/router/busybox/testsuite/tee/tee-appends-input b/release/src/router/busybox/testsuite/tee/tee-appends-input
new file mode 100755
index 00000000..cff20bf7
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tee/tee-appends-input
@@ -0,0 +1,5 @@
+echo i\'m a little teapot >foo
+cp foo bar
+echo i\'m a little teapot >>foo
+echo i\'m a little teapot | busybox tee -a bar >/dev/null
+cmp foo bar
diff --git a/release/src/router/busybox/testsuite/tee/tee-tees-input b/release/src/router/busybox/testsuite/tee/tee-tees-input
new file mode 100755
index 00000000..26e21738
--- /dev/null
+++ b/release/src/router/busybox/testsuite/tee/tee-tees-input
@@ -0,0 +1,3 @@
+echo i\'m a little teapot >foo
+echo i\'m a little teapot | busybox tee bar >baz
+cmp foo bar && cmp foo baz
diff --git a/release/src/router/busybox/testsuite/touch/touch-creates-file b/release/src/router/busybox/testsuite/touch/touch-creates-file
new file mode 100755
index 00000000..4b493542
--- /dev/null
+++ b/release/src/router/busybox/testsuite/touch/touch-creates-file
@@ -0,0 +1,2 @@
+busybox touch foo
+test -f foo
diff --git a/release/src/router/busybox/testsuite/touch/touch-does-not-create-file b/release/src/router/busybox/testsuite/touch/touch-does-not-create-file
new file mode 100755
index 00000000..88525928
--- /dev/null
+++ b/release/src/router/busybox/testsuite/touch/touch-does-not-create-file
@@ -0,0 +1,2 @@
+busybox touch -c foo
+test ! -f foo
diff --git a/release/src/router/busybox/testsuite/touch/touch-touches-files-after-non-existent-file b/release/src/router/busybox/testsuite/touch/touch-touches-files-after-non-existent-file
new file mode 100755
index 00000000..a869ec26
--- /dev/null
+++ b/release/src/router/busybox/testsuite/touch/touch-touches-files-after-non-existent-file
@@ -0,0 +1,3 @@
+touch -t 198001010000 bar
+busybox touch -c foo bar
+test x"`find bar -mtime -1`" = xbar
diff --git a/release/src/router/busybox/testsuite/true/true-is-silent b/release/src/router/busybox/testsuite/true/true-is-silent
new file mode 100755
index 00000000..1d1bdb22
--- /dev/null
+++ b/release/src/router/busybox/testsuite/true/true-is-silent
@@ -0,0 +1 @@
+busybox true 2>&1 | cmp - /dev/null
diff --git a/release/src/router/busybox/testsuite/true/true-returns-success b/release/src/router/busybox/testsuite/true/true-returns-success
new file mode 100755
index 00000000..cdf2d55e
--- /dev/null
+++ b/release/src/router/busybox/testsuite/true/true-returns-success
@@ -0,0 +1 @@
+busybox true
diff --git a/release/src/router/busybox/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly b/release/src/router/busybox/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly
new file mode 100755
index 00000000..0ccf23b5
--- /dev/null
+++ b/release/src/router/busybox/testsuite/uuencode/uuencode-sets-standard-input-mode-correctly
@@ -0,0 +1,6 @@
+saved_umask=$(umask)
+umask 0
+busybox uuencode foo </dev/null | head -n 1 | grep -q 666
+status=$?
+umask $saved_umask
+return $status
diff --git a/release/src/router/busybox/testsuite/wc/wc-counts-all b/release/src/router/busybox/testsuite/wc/wc-counts-all
new file mode 100755
index 00000000..5e2cb6e4
--- /dev/null
+++ b/release/src/router/busybox/testsuite/wc/wc-counts-all
@@ -0,0 +1 @@
+test "`echo i\'m a little teapot | busybox wc`" = ' 1 4 20'
diff --git a/release/src/router/busybox/testsuite/wc/wc-counts-characters b/release/src/router/busybox/testsuite/wc/wc-counts-characters
new file mode 100755
index 00000000..75586468
--- /dev/null
+++ b/release/src/router/busybox/testsuite/wc/wc-counts-characters
@@ -0,0 +1 @@
+test `echo i\'m a little teapot | busybox wc -c` -eq 20
diff --git a/release/src/router/busybox/testsuite/wc/wc-counts-lines b/release/src/router/busybox/testsuite/wc/wc-counts-lines
new file mode 100755
index 00000000..5be6ed08
--- /dev/null
+++ b/release/src/router/busybox/testsuite/wc/wc-counts-lines
@@ -0,0 +1 @@
+test `echo i\'m a little teapot | busybox wc -l` -eq 1
diff --git a/release/src/router/busybox/testsuite/wc/wc-counts-words b/release/src/router/busybox/testsuite/wc/wc-counts-words
new file mode 100755
index 00000000..331650e9
--- /dev/null
+++ b/release/src/router/busybox/testsuite/wc/wc-counts-words
@@ -0,0 +1 @@
+test `echo i\'m a little teapot | busybox wc -w` -eq 4
diff --git a/release/src/router/busybox/testsuite/wc/wc-prints-longest-line-length b/release/src/router/busybox/testsuite/wc/wc-prints-longest-line-length
new file mode 100755
index 00000000..78831fc1
--- /dev/null
+++ b/release/src/router/busybox/testsuite/wc/wc-prints-longest-line-length
@@ -0,0 +1 @@
+test `echo i\'m a little teapot | busybox wc -L` -eq 19
diff --git a/release/src/router/busybox/testsuite/wget/wget--O-overrides--P b/release/src/router/busybox/testsuite/wget/wget--O-overrides--P
new file mode 100755
index 00000000..fdb5d47c
--- /dev/null
+++ b/release/src/router/busybox/testsuite/wget/wget--O-overrides--P
@@ -0,0 +1,3 @@
+mkdir foo
+busybox wget -q -O index.html -P foo http://www.google.com/
+test -s index.html
diff --git a/release/src/router/busybox/testsuite/wget/wget-handles-empty-path b/release/src/router/busybox/testsuite/wget/wget-handles-empty-path
new file mode 100755
index 00000000..5b591837
--- /dev/null
+++ b/release/src/router/busybox/testsuite/wget/wget-handles-empty-path
@@ -0,0 +1 @@
+busybox wget http://www.google.com
diff --git a/release/src/router/busybox/testsuite/wget/wget-retrieves-google-index b/release/src/router/busybox/testsuite/wget/wget-retrieves-google-index
new file mode 100755
index 00000000..7be9a808
--- /dev/null
+++ b/release/src/router/busybox/testsuite/wget/wget-retrieves-google-index
@@ -0,0 +1,2 @@
+busybox wget -q -O foo http://www.google.com/
+test -s foo
diff --git a/release/src/router/busybox/testsuite/wget/wget-supports--P b/release/src/router/busybox/testsuite/wget/wget-supports--P
new file mode 100755
index 00000000..9b4d095e
--- /dev/null
+++ b/release/src/router/busybox/testsuite/wget/wget-supports--P
@@ -0,0 +1,3 @@
+mkdir foo
+busybox wget -q -P foo http://www.google.com/
+test -s foo/index.html
diff --git a/release/src/router/busybox/testsuite/which/which-uses-default-path b/release/src/router/busybox/testsuite/which/which-uses-default-path
new file mode 100755
index 00000000..f612aeb5
--- /dev/null
+++ b/release/src/router/busybox/testsuite/which/which-uses-default-path
@@ -0,0 +1,7 @@
+BUSYBOX=$(type -p busybox)
+SAVED_PATH=$PATH
+unset PATH
+$BUSYBOX which ls
+STATUS=$?
+export PATH=$SAVED_PATH
+return $STATUS