summaryrefslogtreecommitdiff
path: root/i/pc104/initrd/conf/busybox/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'i/pc104/initrd/conf/busybox/testsuite')
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/README34
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/TODO26
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/all_sourcecode.tests78
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/basename/basename-does-not-remove-identical-extension1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/basename/basename-works2
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/bunzip2.tests84
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/bunzip2/bunzip2-reads-from-standard-input2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/bunzip2/bunzip2-removes-compressed-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/bunzip2/bzcat-does-not-remove-compressed-file3
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/busybox.tests46
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/bzcat.tests49
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cat/cat-prints-a-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cat/cat-prints-a-file-and-standard-input7
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cmp/cmp-detects-difference9
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-a-files-to-dir14
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-a-preserves-links5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-copies-empty-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-copies-large-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-copies-small-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-d-files-to-dir11
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-dir-create-dir4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-dir-existing-dir5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-does-not-copy-unreadable-file6
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-files-to-dir11
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-follows-links4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-preserves-hard-links6
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-preserves-links5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cp/cp-preserves-source-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-character1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-closed-range1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-field1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-an-open-range1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-an-unclosed-range1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/date/date-R-works2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/date/date-format-works1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/date/date-u-works2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/date/date-works2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/dd/dd-accepts-if2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/dd/dd-accepts-of2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/dd/dd-copies-from-standard-input-to-standard-output1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/dd/dd-prints-count-to-standard-error2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-absolute-path1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-empty-path1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-multiple-slashes1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-relative-path1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-root1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-single-component1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-works2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/du/du-h-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/du/du-k-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/du/du-l-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/du/du-m-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/du/du-s-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/du/du-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/echo/echo-does-not-print-newline1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-argument1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-arguments1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-newline1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/expr/expr-works59
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/false/false-is-silent1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/false/false-returns-failure1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/find/find-supports-minus-xdev1
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/grep.tests84
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/gunzip.tests3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/gunzip/gunzip-reads-from-standard-input2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/gzip/gzip-accepts-multiple-files3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/gzip/gzip-accepts-single-minus1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/gzip/gzip-removes-original-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/head/head-n-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/head/head-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/hostid/hostid-works2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-d-works2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-i-works2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-s-works1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-works1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/id/id-g-works1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/id/id-u-works1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/id/id-un-works1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/id/id-ur-works1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/ln/ln-creates-hard-links4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/ln/ln-creates-soft-links4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/ln/ln-force-creates-hard-links5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/ln/ln-force-creates-soft-links5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/ln/ln-preserves-hard-links8
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/ln/ln-preserves-soft-links9
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/ls/ls-1-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/ls/ls-h-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/ls/ls-l-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/ls/ls-s-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/md5sum/md5sum-verifies-non-binary-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mkdir/mkdir-makes-a-directory2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mkdir/mkdir-makes-parent-directories2
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/mount.testroot183
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/msh/msh-supports-underscores-in-variable-names1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-files-to-dir16
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-follows-links4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-empty-file4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-hardlinks4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-large-file4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-small-file4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-symlinks6
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-unreadable-files5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-hard-links6
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-links5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-refuses-mv-dir-to-subdir23
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/mv/mv-removes-source-file4
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/pidof.tests29
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/pwd/pwd-prints-working-directory1
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/readlink.tests32
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/rm/rm-removes-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/rmdir/rmdir-removes-parent-directories3
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/runtest150
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/sed.tests203
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/seq.tests36
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/sort.tests113
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/strings/strings-works-like-GNU9
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/sum.tests24
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tail/tail-n-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tail/tail-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-archives-multiple-files6
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-complains-about-missing-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-demands-at-least-one-ctx1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-demands-at-most-one-ctx1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-all-subdirs12
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-file5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-from-standard-input5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-multiple-files6
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-to-standard-output3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-cz-options5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-empty-include-and-non-empty-exclude-list6
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-exclude-and-extract-lists8
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-multiple-X-options10
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-nested-exclude9
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/taskset.tests17
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tee/tee-appends-input5
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tee/tee-tees-input3
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/testing.sh154
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/touch/touch-creates-file2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/touch/touch-does-not-create-file2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/touch/touch-touches-files-after-non-existent-file3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tr/tr-d-works4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tr/tr-non-gnu1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/tr/tr-works24
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/true/true-is-silent1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/true/true-returns-success1
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/umlwrapper.sh20
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/uniq.tests70
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/unzip.tests38
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/uptime/uptime-works2
-rwxr-xr-xi/pc104/initrd/conf/busybox/testsuite/uuencode.tests28
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-all2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-characters1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-lines1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-words1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/wc/wc-prints-longest-line-length1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/wget/wget--O-overrides--P3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/wget/wget-handles-empty-path1
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/wget/wget-retrieves-google-index2
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/wget/wget-supports--P3
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/which/which-uses-default-path4
-rw-r--r--i/pc104/initrd/conf/busybox/testsuite/xargs/xargs-works4
162 files changed, 2082 insertions, 0 deletions
diff --git a/i/pc104/initrd/conf/busybox/testsuite/README b/i/pc104/initrd/conf/busybox/testsuite/README
new file mode 100644
index 0000000..377f20e
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/README
@@ -0,0 +1,34 @@
+Update: doesn't work as described. Try "make check" from parent dir...
+* * *
+
+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/i/pc104/initrd/conf/busybox/testsuite/TODO b/i/pc104/initrd/conf/busybox/testsuite/TODO
new file mode 100644
index 0000000..b8957f4
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/TODO
@@ -0,0 +1,26 @@
+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:
+
+Moving to the new format.
+ The old way was "lots of little tests files in a directory", which
+ doesn't interact well with source control systems. The new test
+ format is command.tests files that use testing.sh.
+
+Every busybox applet needs a corresponding applet.tests.
+
+Full SUSv3 test suite.
+ Let's make the Linux Test Project jealous, shall we? Don't just
+ audit programs for standards compliance, _prove_ it with a regression
+ test harness.
+
+ http://www.opengroup.org/onlinepubs/009695399/utilities/
+
+Some tests need root access.
+ It's hard to test things like mount or init as a normal user.
+ Possibly User Mode Linux could be used for this, or perhaps
+ Erik's buildroot.
+
+libbb unit testing
+ Being able to test the functions of libbb individually may
+ help to prevent regressions.
diff --git a/i/pc104/initrd/conf/busybox/testsuite/all_sourcecode.tests b/i/pc104/initrd/conf/busybox/testsuite/all_sourcecode.tests
new file mode 100755
index 0000000..c115878
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/all_sourcecode.tests
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+# Tests for the sourcecode base itself.
+# Copyright 2006 by Mike Frysinger <vapier@gentoo.org>
+# Licensed under GPL v2, see file LICENSE for details.
+
+[ -n "$srcdir" ] || srcdir=$(pwd)
+. testing.sh
+
+
+#
+# if we don't have the sourcecode available, let's just bail
+#
+[ -s "$srcdir/../Makefile" ] || exit 0
+[ -s "$srcdir/../include/applets.h" ] || exit 0
+
+
+#
+# verify the applet order is correct in applets.h, otherwise
+# applets won't be called properly.
+#
+sed -n -e '/^USE_[A-Z]*(APPLET(/{s:.*(::;s:,.*::;s:"::g;p}' \
+ $srcdir/../include/applets.h > applet.order.current
+LC_ALL=C sort applet.order.current > applet.order.correct
+testing "Applet order" "diff -u applet.order.current applet.order.correct" "" "" ""
+rm -f applet.order.current applet.order.correct
+
+
+#
+# check for misc common typos
+#
+find $srcdir/../ \
+ '(' -type d -a '(' -name .svn -o -name testsuite ')' -prune ')' \
+ -o '(' -type f -a -print0 ')' | xargs -0 \
+ grep -I \
+ -e '\<compatability\>' \
+ -e '\<compatable\>' \
+ -e '\<fordeground\>' \
+ -e '\<depency\>' -e '\<dependancy\>' -e '\<dependancies\>' \
+ -e '\<defalt\>' \
+ -e '\<remaing\>' \
+ -e '\<queueing\>' \
+ -e '\<detatch\>' \
+ -e '\<sempahore\>' \
+ -e '\<reprenstative\>' \
+ -e '\<overriden\>' \
+ -e '\<readed\>' \
+ -e '\<formated\>' \
+ -e '\<algorithic\>' \
+ -e '\<deamon\>' \
+ -e '\<derefernce\>' \
+ -e '\<acomadate\>' \
+ | sed -e "s:^$srcdir/\.\./::g" > src.typos
+testing "Common typos" "cat src.typos" "" "" ""
+rm -f src.typos
+
+
+#
+# don't allow obsolete functions
+#
+find $srcdir/.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \
+ grep -E -e '\<(bcmp|bcopy|bzero|getwd|index|mktemp|rindex|utimes)\>[[:space:]]*\(' \
+ | sed -e "s:^$srcdir/\.\./::g" > src.obsolete.funcs
+testing "Obsolete function usage" "cat src.obsolete.funcs" "" "" ""
+rm -f src.obsolete.funcs
+
+
+#
+# don't allow obsolete headers
+#
+find $srcdir/.. '(' -name '*.c' -o -name '*.h' ')' -print0 | xargs -0 \
+ grep -E -e '\<(malloc|memory|sys/(errno|fcntl|signal|stropts|termios|unistd))\.h\>' \
+ | sed -e "s:^$srcdir/\.\./::g" > src.obsolete.headers
+testing "Obsolete headers" "cat src.obsolete.headers" "" "" ""
+rm -f src.obsolete.headers
+
+
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/basename/basename-does-not-remove-identical-extension b/i/pc104/initrd/conf/busybox/testsuite/basename/basename-does-not-remove-identical-extension
new file mode 100644
index 0000000..4448fde
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/basename/basename-does-not-remove-identical-extension
@@ -0,0 +1 @@
+test xfoo = x`busybox basename foo foo`
diff --git a/i/pc104/initrd/conf/busybox/testsuite/basename/basename-works b/i/pc104/initrd/conf/busybox/testsuite/basename/basename-works
new file mode 100644
index 0000000..38907d4
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/basename/basename-works
@@ -0,0 +1,2 @@
+test x$(basename $(pwd)) = x$(busybox basename $(pwd))
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/bunzip2.tests b/i/pc104/initrd/conf/busybox/testsuite/bunzip2.tests
new file mode 100755
index 0000000..2b27dd5
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/bunzip2.tests
@@ -0,0 +1,84 @@
+#!/bin/sh
+
+if test "${0##*/}" = "gunzip.tests"; then
+ unpack=gunzip
+ ext=gz
+elif test "${0##*/}" = "bunzip2.tests"; then
+ unpack=bunzip2
+ ext=bz2
+else
+ echo "WTF? argv0='$0'"
+ exit 1
+fi
+
+bb="busybox "
+
+unset LC_ALL
+unset LC_MESSAGES
+unset LANG
+unset LANGUAGE
+
+hello_gz() {
+ # Gzipped "HELLO\n"
+ #_________________________ vvv vvv vvv vvv - mtime
+ echo -ne "\x1f\x8b\x08\x00\x85\x1d\xef\x45\x02\x03\xf3\x70\xf5\xf1\xf1\xe7"
+ echo -ne "\x02\x00\x6e\xd7\xac\xfd\x06\x00\x00\x00"
+}
+
+hello_bz2() {
+ # Bzipped "HELLO\n"
+ echo -ne "\x42\x5a\x68\x39\x31\x41\x59\x26\x53\x59\x5b\xb8\xe8\xa3\x00\x00"
+ echo -ne "\x01\x44\x00\x00\x10\x02\x44\xa0\x00\x30\xcd\x00\xc3\x46\x29\x97"
+ echo -ne "\x17\x72\x45\x38\x50\x90\x5b\xb8\xe8\xa3"
+}
+
+prep() {
+ rm -f t*
+ hello_$ext >t1.$ext
+ hello_$ext >t2.$ext
+}
+
+check() {
+ eval $2 >t_actual 2>&1
+ if echo -ne "$expected" | cmp - t_actual; then
+ echo "$1: PASS"
+ else
+ echo "$1: FAIL"
+ fi
+}
+
+mkdir testdir 2>/dev/null
+(
+cd testdir || { echo "cannot cd testdir!"; exit 1; }
+
+expected="$unpack: z: No such file or directory
+1
+HELLO
+"
+prep; check "$unpack: doesnt exist" "${bb}$unpack z t1.$ext; echo \$?; cat t1"
+
+
+expected="$unpack: t.zz: unknown suffix - ignored
+1
+HELLO
+"
+prep; >t.zz; check "$unpack: unknown suffix" "${bb}$unpack t.zz t1.$ext; echo \$?; cat t1"
+
+
+# In this case file "t1" exists, and we skip t1.gz and unpack t2.gz
+expected="$unpack: t1: File exists
+1
+HELLO
+"
+prep; >t1; check "$unpack: already exists" "${bb}$unpack t1.$ext t2.$ext; echo \$?; cat t1 t2"
+
+
+# From old testsuite
+expected="HELLO\n0\n"
+prep; check "$unpack: stream unpack" "cat t1.$ext | ${bb}$unpack; echo $?"
+
+expected="ok\n"
+prep; check "$unpack: delete src" "${bb}$unpack t2.$ext; test ! -f t2.$ext && echo ok"
+
+)
+rm -rf testdir
diff --git a/i/pc104/initrd/conf/busybox/testsuite/bunzip2/bunzip2-reads-from-standard-input b/i/pc104/initrd/conf/busybox/testsuite/bunzip2/bunzip2-reads-from-standard-input
new file mode 100644
index 0000000..e212a12
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/bunzip2/bunzip2-removes-compressed-file b/i/pc104/initrd/conf/busybox/testsuite/bunzip2/bunzip2-removes-compressed-file
new file mode 100644
index 0000000..f1d1550
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/bunzip2/bzcat-does-not-remove-compressed-file b/i/pc104/initrd/conf/busybox/testsuite/bunzip2/bzcat-does-not-remove-compressed-file
new file mode 100644
index 0000000..7d4016e
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/busybox.tests b/i/pc104/initrd/conf/busybox/testsuite/busybox.tests
new file mode 100755
index 0000000..26536c6
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/busybox.tests
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# Tests for busybox applet itself.
+# Copyright 2005 by Rob Landley <rob@landley.net>
+# Licensed under GPL v2, see file LICENSE for details.
+
+. testing.sh
+
+HELPDUMP=`busybox`
+
+# We need to test under calling the binary under other names.
+
+
+testing "busybox --help busybox" "busybox --help busybox" "$HELPDUMP\n\n" "" ""
+
+ln -s `which busybox` busybox-suffix
+for i in busybox ./busybox-suffix
+do
+ # The gratuitous "\n"s are due to a shell idiosyncrasy:
+ # environment variables seem to strip trailing whitespace.
+
+ testing "" "$i" "$HELPDUMP\n\n" "" ""
+
+ testing "$i unknown" "$i unknown 2>&1" \
+ "unknown: applet not found\n" "" ""
+
+ testing "$i --help" "$i --help 2>&1" "$HELPDUMP\n\n" "" ""
+
+ optional CAT
+ testing "" "$i cat" "moo" "" "moo"
+ testing "$i --help cat" "$i --help cat 2>&1 | grep prints" \
+ "Concatenates FILE(s) and prints them to stdout.\n" "" ""
+ optional ""
+
+ testing "$i --help unknown" "$i --help unknown 2>&1" \
+ "unknown: applet not found\n" "" ""
+done
+rm busybox-suffix
+
+ln -s `which busybox` unknown
+
+testing "busybox as unknown name" "./unknown 2>&1" \
+ "unknown: applet not found\n" "" ""
+rm unknown
+
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/bzcat.tests b/i/pc104/initrd/conf/busybox/testsuite/bzcat.tests
new file mode 100755
index 0000000..16fa3c2
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/bzcat.tests
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+ext=bz2
+
+bb="busybox "
+
+unset LC_ALL
+unset LC_MESSAGES
+unset LANG
+unset LANGUAGE
+
+hello_gz() {
+ # Gzipped "HELLO\n"
+ #_________________________ vvv vvv vvv vvv - mtime
+ echo -ne "\x1f\x8b\x08\x00\x85\x1d\xef\x45\x02\x03\xf3\x70\xf5\xf1\xf1\xe7"
+ echo -ne "\x02\x00\x6e\xd7\xac\xfd\x06\x00\x00\x00"
+}
+
+hello_bz2() {
+ # Bzipped "HELLO\n"
+ echo -ne "\x42\x5a\x68\x39\x31\x41\x59\x26\x53\x59\x5b\xb8\xe8\xa3\x00\x00"
+ echo -ne "\x01\x44\x00\x00\x10\x02\x44\xa0\x00\x30\xcd\x00\xc3\x46\x29\x97"
+ echo -ne "\x17\x72\x45\x38\x50\x90\x5b\xb8\xe8\xa3"
+}
+
+prep() {
+ rm -f t*
+ hello_$ext >t1.$ext
+ hello_$ext >t2.$ext
+}
+
+check() {
+ eval $2 >t_actual 2>&1
+ if echo -ne "$expected" | cmp - t_actual; then
+ echo "$1: PASS"
+ else
+ echo "$1: FAIL"
+ fi
+}
+
+mkdir testdir 2>/dev/null
+(
+cd testdir || { echo "cannot cd testdir!"; exit 1; }
+
+expected="HELLO\nok\n"
+prep; check "bzcat: dont delete src" "${bb}bzcat t2.bz2; test -f t2.bz2 && echo ok"
+
+)
+rm -rf testdir
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cat/cat-prints-a-file b/i/pc104/initrd/conf/busybox/testsuite/cat/cat-prints-a-file
new file mode 100644
index 0000000..e3f35a8
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/cat/cat-prints-a-file-and-standard-input b/i/pc104/initrd/conf/busybox/testsuite/cat/cat-prints-a-file-and-standard-input
new file mode 100644
index 0000000..bc92318
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/cmp/cmp-detects-difference b/i/pc104/initrd/conf/busybox/testsuite/cmp/cmp-detects-difference
new file mode 100644
index 0000000..b9bb628
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cmp/cmp-detects-difference
@@ -0,0 +1,9 @@
+echo foo >foo
+echo bar >bar
+set +e
+busybox cmp -s foo bar
+if [ $? != 0 ] ; then
+ exit 0;
+fi
+
+exit 1;
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cp/cp-a-files-to-dir b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-a-files-to-dir
new file mode 100644
index 0000000..39f8f81
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-a-files-to-dir
@@ -0,0 +1,14 @@
+echo file number one > file1
+echo file number two > file2
+ln -s file2 link1
+mkdir dir1
+touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3
+mkdir there
+busybox cp -a file1 file2 link1 dir1 there
+test -f there/file1
+test -f there/file2
+test ! -s there/dir1/file3
+test -L there/link1
+test xfile2 = x`readlink there/link1`
+test ! dir1/file3 -ot there/dir1/file3
+test ! dir1/file3 -nt there/dir1/file3
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cp/cp-a-preserves-links b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-a-preserves-links
new file mode 100644
index 0000000..0c0cd96
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-a-preserves-links
@@ -0,0 +1,5 @@
+touch foo
+ln -s foo bar
+busybox cp -a bar baz
+test -L baz
+test xfoo = x`readlink baz`
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cp/cp-copies-empty-file b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-copies-empty-file
new file mode 100644
index 0000000..ad25aa1
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-copies-empty-file
@@ -0,0 +1,3 @@
+touch foo
+busybox cp foo bar
+cmp foo bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cp/cp-copies-large-file b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-copies-large-file
new file mode 100644
index 0000000..c2225c6
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/cp/cp-copies-small-file b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-copies-small-file
new file mode 100644
index 0000000..d52a887
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/cp/cp-d-files-to-dir b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-d-files-to-dir
new file mode 100644
index 0000000..9571a56
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-d-files-to-dir
@@ -0,0 +1,11 @@
+echo file number one > file1
+echo file number two > file2
+touch file3
+ln -s file2 link1
+mkdir there
+busybox cp -d file1 file2 file3 link1 there
+test -f there/file1
+test -f there/file2
+test ! -s there/file3
+test -L there/link1
+test xfile2 = x`readlink there/link1`
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cp/cp-dir-create-dir b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-dir-create-dir
new file mode 100644
index 0000000..a8d7b50
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-dir-create-dir
@@ -0,0 +1,4 @@
+mkdir bar
+touch bar/baz
+busybox cp -R bar foo
+test -f foo/baz
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cp/cp-dir-existing-dir b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-dir-existing-dir
new file mode 100644
index 0000000..4c788ba
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-dir-existing-dir
@@ -0,0 +1,5 @@
+mkdir bar
+touch bar/baz
+mkdir foo
+busybox cp -R bar foo
+test -f foo/bar/baz
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cp/cp-does-not-copy-unreadable-file b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-does-not-copy-unreadable-file
new file mode 100644
index 0000000..ce11bfa
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-does-not-copy-unreadable-file
@@ -0,0 +1,6 @@
+touch foo
+chmod a-r foo
+set +e
+busybox cp foo bar
+set -e
+test ! -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cp/cp-files-to-dir b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-files-to-dir
new file mode 100644
index 0000000..fdb8191
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-files-to-dir
@@ -0,0 +1,11 @@
+echo file number one > file1
+echo file number two > file2
+touch file3
+ln -s file2 link1
+mkdir there
+busybox cp file1 file2 file3 link1 there
+test -f there/file1
+test -f there/file2
+test ! -s there/file3
+test -f there/link1
+cmp there/file2 there/link1
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cp/cp-follows-links b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-follows-links
new file mode 100644
index 0000000..2d9f05e
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/cp/cp-preserves-hard-links b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-preserves-hard-links
new file mode 100644
index 0000000..4de7b85
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/cp/cp-preserves-links b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-preserves-links
new file mode 100644
index 0000000..301dc5f
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-preserves-links
@@ -0,0 +1,5 @@
+touch foo
+ln -s foo bar
+busybox cp -d bar baz
+test -L baz
+test xfoo = x`readlink baz`
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cp/cp-preserves-source-file b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-preserves-source-file
new file mode 100644
index 0000000..f0f5065
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cp/cp-preserves-source-file
@@ -0,0 +1,3 @@
+touch foo
+busybox cp foo bar
+test -f foo
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-character b/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-character
new file mode 100644
index 0000000..d6c5efa
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-character
@@ -0,0 +1 @@
+test $(echo abcd | busybox cut -c 3) = c
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-closed-range b/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-closed-range
new file mode 100644
index 0000000..9680b76
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-closed-range
@@ -0,0 +1 @@
+test $(echo abcd | busybox cut -c 1-2) = ab
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-field b/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-field
new file mode 100644
index 0000000..4c7f440
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-a-field
@@ -0,0 +1 @@
+test $(echo -e "f1\tf2\tf3" | busybox cut -f 2) = f2
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-an-open-range b/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-an-open-range
new file mode 100644
index 0000000..1fbf277
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-an-open-range
@@ -0,0 +1 @@
+test $(echo abcd | busybox cut -c -3) = abc
diff --git a/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-an-unclosed-range b/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-an-unclosed-range
new file mode 100644
index 0000000..a2b0cdb
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/cut/cut-cuts-an-unclosed-range
@@ -0,0 +1 @@
+test $(echo abcd | busybox cut -c 3-) = cd
diff --git a/i/pc104/initrd/conf/busybox/testsuite/date/date-R-works b/i/pc104/initrd/conf/busybox/testsuite/date/date-R-works
new file mode 100644
index 0000000..ec3a067
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/date/date-R-works
@@ -0,0 +1,2 @@
+test x"`date -R`" = x"`busybox date -R`"
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/date/date-format-works b/i/pc104/initrd/conf/busybox/testsuite/date/date-format-works
new file mode 100644
index 0000000..f28d06c
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/date/date-format-works
@@ -0,0 +1 @@
+test x"`date +%d/%m/%y`" = x"`busybox date +%d/%m/%y`"
diff --git a/i/pc104/initrd/conf/busybox/testsuite/date/date-u-works b/i/pc104/initrd/conf/busybox/testsuite/date/date-u-works
new file mode 100644
index 0000000..7d9902a
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/date/date-u-works
@@ -0,0 +1,2 @@
+test x"`date -u`" = x"`busybox date -u`"
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/date/date-works b/i/pc104/initrd/conf/busybox/testsuite/date/date-works
new file mode 100644
index 0000000..2f6dd1e
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/date/date-works
@@ -0,0 +1,2 @@
+test x"`date`" = x"`busybox date`"
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/dd/dd-accepts-if b/i/pc104/initrd/conf/busybox/testsuite/dd/dd-accepts-if
new file mode 100644
index 0000000..03d1af8
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/dd/dd-accepts-of b/i/pc104/initrd/conf/busybox/testsuite/dd/dd-accepts-of
new file mode 100644
index 0000000..84405e6
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/dd/dd-copies-from-standard-input-to-standard-output b/i/pc104/initrd/conf/busybox/testsuite/dd/dd-copies-from-standard-input-to-standard-output
new file mode 100644
index 0000000..d890eb0
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/dd/dd-prints-count-to-standard-error b/i/pc104/initrd/conf/busybox/testsuite/dd/dd-prints-count-to-standard-error
new file mode 100644
index 0000000..2187dc0
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-absolute-path b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-absolute-path
new file mode 100644
index 0000000..ca1a51b
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-absolute-path
@@ -0,0 +1 @@
+test $(busybox dirname /foo/bar/baz) = /foo/bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-empty-path b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-empty-path
new file mode 100644
index 0000000..04134a5
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-empty-path
@@ -0,0 +1 @@
+test $(busybox dirname '') = .
diff --git a/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-multiple-slashes b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-multiple-slashes
new file mode 100644
index 0000000..286f253
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-multiple-slashes
@@ -0,0 +1 @@
+test $(busybox dirname foo/bar///baz) = foo/bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-relative-path b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-relative-path
new file mode 100644
index 0000000..ffe4ab4
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-relative-path
@@ -0,0 +1 @@
+test $(busybox dirname foo/bar/baz) = foo/bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-root b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-root
new file mode 100644
index 0000000..6bd62b8
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-root
@@ -0,0 +1 @@
+test $(busybox dirname /) = /
diff --git a/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-single-component b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-single-component
new file mode 100644
index 0000000..24f9ae1
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-handles-single-component
@@ -0,0 +1 @@
+test $(busybox dirname foo) = .
diff --git a/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-works b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-works
new file mode 100644
index 0000000..f339c8f
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/dirname/dirname-works
@@ -0,0 +1,2 @@
+test x$(dirname $(pwd)) = x$(busybox dirname $(pwd))
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/du/du-h-works b/i/pc104/initrd/conf/busybox/testsuite/du/du-h-works
new file mode 100644
index 0000000..82041ab
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/du/du-h-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+du -h "$d" > logfile.gnu
+busybox du -h "$d" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/du/du-k-works b/i/pc104/initrd/conf/busybox/testsuite/du/du-k-works
new file mode 100644
index 0000000..177a1a2
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/du/du-k-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+du -k "$d" > logfile.gnu
+busybox du -k "$d" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/du/du-l-works b/i/pc104/initrd/conf/busybox/testsuite/du/du-l-works
new file mode 100644
index 0000000..61e9140
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/du/du-l-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+du -l "$d" > logfile.gnu
+busybox du -l "$d" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/du/du-m-works b/i/pc104/initrd/conf/busybox/testsuite/du/du-m-works
new file mode 100644
index 0000000..bc97073
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/du/du-m-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+du -m "$d" > logfile.gnu
+busybox du -m "$d" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/du/du-s-works b/i/pc104/initrd/conf/busybox/testsuite/du/du-s-works
new file mode 100644
index 0000000..f0b3bf0
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/du/du-s-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+du -s "$d" > logfile.gnu
+busybox du -s "$d" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/du/du-works b/i/pc104/initrd/conf/busybox/testsuite/du/du-works
new file mode 100644
index 0000000..47949c6
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/du/du-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+du "$d" > logfile.gnu
+busybox du "$d" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/echo/echo-does-not-print-newline b/i/pc104/initrd/conf/busybox/testsuite/echo/echo-does-not-print-newline
new file mode 100644
index 0000000..2ed03ca
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/echo/echo-does-not-print-newline
@@ -0,0 +1 @@
+test `busybox echo -n word | wc -c` -eq 4
diff --git a/i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-argument b/i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-argument
new file mode 100644
index 0000000..479dac8
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-argument
@@ -0,0 +1 @@
+test xfubar = x`busybox echo fubar`
diff --git a/i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-arguments b/i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-arguments
new file mode 100644
index 0000000..4e4e3b4
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-arguments
@@ -0,0 +1 @@
+test "`busybox echo foo bar`" = "foo bar"
diff --git a/i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-newline b/i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-newline
new file mode 100644
index 0000000..838671e
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/echo/echo-prints-newline
@@ -0,0 +1 @@
+test `busybox echo word | wc -c` -eq 5
diff --git a/i/pc104/initrd/conf/busybox/testsuite/expr/expr-works b/i/pc104/initrd/conf/busybox/testsuite/expr/expr-works
new file mode 100644
index 0000000..af49ac4
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/expr/expr-works
@@ -0,0 +1,59 @@
+# busybox expr
+busybox expr 1 \| 1
+busybox expr 1 \| 0
+busybox expr 0 \| 1
+busybox expr 1 \& 1
+busybox expr 0 \< 1
+busybox expr 1 \> 0
+busybox expr 0 \<= 1
+busybox expr 1 \<= 1
+busybox expr 1 \>= 0
+busybox expr 1 \>= 1
+busybox expr 1 + 2
+busybox expr 2 - 1
+busybox expr 2 \* 3
+busybox expr 12 / 2
+busybox expr 12 % 5
+
+
+set +e
+busybox expr 0 \| 0
+if [ $? != 1 ] ; then
+ exit 1;
+fi;
+
+busybox expr 1 \& 0
+if [ $? != 1 ] ; then
+ exit 1;
+fi;
+
+busybox expr 0 \& 1
+if [ $? != 1 ] ; then
+ exit 1;
+fi;
+
+busybox expr 0 \& 0
+if [ $? != 1 ] ; then
+ exit 1;
+fi;
+
+busybox expr 1 \< 0
+if [ $? != 1 ] ; then
+ exit 1;
+fi;
+
+busybox expr 0 \> 1
+if [ $? != 1 ] ; then
+ exit 1;
+fi;
+
+busybox expr 1 \<= 0
+if [ $? != 1 ] ; then
+ exit 1;
+fi;
+
+busybox expr 0 \>= 1
+if [ $? != 1 ] ; then
+ exit 1;
+fi;
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/false/false-is-silent b/i/pc104/initrd/conf/busybox/testsuite/false/false-is-silent
new file mode 100644
index 0000000..8a9aa0c
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/false/false-is-silent
@@ -0,0 +1 @@
+busybox false 2>&1 | cmp - /dev/null
diff --git a/i/pc104/initrd/conf/busybox/testsuite/false/false-returns-failure b/i/pc104/initrd/conf/busybox/testsuite/false/false-returns-failure
new file mode 100644
index 0000000..1a061f2
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/false/false-returns-failure
@@ -0,0 +1 @@
+! busybox false
diff --git a/i/pc104/initrd/conf/busybox/testsuite/find/find-supports-minus-xdev b/i/pc104/initrd/conf/busybox/testsuite/find/find-supports-minus-xdev
new file mode 100644
index 0000000..4c559a1
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/find/find-supports-minus-xdev
@@ -0,0 +1 @@
+busybox find . -xdev >/dev/null 2>&1
diff --git a/i/pc104/initrd/conf/busybox/testsuite/grep.tests b/i/pc104/initrd/conf/busybox/testsuite/grep.tests
new file mode 100755
index 0000000..ef0de48
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/grep.tests
@@ -0,0 +1,84 @@
+#!/bin/sh
+
+# grep tests.
+# Copyright 2005 by Rob Landley <rob@landley.net>
+# Licensed under GPL v2, see file LICENSE for details.
+
+# AUDIT:
+
+. testing.sh
+
+# testing "test name" "options" "expected result" "file input" "stdin"
+# file input will be file called "input"
+# test can create a file "actual" instead of writing to stdout
+
+# Test exit status
+
+testing "grep (exit with error)" "grep nonexistent 2> /dev/null ; echo \$?" \
+ "1\n" "" ""
+testing "grep (exit success)" "grep grep $0 > /dev/null 2>&1 ; echo \$?" "0\n" \
+ "" ""
+# Test various data sources and destinations
+
+testing "grep (default to stdin)" "grep two" "two\n" "" \
+ "one\ntwo\nthree\nthree\nthree\n"
+testing "grep - (specify stdin)" "grep two -" "two\n" "" \
+ "one\ntwo\nthree\nthree\nthree\n"
+testing "grep input (specify file)" "grep two input" "two\n" \
+ "one\ntwo\nthree\nthree\nthree\n" ""
+
+testing "grep (no newline at EOL)" "grep bug" "bug" "bug" ""
+
+# Note that this assumes actual is empty.
+testing "grep input actual (two files)" "grep two input actual 2> /dev/null" \
+ "input:two\n" "one\ntwo\nthree\nthree\nthree\n" ""
+
+testing "grep - infile (specify stdin and file)" "grep two - input" \
+ "(standard input):two\ninput:two\n" "one\ntwo\nthree\n" \
+ "one\ntwo\ntoo\nthree\nthree\n"
+
+# Check if we see the correct return value if both stdin and non-existing file
+# are given.
+testing "grep - nofile (specify stdin and nonexisting file)" \
+ "grep two - nonexistent 2> /dev/null ; echo \$?" \
+ "(standard input):two\n(standard input):two\n2\n" \
+ "" "one\ntwo\ntwo\nthree\nthree\nthree\n"
+testing "grep -q - nofile (specify stdin and nonexisting file, no match)" \
+ "grep -q nomatch - nonexistent 2> /dev/null ; echo \$?" \
+ "2\n" "" "one\ntwo\ntwo\nthree\nthree\nthree\n"
+# SUSv3: If the -q option is specified, the exit status shall be zero
+# if an input line is selected, even if an error was detected.
+testing "grep -q - nofile (specify stdin and nonexisting file, match)" \
+ "grep -q two - nonexistent ; echo \$?" \
+ "0\n" "" "one\ntwo\ntwo\nthree\nthree\nthree\n"
+
+# Test various command line options
+# -s no error messages
+testing "grep -s nofile (nonexisting file, no match)" \
+ "grep -s nomatch nonexistent ; echo \$?" "2\n" "" ""
+testing "grep -s nofile - (stdin and nonexisting file, match)" \
+ "grep -s domatch nonexistent - ; echo \$?" \
+ "(standard input):domatch\n2\n" "" "nomatch\ndomatch\nend\n"
+
+# This doesn't match GNU behaviour (Binary file input matches)
+# acts like GNU grep -a
+testing "grep handles binary files" "grep foo input" "foo\n" "\0foo\n\n" ""
+# This doesn't match GNU behaviour (Binary file (standard input) matches)
+# acts like GNU grep -a
+testing "grep handles binary stdin" "grep foo" "foo\n" "" "\0foo\n\n"
+
+testing "grep matches NUL" "grep . input > /dev/null 2>&1 ; echo \$?" \
+ "0\n" "\0\n" ""
+
+# -e regex
+testing "grep handles multiple regexps" "grep -e one -e two input ; echo \$?" \
+ "one\ntwo\n0\n" "one\ntwo\n" ""
+
+optional FEATURE_GREP_EGREP_ALIAS
+testing "grep -E supports extended regexps" "grep -E fo+" "foo\n" "" \
+ "b\ar\nfoo\nbaz"
+testing "grep is also egrep" "egrep foo" "foo\n" "" "foo\nbar\n"
+testing "egrep is not case insensitive" \
+ "egrep foo ; [ \$? -ne 0 ] && echo yes" "yes\n" "" "FOO\n"
+
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/gunzip.tests b/i/pc104/initrd/conf/busybox/testsuite/gunzip.tests
new file mode 100755
index 0000000..d781004
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/gunzip.tests
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+. bunzip2.tests
diff --git a/i/pc104/initrd/conf/busybox/testsuite/gunzip/gunzip-reads-from-standard-input b/i/pc104/initrd/conf/busybox/testsuite/gunzip/gunzip-reads-from-standard-input
new file mode 100644
index 0000000..7c498c0
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/gzip/gzip-accepts-multiple-files b/i/pc104/initrd/conf/busybox/testsuite/gzip/gzip-accepts-multiple-files
new file mode 100644
index 0000000..8f0d9c8
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/gzip/gzip-accepts-single-minus b/i/pc104/initrd/conf/busybox/testsuite/gzip/gzip-accepts-single-minus
new file mode 100644
index 0000000..8b51fdf
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/gzip/gzip-accepts-single-minus
@@ -0,0 +1 @@
+echo foo | busybox gzip - >/dev/null
diff --git a/i/pc104/initrd/conf/busybox/testsuite/gzip/gzip-removes-original-file b/i/pc104/initrd/conf/busybox/testsuite/gzip/gzip-removes-original-file
new file mode 100644
index 0000000..b9cb995
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/gzip/gzip-removes-original-file
@@ -0,0 +1,3 @@
+touch foo
+busybox gzip foo
+test ! -f foo
diff --git a/i/pc104/initrd/conf/busybox/testsuite/head/head-n-works b/i/pc104/initrd/conf/busybox/testsuite/head/head-n-works
new file mode 100644
index 0000000..db43255
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/head/head-n-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+head -n 2 "$d/README" > logfile.gnu
+busybox head -n 2 "$d/README" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/head/head-works b/i/pc104/initrd/conf/busybox/testsuite/head/head-works
new file mode 100644
index 0000000..56ad3e3
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/head/head-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+head "$d/README" > logfile.gnu
+busybox head "$d/README" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/hostid/hostid-works b/i/pc104/initrd/conf/busybox/testsuite/hostid/hostid-works
new file mode 100644
index 0000000..e85698e
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/hostid/hostid-works
@@ -0,0 +1,2 @@
+test x$(hostid) = x$(busybox hostid)
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-d-works b/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-d-works
new file mode 100644
index 0000000..a9aeb92
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-d-works
@@ -0,0 +1,2 @@
+test x$(hostname -d) = x$(busybox hostname -d)
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-i-works b/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-i-works
new file mode 100644
index 0000000..68a3e67
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-i-works
@@ -0,0 +1,2 @@
+test x$(hostname -i) = x$(busybox hostname -i)
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-s-works b/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-s-works
new file mode 100644
index 0000000..172b944
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-s-works
@@ -0,0 +1 @@
+test x$(hostname -s) = x$(busybox hostname -s)
diff --git a/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-works b/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-works
new file mode 100644
index 0000000..f51a406
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/hostname/hostname-works
@@ -0,0 +1 @@
+test x$(hostname) = x$(busybox hostname)
diff --git a/i/pc104/initrd/conf/busybox/testsuite/id/id-g-works b/i/pc104/initrd/conf/busybox/testsuite/id/id-g-works
new file mode 100644
index 0000000..671fc53
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/id/id-g-works
@@ -0,0 +1 @@
+test x$(id -g) = x$(busybox id -g)
diff --git a/i/pc104/initrd/conf/busybox/testsuite/id/id-u-works b/i/pc104/initrd/conf/busybox/testsuite/id/id-u-works
new file mode 100644
index 0000000..2358cb0
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/id/id-u-works
@@ -0,0 +1 @@
+test x$(id -u) = x$(busybox id -u)
diff --git a/i/pc104/initrd/conf/busybox/testsuite/id/id-un-works b/i/pc104/initrd/conf/busybox/testsuite/id/id-un-works
new file mode 100644
index 0000000..db390e7
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/id/id-un-works
@@ -0,0 +1 @@
+test x$(id -un) = x$(busybox id -un)
diff --git a/i/pc104/initrd/conf/busybox/testsuite/id/id-ur-works b/i/pc104/initrd/conf/busybox/testsuite/id/id-ur-works
new file mode 100644
index 0000000..6b0fcb0
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/id/id-ur-works
@@ -0,0 +1 @@
+test x$(id -ur) = x$(busybox id -ur)
diff --git a/i/pc104/initrd/conf/busybox/testsuite/ln/ln-creates-hard-links b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-creates-hard-links
new file mode 100644
index 0000000..2f6e23f
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-creates-hard-links
@@ -0,0 +1,4 @@
+echo file number one > file1
+busybox ln file1 link1
+test -f file1
+test -f link1
diff --git a/i/pc104/initrd/conf/busybox/testsuite/ln/ln-creates-soft-links b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-creates-soft-links
new file mode 100644
index 0000000..e875e4c
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-creates-soft-links
@@ -0,0 +1,4 @@
+echo file number one > file1
+busybox ln -s file1 link1
+test -L link1
+test xfile1 = x`readlink link1`
diff --git a/i/pc104/initrd/conf/busybox/testsuite/ln/ln-force-creates-hard-links b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-force-creates-hard-links
new file mode 100644
index 0000000..c96b7d6
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-force-creates-hard-links
@@ -0,0 +1,5 @@
+echo file number one > file1
+echo file number two > link1
+busybox ln -f file1 link1
+test -f file1
+test -f link1
diff --git a/i/pc104/initrd/conf/busybox/testsuite/ln/ln-force-creates-soft-links b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-force-creates-soft-links
new file mode 100644
index 0000000..cab8d1d
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-force-creates-soft-links
@@ -0,0 +1,5 @@
+echo file number one > file1
+echo file number two > link1
+busybox ln -f -s file1 link1
+test -L link1
+test xfile1 = x`readlink link1`
diff --git a/i/pc104/initrd/conf/busybox/testsuite/ln/ln-preserves-hard-links b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-preserves-hard-links
new file mode 100644
index 0000000..47fb989
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-preserves-hard-links
@@ -0,0 +1,8 @@
+echo file number one > file1
+echo file number two > link1
+set +e
+busybox ln file1 link1
+if [ $? != 0 ] ; then
+ exit 0;
+fi
+exit 1;
diff --git a/i/pc104/initrd/conf/busybox/testsuite/ln/ln-preserves-soft-links b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-preserves-soft-links
new file mode 100644
index 0000000..a8123ec
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/ln/ln-preserves-soft-links
@@ -0,0 +1,9 @@
+echo file number one > file1
+echo file number two > link1
+set +e
+busybox ln -s file1 link1
+if [ $? != 0 ] ; then
+ exit 0;
+fi
+exit 1;
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/ls/ls-1-works b/i/pc104/initrd/conf/busybox/testsuite/ls/ls-1-works
new file mode 100644
index 0000000..8ad484f
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/ls/ls-1-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+ls -1 "$d" > logfile.gnu
+busybox ls -1 "$d" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/ls/ls-h-works b/i/pc104/initrd/conf/busybox/testsuite/ls/ls-h-works
new file mode 100644
index 0000000..7331262
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/ls/ls-h-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+ls -h "$d" > logfile.gnu
+busybox ls -h "$d" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/ls/ls-l-works b/i/pc104/initrd/conf/busybox/testsuite/ls/ls-l-works
new file mode 100644
index 0000000..efc2b19
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/ls/ls-l-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+LC_ALL=C ls -l "$d" > logfile.gnu
+busybox ls -l "$d" > logfile.bb
+diff -w logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/ls/ls-s-works b/i/pc104/initrd/conf/busybox/testsuite/ls/ls-s-works
new file mode 100644
index 0000000..6c8bf36
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/ls/ls-s-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+LC_ALL=C ls -1s "$d" > logfile.gnu
+busybox ls -1s "$d" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/md5sum/md5sum-verifies-non-binary-file b/i/pc104/initrd/conf/busybox/testsuite/md5sum/md5sum-verifies-non-binary-file
new file mode 100644
index 0000000..8566a23
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/md5sum/md5sum-verifies-non-binary-file
@@ -0,0 +1,3 @@
+touch foo
+md5sum foo > bar
+busybox md5sum -c bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mkdir/mkdir-makes-a-directory b/i/pc104/initrd/conf/busybox/testsuite/mkdir/mkdir-makes-a-directory
new file mode 100644
index 0000000..6ca5c4d
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mkdir/mkdir-makes-a-directory
@@ -0,0 +1,2 @@
+busybox mkdir foo
+test -d foo
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mkdir/mkdir-makes-parent-directories b/i/pc104/initrd/conf/busybox/testsuite/mkdir/mkdir-makes-parent-directories
new file mode 100644
index 0000000..992facb
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/mount.testroot b/i/pc104/initrd/conf/busybox/testsuite/mount.testroot
new file mode 100755
index 0000000..e18d046
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mount.testroot
@@ -0,0 +1,183 @@
+#!/bin/sh
+
+# SUSv3 compliant mount and umount tests.
+# Copyright 2005 by Rob Landley <rob@landley.net>
+# Licensed under GPL v2, see file LICENSE for details.
+
+if [ -z "$TESTDIR" ]
+then
+ echo 'Need $TESTDIR'
+ exit 1
+fi
+
+cd "$TESTDIR"
+
+. testing.sh
+
+# If we aren't PID 1, barf.
+
+#if [ $$ -ne 1 ]
+#then
+# echo "SKIPPED: mount test requires emulation environment"
+# exit 0
+#fi
+
+# Run tests within the chroot environment.
+dochroot bash rm ls ln cat ps mknod mkdir dd grep cmp diff tail \
+ mkfs.ext2 mkfs.vfat mount umount losetup wc << EOF
+#!/bin/bash
+
+. /testing.sh
+
+mknod /dev/loop0 b 7 0
+mknod /dev/loop1 b 7 1
+
+# We need /proc to do much. Make sure we can mount it explicitly.
+
+testing "mount no proc [GNUFAIL]" "mount 2> /dev/null || echo yes" "yes\n" "" ""
+testing "mount /proc" "mount -t proc /proc /proc && ls -d /proc/1" \
+ "/proc/1\n" "" ""
+
+# Make sure the last thing in the list is /proc
+
+testing "mount list1" "mount | tail -n 1" "/proc on /proc type proc (rw)\n" \
+ "" ""
+
+
+# Create an ext2 image
+
+mkdir -p images/{ext2.dir,vfat.dir,test1,test2,test3}
+dd if=/dev/zero of=images/ext2.img bs=1M count=1 2> /dev/null
+mkfs.ext2 -F -b 1024 images/ext2.img > /dev/null 2> /dev/null
+dd if=/dev/zero of=images/vfat.img bs=1M count=1 2> /dev/null
+mkfs.vfat images/vfat.img > /dev/null
+
+# Test mount it
+
+testing "mount vfat image (explicitly autodetect type)" \
+ "mount -t auto images/vfat.img images/vfat.dir && mount | tail -n 1 | grep -o 'vfat.dir type vfat'" \
+ "vfat.dir type vfat\n" "" ""
+testing "mount ext2 image (autodetect type)" \
+ "mount images/ext2.img images/ext2.dir 2> /dev/null && mount | tail -n 1" \
+ "/dev/loop1 on /images/ext2.dir type ext2 (rw)\n" "" ""
+testing "mount remount ext2 image noatime" \
+ "mount -o remount,noatime images/ext2.dir && mount | tail -n 1" \
+ "/dev/loop1 on /images/ext2.dir type ext2 (rw,noatime)\n" "" ""
+testing "mount remount ext2 image ro remembers noatime" \
+ "mount -o remount,ro images/ext2.dir && mount | tail -n 1" \
+ "/dev/loop1 on /images/ext2.dir type ext2 (ro,noatime)\n" "" ""
+
+umount -d images/vfat.dir
+umount -d images/ext2.dir
+
+testing "mount umount freed loop device" \
+ "mount images/ext2.img images/ext2.dir && mount | tail -n 1" \
+ "/dev/loop0 on /images/ext2.dir type ext2 (rw)\n" "" ""
+
+testing "mount block device" \
+ "mount -t ext2 /dev/loop0 images/test1 && mount | tail -n 1" \
+ "/dev/loop0 on /images/test1 type ext2 (rw)\n" "" ""
+
+umount -d images/ext2.dir images/test1
+
+testing "mount remount nonexistent directory" \
+ "mount -o remount,noatime images/ext2.dir 2> /dev/null || echo yes" \
+ "yes\n" "" ""
+
+# Fun with mount -a
+
+testing "mount -a no fstab" "mount -a 2>/dev/null || echo yes" "yes\n" "" ""
+
+umount /proc
+
+# The first field is space delimited, the rest tabs.
+
+cat > /etc/fstab << FSTAB
+/proc /proc proc defaults 0 0
+# Autodetect loop, and provide flags with commas in them.
+/images/ext2.img /images/ext2.dir ext2 noatime,nodev 0 0
+# autodetect filesystem, flags without commas.
+/images/vfat.img /images/vfat.dir auto ro 0 0
+# A block device
+/dev/loop2 /images/test1 auto defaults 0 0
+# tmpfs, filesystem specific flag.
+walrus /images/test2 tmpfs size=42 0 0
+# Autodetect a bind mount.
+/images/test2 /images/test3 auto defaults 0 0
+FSTAB
+
+# Put something on loop2.
+mknod /dev/loop2 b 7 2
+cat images/ext2.img > images/ext2-2.img
+losetup /dev/loop2 images/ext2-2.img
+
+testing "mount -a" "mount -a && echo hello > /images/test2/abc && cat /images/test3/abc && (mount | wc -l)" "hello\n8\n" "" ""
+
+testing "umount -a" "umount -a && ls /proc" "" "" ""
+
+#/bin/bash < /dev/tty > /dev/tty 2> /dev/tty
+mknod /dev/console c 5 1
+/bin/bash < /dev/console > /dev/console 2> /dev/console
+EOF
+
+exit 0
+
+# Run some tests
+
+losetup nonexistent device (should return error 2)
+losetup unbound loop device (should return error 1)
+losetup bind file to loop device
+losetup bound loop device (display) (should return error 0)
+losetup filename (error)
+losetup nofile (file not found)
+losetup -d
+losetup bind with offset
+losetup -f (print first loop device)
+losetup -f filename (associate file with first loop device)
+losetup -o (past end of file) -f filename
+
+mount -a
+ with multiple entries in fstab
+ with duplicate entries in fstab
+ with relative paths in fstab
+ with user entries in fstab
+mount -o async,sync,atime,noatime,dev,nodev,exec,noexec,loop,suid,nosuid,remount,ro,rw,bind,move
+mount -r
+mount -o rw -r
+mount -w -o ro
+mount -t auto
+
+mount with relative path in fstab
+mount block device
+mount char device
+mount file (autoloop)
+mount directory (autobind)
+
+
+testing "umount with no /proc"
+testing "umount curdir"
+
+# The basic tests. These should work even with the small busybox.
+
+testing "sort" "input" "a\nb\nc\n" "c\na\nb\n" ""
+testing "sort #2" "input" "010\n1\n3\n" "3\n1\n010\n" ""
+testing "sort stdin" "" "a\nb\nc\n" "" "b\na\nc\n"
+testing "sort numeric" "-n input" "1\n3\n010\n" "3\n1\n010\n" ""
+testing "sort reverse" "-r input" "wook\nwalrus\npoint\npabst\naargh\n" \
+ "point\nwook\npabst\naargh\nwalrus\n" ""
+
+optional FEATURE_MOUNT_LOOP
+testing "umount -D"
+
+optional FEATURE_MTAB_SUPPORT
+optional FEATURE_MOUNT_NFS
+# No idea what to test here.
+
+optional UMOUNT
+optional FEATURE_UMOUNT_ALL
+testing "umount -a"
+testing "umount -r"
+testing "umount -l"
+testing "umount -f"
+
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/msh/msh-supports-underscores-in-variable-names b/i/pc104/initrd/conf/busybox/testsuite/msh/msh-supports-underscores-in-variable-names
new file mode 100644
index 0000000..9c7834b
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/mv/mv-files-to-dir b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-files-to-dir
new file mode 100644
index 0000000..c8eaba8
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-files-to-dir
@@ -0,0 +1,16 @@
+echo file number one > file1
+echo file number two > file2
+ln -s file2 link1
+mkdir dir1
+touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3
+mkdir there
+busybox mv file1 file2 link1 dir1 there
+test -f there/file1
+test -f there/file2
+test -f there/dir1/file3
+test -L there/link1
+test xfile2 = x`readlink there/link1`
+test ! -e file1
+test ! -e file2
+test ! -e link1
+test ! -e dir1/file3
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-follows-links b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-follows-links
new file mode 100644
index 0000000..1fb355b
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-follows-links
@@ -0,0 +1,4 @@
+touch foo
+ln -s foo bar
+busybox mv bar baz
+test -f baz
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-empty-file b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-empty-file
new file mode 100644
index 0000000..48afca4
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-empty-file
@@ -0,0 +1,4 @@
+touch foo
+busybox mv foo bar
+test ! -e foo
+test -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-file b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-file
new file mode 100644
index 0000000..edb4c37
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-hardlinks b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-hardlinks
new file mode 100644
index 0000000..eaa8215
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-hardlinks
@@ -0,0 +1,4 @@
+touch foo
+ln foo bar
+busybox mv bar baz
+test ! -f bar -a -f baz
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-large-file b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-large-file
new file mode 100644
index 0000000..77d088f
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-large-file
@@ -0,0 +1,4 @@
+dd if=/dev/zero of=foo seek=10k count=1 2>/dev/null
+busybox mv foo bar
+test ! -e foo
+test -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-small-file b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-small-file
new file mode 100644
index 0000000..065c7f1
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-small-file
@@ -0,0 +1,4 @@
+echo I WANT > foo
+busybox mv foo bar
+test ! -e foo
+test -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-symlinks b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-symlinks
new file mode 100644
index 0000000..c413af0
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-symlinks
@@ -0,0 +1,6 @@
+touch foo
+ln -s foo bar
+busybox mv bar baz
+test -f foo
+test ! -e bar
+test -L baz
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-unreadable-files b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-unreadable-files
new file mode 100644
index 0000000..bc9c313
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-moves-unreadable-files
@@ -0,0 +1,5 @@
+touch foo
+chmod a-r foo
+busybox mv foo bar
+test ! -e foo
+test -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-hard-links b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-hard-links
new file mode 100644
index 0000000..b3ba3aa
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-hard-links
@@ -0,0 +1,6 @@
+# FEATURE: CONFIG_FEATURE_PRESERVE_HARDLINKS
+touch foo
+ln foo bar
+mkdir baz
+busybox mv foo bar baz
+test baz/foo -ef baz/bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-links b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-links
new file mode 100644
index 0000000..ea565d2
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-preserves-links
@@ -0,0 +1,5 @@
+touch foo
+ln -s foo bar
+busybox mv bar baz
+test -L baz
+test xfoo = x`readlink baz`
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-refuses-mv-dir-to-subdir b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-refuses-mv-dir-to-subdir
new file mode 100644
index 0000000..7c572c4
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-refuses-mv-dir-to-subdir
@@ -0,0 +1,23 @@
+echo file number one > file1
+echo file number two > file2
+ln -s file2 link1
+mkdir dir1
+touch --date='Sat Jan 29 21:24:08 PST 2000' dir1/file3
+mkdir there
+busybox mv file1 file2 link1 dir1 there
+test -f there/file1
+test -f there/file2
+test -f there/dir1/file3
+test -L there/link1
+test xfile2 = x`readlink there/link1`
+test ! -e file1
+test ! -e file2
+test ! -e link1
+test ! -e dir1/file3
+set +e
+busybox mv there there/dir1
+if [ $? != 0 ] ; then
+ exit 0;
+fi
+
+exit 1;
diff --git a/i/pc104/initrd/conf/busybox/testsuite/mv/mv-removes-source-file b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-removes-source-file
new file mode 100644
index 0000000..48afca4
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/mv/mv-removes-source-file
@@ -0,0 +1,4 @@
+touch foo
+busybox mv foo bar
+test ! -e foo
+test -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/pidof.tests b/i/pc104/initrd/conf/busybox/testsuite/pidof.tests
new file mode 100755
index 0000000..bfde26e
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/pidof.tests
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# pidof tests.
+# Copyright 2005 by Bernhard Fischer
+# Licensed under GPL v2, see file LICENSE for details.
+
+# AUDIT:
+
+. testing.sh
+
+# testing "test name" "options" "expected result" "file input" "stdin"
+
+testing "pidof (exit with error)" \
+ "pidof veryunlikelyoccuringbinaryname ; echo \$?" "1\n" "" ""
+testing "pidof (exit with success)" "pidof pidof > /dev/null; echo \$?" \
+ "0\n" "" ""
+# We can get away with this because it says #!/bin/sh up top.
+
+testing "pidof this" "pidof pidof.tests | grep -o -w $$" "$$\n" "" ""
+
+optional FEATURE_PIDOF_SINGLE
+testing "pidof -s" "pidof -s init" "1\n" "" ""
+
+optional FEATURE_PIDOF_OMIT
+testing "pidof -o %PPID" "pidof -o %PPID pidof.tests | grep -o -w $$" "" "" ""
+testing "pidof -o %PPID NOP" "pidof -o %PPID -s init" "1\n" "" ""
+testing "pidof -o init" "pidof -o 1 init | grep -o -w 1" "" "" ""
+
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/pwd/pwd-prints-working-directory b/i/pc104/initrd/conf/busybox/testsuite/pwd/pwd-prints-working-directory
new file mode 100644
index 0000000..8575347
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/pwd/pwd-prints-working-directory
@@ -0,0 +1 @@
+test $(pwd) = $(busybox pwd)
diff --git a/i/pc104/initrd/conf/busybox/testsuite/readlink.tests b/i/pc104/initrd/conf/busybox/testsuite/readlink.tests
new file mode 100755
index 0000000..0faa6ed
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/readlink.tests
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# Readlink tests.
+# Copyright 2006 by Natanael Copa <n@tanael.org>
+# Licensed under GPL v2, see file LICENSE for details.
+
+. testing.sh
+
+TESTDIR=readlink_testdir
+TESTFILE="$TESTDIR/testfile"
+TESTLINK="testlink"
+FAILLINK="$TESTDIR/$TESTDIR/testlink"
+
+# create the dir and test files
+mkdir -p "./$TESTDIR"
+touch "./$TESTFILE"
+ln -s "./$TESTFILE" "./$TESTLINK"
+
+testing "readlink on a file" "readlink ./$TESTFILE" "" "" ""
+testing "readlink on a link" "readlink ./$TESTLINK" "./$TESTFILE\n" "" ""
+
+optional FEATURE_READLINK_FOLLOW
+
+testing "readlink -f on a file" "readlink -f ./$TESTFILE" "$PWD/$TESTFILE\n" "" ""
+testing "readlink -f on a link" "readlink -f ./$TESTLINK" "$PWD/$TESTFILE\n" "" ""
+testing "readlink -f on an invalid link" "readlink -f ./$FAILLINK" "" "" ""
+testing "readlink -f on a wierd dir" "readlink -f $TESTDIR/../$TESTFILE" "$PWD/$TESTFILE\n" "" ""
+
+
+# clean up
+rm -r "$TESTLINK" "$TESTDIR"
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/rm/rm-removes-file b/i/pc104/initrd/conf/busybox/testsuite/rm/rm-removes-file
new file mode 100644
index 0000000..46571a9
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/rm/rm-removes-file
@@ -0,0 +1,3 @@
+touch foo
+busybox rm foo
+test ! -f foo
diff --git a/i/pc104/initrd/conf/busybox/testsuite/rmdir/rmdir-removes-parent-directories b/i/pc104/initrd/conf/busybox/testsuite/rmdir/rmdir-removes-parent-directories
new file mode 100644
index 0000000..222f5de
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/runtest b/i/pc104/initrd/conf/busybox/testsuite/runtest
new file mode 100755
index 0000000..279f51f
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/runtest
@@ -0,0 +1,150 @@
+#!/bin/sh
+
+[ -n "$srcdir" ] || srcdir=$(pwd)
+[ -n "$bindir" ] || bindir=$(dirname $(pwd))
+PATH=$bindir:$PATH
+
+# Run old-style test.
+
+run_applet_testcase()
+{
+ local applet=$1
+ local testcase=$2
+
+ local status=0
+ local RES=
+
+ local uc_applet=$(echo $applet | tr a-z A-Z)
+ local testname=$(basename $testcase)
+
+ if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then
+ echo 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$" $bindir/.config; then
+ echo UNTESTED: $testname
+ return 0
+ fi
+ fi
+
+ rm -rf tmp
+ mkdir -p tmp
+ pushd tmp > /dev/null
+
+ d=$srcdir sh -x -e $testcase >.logfile.txt 2>&1 || status=$?
+
+ if [ $status -ne 0 ] ; then
+ echo FAIL: $testname
+ if [ $verbose -gt 0 ]; then
+ cat .logfile.txt
+ fi
+ status=$?
+ else
+ echo PASS: $testname
+ rm -f .logfile.txt
+ status=$?
+ fi
+
+ popd > /dev/null
+ rm -rf tmp
+
+ return $status
+}
+
+run_applet_tests()
+{
+ local applet=$1
+
+ local status=0
+
+ for testcase in $srcdir/$applet/*; do
+ if [ "$testcase" = "$srcdir/$applet/CVS" ]; then
+ continue
+ fi
+
+ if run_applet_testcase $applet $testcase; then
+ :
+ else
+ status=1
+ fi
+ done
+
+ return $status
+}
+
+
+status=0
+verbose=0
+
+if [ x"$1" = x"-v" ]; then
+ verbose=1
+ export VERBOSE=$verbose
+ shift
+fi
+
+if [ $# -ne 0 ]; then
+ applets=$(cd $srcdir ; for i in $@; do ls ${i}* ; done)
+else
+ applets=$(ls $srcdir)
+fi
+
+# Populate a directory with links to all busybox applets
+
+LINKSDIR="$bindir/runtest-tempdir-links"
+implemented=$($bindir/busybox 2>&1 |
+ while read line
+ do
+ if test x"$line" = x"Currently defined functions:"
+ then
+ xargs | sed 's/,//g'
+ break
+ fi
+ done
+ )
+rm -rf "$LINKSDIR" 2>/dev/null
+mkdir "$LINKSDIR"
+for i in $implemented
+do
+ ln -s $bindir/busybox "$LINKSDIR"/$i
+done
+
+# Set up option flags so tests can be selective.
+
+configfile=${bindir:-../../}/.config
+export OPTIONFLAGS=:$(echo $(sed -nr 's/^CONFIG_(.*)=.*/\1/p' $configfile) | sed 's/ /:/g')
+
+for applet in $applets; do
+ if [ "$applet" = "links" ]; then continue; fi
+ if [ "$applet" != "CVS" -a -d "$srcdir/$applet" ]; then
+ if run_applet_tests $applet; then
+ :
+ else
+ status=1
+ fi
+ fi
+
+ # Is this a new-style test?
+ applet=$(echo "$applet" | sed -n 's/\.tests$//p')
+ if [ ${#applet} -ne 0 ]
+ then
+ if [ ! -h "$LINKSDIR/$applet" ] && [ "${applet:0:4}" != "all_" ]
+ then
+ echo "SKIPPED: $applet (not built)"
+ continue
+ fi
+ if PATH="$LINKSDIR":$srcdir:$bindir:$PATH \
+ "${srcdir:-.}/$applet".tests
+ then
+ :
+ else
+ status=1
+ fi
+ fi
+
+done
+rm -rf "$LINKSDIR"
+exit $status
diff --git a/i/pc104/initrd/conf/busybox/testsuite/sed.tests b/i/pc104/initrd/conf/busybox/testsuite/sed.tests
new file mode 100755
index 0000000..a054de6
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/sed.tests
@@ -0,0 +1,203 @@
+#!/bin/sh
+
+# SUSv3 compliant sed tests.
+# Copyright 2005 by Rob Landley <rob@landley.net>
+# Licensed under GPL v2, see file LICENSE for details.
+
+. testing.sh
+
+# testing "description" "arguments" "result" "infile" "stdin"
+
+# Corner cases
+testing "sed no files (stdin)" 'sed ""' "hello\n" "" "hello\n"
+testing "sed explicit stdin" 'sed "" -' "hello\n" "" "hello\n"
+testing "sed handles empty lines" "sed -e 's/\$/@/'" "@\n" "" "\n"
+testing "sed stdin twice" 'sed "" - -' "hello" "" "hello"
+
+# Trailing EOF.
+# Match $, at end of each file or all files?
+
+# -e corner cases
+# without -e
+# multiple -e
+# interact with a
+# -eee arg1 arg2 arg3
+# -f corner cases
+# -e -f -e
+# -n corner cases
+# no newline at EOF?
+# -r corner cases
+# Just make sure it works.
+# -i corner cases:
+# sed -i -
+# permissions
+# -i on a symlink
+# on a directory
+# With $ last-line test
+# Continue with \
+# End of script with trailing \
+
+# command list
+testing "sed accepts blanks before command" "sed -e '1 d'" "" "" ""
+testing "sed accepts newlines in -e" "sed -e 'i\
+1
+a\
+3'" "1\n2\n3\n" "" "2\n"
+testing "sed accepts multiple -e" "sed -e 'i\' -e '1' -e 'a\' -e '3'" \
+ "1\n2\n3\n" "" "2\n"
+
+# substitutions
+testing "sed -n" "sed -n -e s/foo/bar/ -e s/bar/baz/" "" "" "foo\n"
+testing "sed s//p" "sed -e s/foo/bar/p -e s/bar/baz/p" "bar\nbaz\nbaz\n" \
+ "" "foo\n"
+testing "sed -n s//p" "sed -ne s/abc/def/p" "def\n" "" "abc\n"
+testing "sed s//g (exhaustive)" "sed -e 's/[[:space:]]*/,/g'" ",1,2,3,4,5,\n" \
+ "" "12345\n"
+testing "sed s arbitrary delimiter" "sed -e 's woo boing '" "boing\n" "" "woo\n"
+testing "sed s chains" "sed -e s/foo/bar/ -e s/bar/baz/" "baz\n" "" "foo\n"
+testing "sed s chains2" "sed -e s/foo/bar/ -e s/baz/nee/" "bar\n" "" "foo\n"
+testing "sed s [delimiter]" "sed -e 's@[@]@@'" "onetwo" "" "one@two"
+
+# branch
+testing "sed b (branch)" "sed -e 'b one;p;: one'" "foo\n" "" "foo\n"
+testing "sed b (branch with no label jumps to end)" "sed -e 'b;p'" \
+ "foo\n" "" "foo\n"
+
+# test and branch
+testing "sed t (test/branch)" "sed -e 's/a/1/;t one;p;: one;p'" \
+ "1\n1\nb\nb\nb\nc\nc\nc\n" "" "a\nb\nc\n"
+testing "sed t (test/branch clears test bit)" "sed -e 's/a/b/;:loop;t loop'" \
+ "b\nb\nc\n" "" "a\nb\nc\n"
+testing "sed T (!test/branch)" "sed -e 's/a/1/;T notone;p;: notone;p'" \
+ "1\n1\n1\nb\nb\nc\nc\n" "" "a\nb\nc\n"
+
+# Normal sed end-of-script doesn't print "c" because n flushed the pattern
+# space. If n hits EOF, pattern space is empty when script ends.
+# Query: how does this interact with no newline at EOF?
+testing "sed n (flushes pattern space, terminates early)" "sed -e 'n;p'" \
+ "a\nb\nb\nc\n" "" "a\nb\nc\n"
+# N does _not_ flush pattern space, therefore c is still in there @ script end.
+testing "sed N (doesn't flush pattern space when terminating)" "sed -e 'N;p'" \
+ "a\nb\na\nb\nc\n" "" "a\nb\nc\n"
+testing "sed address match newline" 'sed "/b/N;/b\\nc/i woo"' \
+ "a\nwoo\nb\nc\nd\n" "" "a\nb\nc\nd\n"
+
+# Multiple lines in pattern space
+testing "sed N (stops at end of input) and P (prints to first newline only)" \
+ "sed -n 'N;P;p'" "a\na\nb\n" "" "a\nb\nc\n"
+
+# Hold space
+testing "sed G (append hold space to pattern space)" 'sed G' "a\n\nb\n\nc\n\n" \
+ "" "a\nb\nc\n"
+#testing "sed g/G (swap/append hold and patter space)"
+#testing "sed g (swap hold/pattern space)"
+
+testing "sed d ends script iteration" \
+ "sed -e '/ook/d;s/ook/ping/p;i woot'" "" "" "ook\n"
+testing "sed d ends script iteration (2)" \
+ "sed -e '/ook/d;a\' -e 'bang'" "woot\nbang\n" "" "ook\nwoot\n"
+
+# Multiple files, with varying newlines and NUL bytes
+testing "sed embedded NUL" "sed -e 's/woo/bang/'" "\0bang\0woo\0" "" \
+ "\0woo\0woo\0"
+testing "sed embedded NUL g" "sed -e 's/woo/bang/g'" "bang\0bang\0" "" \
+ "woo\0woo\0"
+echo -e "/woo/a he\0llo" > sed.commands
+testing "sed NUL in command" "sed -f sed.commands" "woo\nhe\0llo\n" "" "woo"
+rm sed.commands
+
+# sed has funky behavior with newlines at the end of file. Test lots of
+# corner cases with the optional newline appending behavior.
+
+testing "sed normal newlines" "sed -e 's/woo/bang/' input -" "bang\nbang\n" \
+ "woo\n" "woo\n"
+testing "sed leave off trailing newline" "sed -e 's/woo/bang/' input -" \
+ "bang\nbang" "woo\n" "woo"
+testing "sed autoinsert newline" "sed -e 's/woo/bang/' input -" "bang\nbang" \
+ "woo" "woo"
+testing "sed empty file plus cat" "sed -e 's/nohit//' input -" "one\ntwo" \
+ "" "one\ntwo"
+testing "sed cat plus empty file" "sed -e 's/nohit//' input -" "one\ntwo" \
+ "one\ntwo" ""
+testing "sed append autoinserts newline" "sed -e '/woot/a woo' -" \
+ "woot\nwoo\n" "" "woot"
+testing "sed insert doesn't autoinsert newline" "sed -e '/woot/i woo' -" \
+ "woo\nwoot" "" "woot"
+testing "sed print autoinsert newlines" "sed -e 'p' -" "one\none" "" "one"
+testing "sed print autoinsert newlines two files" "sed -e 'p' input -" \
+ "one\none\ntwo\ntwo" "one" "two"
+testing "sed noprint, no match, no newline" "sed -ne 's/woo/bang/' input" \
+ "" "no\n" ""
+testing "sed selective matches with one nl" "sed -ne 's/woo/bang/p' input -" \
+ "a bang\nc bang\n" "a woo\nb no" "c woo\nd no"
+testing "sed selective matches insert newline" \
+ "sed -ne 's/woo/bang/p' input -" "a bang\nb bang\nd bang" \
+ "a woo\nb woo" "c no\nd woo"
+testing "sed selective matches noinsert newline" \
+ "sed -ne 's/woo/bang/p' input -" "a bang\nb bang" "a woo\nb woo" \
+ "c no\nd no"
+testing "sed clusternewline" \
+ "sed -e '/one/a 111' -e '/two/i 222' -e p input -" \
+ "one\none\n111\n222\ntwo\ntwo" "one" "two"
+testing "sed subst+write" \
+ "sed -e 's/i/z/' -e 'woutputw' input -; echo -n X; cat outputw" \
+ "thzngy\nagaznXthzngy\nagazn" "thingy" "again"
+rm outputw
+testing "sed trailing NUL" \
+ "sed 's/i/z/' input -" \
+ "a\0b\0\nc" "a\0b\0" "c"
+testing "sed escaped newline in command" \
+ "sed 's/a/z\\
+z/' input" \
+ "z\nz" "a" ""
+
+# Test end-of-file matching behavior
+
+testing "sed match EOF" "sed -e '"'$p'"'" "hello\nthere\nthere" "" \
+ "hello\nthere"
+testing "sed match EOF two files" "sed -e '"'$p'"' input -" \
+ "one\ntwo\nthree\nfour\nfour" "one\ntwo" "three\nfour"
+# sed match EOF inline: gnu sed 4.1.5 outputs this:
+#00000000 6f 6e 65 0a 6f 6f 6b 0a 6f 6f 6b 0a 74 77 6f 0a |one.ook.ook.two.|
+#00000010 0a 74 68 72 65 65 0a 6f 6f 6b 0a 6f 6f 6b 0a 66 |.three.ook.ook.f|
+#00000020 6f 75 72 |our|
+# which looks buggy to me.
+echo -ne "three\nfour" > input2
+testing "sed match EOF inline" \
+ "sed -e '"'$i ook'"' -i input input2 && cat input input2" \
+ "one\nook\ntwothree\nook\nfour" "one\ntwo" ""
+rm input2
+
+# Test lie-to-autoconf
+
+testing "sed lie-to-autoconf" "sed --version | grep -o 'GNU sed version '" \
+ "GNU sed version \n" "" ""
+
+# Jump to nonexistent label
+testing "sed nonexistent label" "sed -e 'b walrus' 2> /dev/null || echo yes" \
+ "yes\n" "" ""
+
+testing "sed backref from empty s uses range regex" \
+ "sed -e '/woot/s//eep \0 eep/'" "eep woot eep" "" "woot"
+
+testing "sed backref from empty s uses range regex with newline" \
+ "sed -e '/woot/s//eep \0 eep/'" "eep woot eep\n" "" "woot\n"
+
+# -i with no filename
+
+touch ./- # Detect gnu failure mode here.
+testing "sed -i with no arg [GNUFAIL]" "sed -e '' -i 2> /dev/null || echo yes" \
+ "yes\n" "" ""
+rm ./- # Clean up
+
+testing "sed s/xxx/[/" "sed -e 's/xxx/[/'" "[\n" "" "xxx\n"
+
+# Ponder this a bit more, why "woo not found" from gnu version?
+#testing "sed doesn't substitute in deleted line" \
+# "sed -e '/ook/d;s/ook//;t woo;a bang;'" "bang" "" "ook\n"
+
+# This makes both seds very unhappy. Why?
+#testing "sed -g (exhaustive)" "sed -e 's/[[:space:]]*/,/g'" ",1,2,3,4,5," \
+# "" "12345"
+
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/seq.tests b/i/pc104/initrd/conf/busybox/testsuite/seq.tests
new file mode 100755
index 0000000..ebb44e7
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/seq.tests
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# SUSv3 compliant seq tests.
+# Copyright 2006 by Rob Landley <rob@landley.net>
+# Licensed under GPL v2, see file LICENSE for details.
+
+# AUDIT: Full SUSv3 coverage (except internationalization).
+
+. testing.sh
+
+# testing "test name" "options" "expected result" "file input" "stdin"
+# file input will be file called "input"
+# test can create a file "actual" instead of writing to stdout
+
+# Test exit status
+
+testing "seq (exit with error)" "seq 2> /dev/null || echo yes" "yes\n" "" ""
+testing "seq (exit with error)" "seq 1 2 3 4 2> /dev/null || echo yes" \
+ "yes\n" "" ""
+testing "seq one argument" "seq 3" "1\n2\n3\n" "" ""
+testing "seq two arguments" "seq 5 7" "5\n6\n7\n" "" ""
+testing "seq two arguments reversed" "seq 7 5" "" "" ""
+testing "seq two arguments equal" "seq 3 3" "3\n" "" ""
+testing "seq two arguments equal, arbitrary negative step" "seq 1 -15 1" \
+ "1\n" "" ""
+testing "seq two arguments equal, arbitrary positive step" "seq 1 +15 1" \
+ "1\n" "" ""
+testing "seq count up by 2" "seq 4 2 8" "4\n6\n8\n" "" ""
+testing "seq count down by 2" "seq 8 -2 4" "8\n6\n4\n" "" ""
+testing "seq count wrong way #1" "seq 4 -2 8" "" "" ""
+testing "seq count wrong way #2" "seq 8 2 4" "" "" ""
+testing "seq count by .3" "seq 3 .3 4" "3\n3.3\n3.6\n3.9\n" "" ""
+testing "seq count by -.9" "seq .7 -.9 -2.2" "0.7\n-0.2\n-1.1\n-2\n" "" ""
+testing "seq count by zero" "seq 4 0 8 | head -n 10" "" "" ""
+
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/sort.tests b/i/pc104/initrd/conf/busybox/testsuite/sort.tests
new file mode 100755
index 0000000..1db7870
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/sort.tests
@@ -0,0 +1,113 @@
+#!/bin/bash
+
+# SUSv3 compliant sort tests.
+# Copyright 2005 by Rob Landley <rob@landley.net>
+# Licensed under GPL v2, see file LICENSE for details.
+
+. testing.sh
+
+# The basic tests. These should work even with the small busybox.
+
+testing "sort" "sort input" "a\nb\nc\n" "c\na\nb\n" ""
+testing "sort #2" "sort input" "010\n1\n3\n" "3\n1\n010\n" ""
+testing "sort stdin" "sort" "a\nb\nc\n" "" "b\na\nc\n"
+testing "sort numeric" "sort -n input" "1\n3\n010\n" "3\n1\n010\n" ""
+testing "sort reverse" "sort -r input" "wook\nwalrus\npoint\npabst\naargh\n" \
+ "point\nwook\npabst\naargh\nwalrus\n" ""
+
+# These tests require the full option set.
+
+optional FEATURE_SORT_BIG
+# Longish chunk of data re-used by the next few tests
+
+data="42 1 3 woot
+42 1 010 zoology
+egg 1 2 papyrus
+7 3 42 soup
+999 3 0 algebra
+"
+
+# Sorting with keys
+
+testing "sort one key" "sort -k4,4 input" \
+"999 3 0 algebra
+egg 1 2 papyrus
+7 3 42 soup
+42 1 3 woot
+42 1 010 zoology
+" "$data" ""
+
+testing "sort key range with numeric option" "sort -k2,3n input" \
+"42 1 010 zoology
+42 1 3 woot
+egg 1 2 papyrus
+7 3 42 soup
+999 3 0 algebra
+" "$data" ""
+
+# Busybox is definitely doing this one wrong just now. FIXME
+
+testing "sort key range with numeric option and global reverse" \
+"sort -k2,3n -r input" \
+"egg 1 2 papyrus
+42 1 3 woot
+42 1 010 zoology
+999 3 0 algebra
+7 3 42 soup
+" "$data" ""
+
+#
+
+testing "sort key range with multiple options" "sort -k2,3rn input" \
+"7 3 42 soup
+999 3 0 algebra
+42 1 010 zoology
+42 1 3 woot
+egg 1 2 papyrus
+" "$data" ""
+
+testing "sort key range with two -k options" "sort -k 2,2n -k 1,1r input" "\
+d 2
+b 2
+c 3
+" "\
+c 3
+b 2
+d 2
+" ""
+
+testing "sort with non-default leading delim 1" "sort -n -k2 -t/ input" "\
+/a/2
+/b/1
+" "\
+/a/2
+/b/1
+" ""
+
+testing "sort with non-default leading delim 2" "sort -n -k3 -t/ input" "\
+/b/1
+/a/2
+" "\
+/b/1
+/a/2
+" ""
+
+testing "sort with non-default leading delim 3" "sort -n -k3 -t/ input" "\
+//a/2
+//b/1
+" "\
+//a/2
+//b/1
+" ""
+
+testing "sort -u should consider field only when discarding" "sort -u -k2 input" "\
+a c
+" "\
+a c
+b c
+" ""
+
+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"
+
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/strings/strings-works-like-GNU b/i/pc104/initrd/conf/busybox/testsuite/strings/strings-works-like-GNU
new file mode 100644
index 0000000..2d64710
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/strings/strings-works-like-GNU
@@ -0,0 +1,9 @@
+rm -f foo bar
+strings -af ../../busybox > foo
+busybox strings -af ../../busybox > bar
+set +e
+test ! -f foo -a -f bar
+if [ $? = 0 ] ; then
+ set -e
+ diff -q foo bar
+fi
diff --git a/i/pc104/initrd/conf/busybox/testsuite/sum.tests b/i/pc104/initrd/conf/busybox/testsuite/sum.tests
new file mode 100755
index 0000000..0993f03
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/sum.tests
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# unit test for sum.
+# Copyright 2007 by Bernhard Fischer
+# Licensed under GPL v2 or later, see file LICENSE for details.
+
+# AUDIT: Unit tests for sum
+
+. testing.sh
+
+# testing "test name" "options" "expected result" "file input" "stdin"
+# file input will be file called "input"
+# test can create a file "actual" instead of writing to stdout
+
+testing "sum -r file doesn't print file's name" \
+ "sum -r $0 | grep -c $0 && echo wrongly_printed_filename || echo yes" \
+ "0\nyes\n" "" ""
+testing "sum -r file file does print both names" \
+ "sum -r $0 $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \
+ "2\nyes\n" "" ""
+testing "sum -s file does print file's name" \
+ "sum -s $0 | grep -c $0 && echo yes || echo wrongly_omitted_filename" \
+ "1\nyes\n" "" ""
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tail/tail-n-works b/i/pc104/initrd/conf/busybox/testsuite/tail/tail-n-works
new file mode 100644
index 0000000..27a905f
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tail/tail-n-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+tail -n 2 "$d/README" > logfile.gnu
+busybox tail -n 2 "$d/README" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tail/tail-works b/i/pc104/initrd/conf/busybox/testsuite/tail/tail-works
new file mode 100644
index 0000000..27a905f
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tail/tail-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+tail -n 2 "$d/README" > logfile.gnu
+busybox tail -n 2 "$d/README" > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tar/tar-archives-multiple-files b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-archives-multiple-files
new file mode 100644
index 0000000..245d9e9
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/tar/tar-complains-about-missing-file b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-complains-about-missing-file
new file mode 100644
index 0000000..26e8cbb
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-complains-about-missing-file
@@ -0,0 +1,3 @@
+touch foo
+tar cf foo.tar foo
+! busybox tar xf foo.tar bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tar/tar-demands-at-least-one-ctx b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-demands-at-least-one-ctx
new file mode 100644
index 0000000..85e7f60
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-demands-at-least-one-ctx
@@ -0,0 +1 @@
+! busybox tar v
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tar/tar-demands-at-most-one-ctx b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-demands-at-most-one-ctx
new file mode 100644
index 0000000..130d0e7
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-demands-at-most-one-ctx
@@ -0,0 +1 @@
+! busybox tar tx
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-all-subdirs b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-all-subdirs
new file mode 100644
index 0000000..886c37c
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-all-subdirs
@@ -0,0 +1,12 @@
+# FEATURE: CONFIG_FEATURE_TAR_CREATE
+mkdir -p foo/{1,2,3}
+mkdir -p foo/1/{10,11}
+mkdir -p foo/1/10/{100,101,102}
+tar cf foo.tar -C foo .
+rm -rf foo/*
+busybox tar xf foo.tar -C foo ./1/10
+find foo | sort >logfile.bb
+rm -rf foo/*
+tar xf foo.tar -C foo ./1/10
+find foo | sort >logfile.gnu
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-file b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-file
new file mode 100644
index 0000000..ca72f24
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-from-standard-input b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-from-standard-input
new file mode 100644
index 0000000..a30e9f0
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-multiple-files b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-multiple-files
new file mode 100644
index 0000000..8ae8cdd
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-multiple-files
@@ -0,0 +1,6 @@
+touch foo bar
+busybox tar cf foo.tar foo bar
+rm foo bar
+busybox tar -xf foo.tar
+test -f foo
+test -f bar
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-to-standard-output b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-extracts-to-standard-output
new file mode 100644
index 0000000..ca48e36
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-cz-options b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-cz-options
new file mode 100644
index 0000000..5b55e46
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-cz-options
@@ -0,0 +1,5 @@
+# FEATURE: CONFIG_FEATURE_TAR_CREATE
+# FEATURE: CONFIG_FEATURE_TAR_GZIP
+touch foo
+busybox tar czf foo.tar.gz foo
+gzip -d foo.tar.gz
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-empty-include-and-non-empty-exclude-list b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-empty-include-and-non-empty-exclude-list
new file mode 100644
index 0000000..5033642
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-empty-include-and-non-empty-exclude-list
@@ -0,0 +1,6 @@
+# FEATURE: CONFIG_FEATURE_TAR_FROM
+# FEATURE: CONFIG_FEATURE_TAR_CREATE
+touch foo
+tar cf foo.tar foo
+echo foo >foo.exclude
+busybox tar xf foo.tar -X foo.exclude
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-exclude-and-extract-lists b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-exclude-and-extract-lists
new file mode 100644
index 0000000..2de0f0e
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-exclude-and-extract-lists
@@ -0,0 +1,8 @@
+# FEATURE: CONFIG_FEATURE_TAR_FROM
+# FEATURE: CONFIG_FEATURE_TAR_CREATE
+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/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-multiple-X-options b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-multiple-X-options
new file mode 100644
index 0000000..155b27e
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-multiple-X-options
@@ -0,0 +1,10 @@
+# FEATURE: CONFIG_FEATURE_TAR_FROM
+# FEATURE: CONFIG_FEATURE_TAR_CREATE
+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/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-nested-exclude b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-nested-exclude
new file mode 100644
index 0000000..39013a1
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tar/tar-handles-nested-exclude
@@ -0,0 +1,9 @@
+# FEATURE: CONFIG_FEATURE_TAR_FROM
+# FEATURE: CONFIG_FEATURE_TAR_CREATE
+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/i/pc104/initrd/conf/busybox/testsuite/taskset.tests b/i/pc104/initrd/conf/busybox/testsuite/taskset.tests
new file mode 100755
index 0000000..6001c3e
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/taskset.tests
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Copyright 2006 Bernhard Fischer
+# Licensed under GPL v2 or later, see file LICENSE for details.
+
+. testing.sh
+a="taskset"
+
+# testing "test name" "opts" "expected result" "file inp" "stdin"
+testing "taskset (get from pid 1)" "$a -p1 >/dev/null;echo \$?" "0\n" "" ""
+testing "taskset (invalid pid)" "$a -p0 >/dev/null 2>&1;echo \$?" "1\n" "" ""
+testing "taskset (set_aff, needs CAP_SYS_NICE)" \
+ "$a 0x1 $SHELL -c $a\ -p\ \$$\|grep\ \"current\ affinity\ mask:\ 1\" >/dev/null;echo \$?" \
+ "0\n" "" ""
+
+unset a
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tee/tee-appends-input b/i/pc104/initrd/conf/busybox/testsuite/tee/tee-appends-input
new file mode 100644
index 0000000..cff20bf
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/tee/tee-tees-input b/i/pc104/initrd/conf/busybox/testsuite/tee/tee-tees-input
new file mode 100644
index 0000000..26e2173
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/testing.sh b/i/pc104/initrd/conf/busybox/testsuite/testing.sh
new file mode 100755
index 0000000..e253e1a
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/testing.sh
@@ -0,0 +1,154 @@
+# Simple test harness infrastructurei for BusyBox
+#
+# Copyright 2005 by Rob Landley
+#
+# License is GPLv2, see LICENSE in the busybox tarball for full license text.
+
+# This file defines two functions, "testing" and "optionflag"
+
+# The following environment variables may be set to enable optional behavior
+# in "testing":
+# VERBOSE - Print the diff -u of each failed test case.
+# DEBUG - Enable command tracing.
+# SKIP - do not perform this test (this is set by "optionflag")
+#
+# The "testing" function takes five arguments:
+# $1) Description to display when running command
+# $2) Command line arguments to command
+# $3) Expected result (on stdout)
+# $4) Data written to file "input"
+# $5) Data written to stdin
+#
+# The exit value of testing is the exit value of the command it ran.
+#
+# The environment variable "FAILCOUNT" contains a cumulative total of the
+# number of failed tests.
+
+# The "optional" function is used to skip certain tests, ala:
+# optionflag CONFIG_FEATURE_THINGY
+#
+# The "optional" function checks the environment variable "OPTIONFLAGS",
+# which is either empty (in which case it always clears SKIP) or
+# else contains a colon-separated list of features (in which case the function
+# clears SKIP if the flag was found, or sets it to 1 if the flag was not found).
+
+export FAILCOUNT=0
+export SKIP=
+
+# Helper functions
+
+optional()
+{
+ option=`echo "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"`
+ # Not set?
+ if [ -z "$1" ] || [ -z "$OPTIONFLAGS" ] || [ ${#option} -ne 0 ]
+ then
+ SKIP=""
+ return
+ fi
+ SKIP=1
+}
+
+# The testing function
+
+testing ()
+{
+ NAME="$1"
+ [ -z "$1" ] && NAME=$2
+
+ if [ $# -ne 5 ]
+ then
+ echo "Test $NAME has the wrong number of arguments ($# $*)" >&2
+ exit
+ fi
+
+ [ -n "$DEBUG" ] && set -x
+
+ if [ -n "$SKIP" ]
+ then
+ echo "SKIPPED: $NAME"
+ return 0
+ fi
+
+ echo -ne "$3" > expected
+ echo -ne "$4" > input
+ [ -z "$VERBOSE" ] || echo "echo '$5' | $2"
+ echo -ne "$5" | eval "$2" > actual
+ RETVAL=$?
+
+ cmp expected actual > /dev/null
+ if [ $? -ne 0 ]
+ then
+ FAILCOUNT=$[$FAILCOUNT+1]
+ echo "FAIL: $NAME"
+ [ -n "$VERBOSE" ] && diff -u expected actual
+ else
+ echo "PASS: $NAME"
+ fi
+ rm -f input expected actual
+
+ [ -n "$DEBUG" ] && set +x
+
+ return $RETVAL
+}
+
+# Recursively grab an executable and all the libraries needed to run it.
+# Source paths beginning with / will be copied into destpath, otherwise
+# the file is assumed to already be there and only its library dependencies
+# are copied.
+
+function mkchroot
+{
+ [ $# -lt 2 ] && return
+
+ echo -n .
+
+ dest=$1
+ shift
+ for i in "$@"
+ do
+ [ "${i:0:1}" == "/" ] || i=$(which $i)
+ [ -f "$dest/$i" ] && continue
+ if [ -e "$i" ]
+ then
+ d=`echo "$i" | grep -o '.*/'` &&
+ mkdir -p "$dest/$d" &&
+ cat "$i" > "$dest/$i" &&
+ chmod +x "$dest/$i"
+ else
+ echo "Not found: $i"
+ fi
+ mkchroot "$dest" $(ldd "$i" | egrep -o '/.* ')
+ done
+}
+
+# Set up a chroot environment and run commands within it.
+# Needed commands listed on command line
+# Script fed to stdin.
+
+function dochroot
+{
+ mkdir tmpdir4chroot
+ mount -t ramfs tmpdir4chroot tmpdir4chroot
+ mkdir -p tmpdir4chroot/{etc,sys,proc,tmp,dev}
+ cp -L testing.sh tmpdir4chroot
+
+ # Copy utilities from command line arguments
+
+ echo -n "Setup chroot"
+ mkchroot tmpdir4chroot $*
+ echo
+
+ mknod tmpdir4chroot/dev/tty c 5 0
+ mknod tmpdir4chroot/dev/null c 1 3
+ mknod tmpdir4chroot/dev/zero c 1 5
+
+ # Copy script from stdin
+
+ cat > tmpdir4chroot/test.sh
+ chmod +x tmpdir4chroot/test.sh
+ chroot tmpdir4chroot /test.sh
+ umount -l tmpdir4chroot
+ rmdir tmpdir4chroot
+}
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/touch/touch-creates-file b/i/pc104/initrd/conf/busybox/testsuite/touch/touch-creates-file
new file mode 100644
index 0000000..4b49354
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/touch/touch-creates-file
@@ -0,0 +1,2 @@
+busybox touch foo
+test -f foo
diff --git a/i/pc104/initrd/conf/busybox/testsuite/touch/touch-does-not-create-file b/i/pc104/initrd/conf/busybox/testsuite/touch/touch-does-not-create-file
new file mode 100644
index 0000000..8852592
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/touch/touch-does-not-create-file
@@ -0,0 +1,2 @@
+busybox touch -c foo
+test ! -f foo
diff --git a/i/pc104/initrd/conf/busybox/testsuite/touch/touch-touches-files-after-non-existent-file b/i/pc104/initrd/conf/busybox/testsuite/touch/touch-touches-files-after-non-existent-file
new file mode 100644
index 0000000..a869ec2
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/tr/tr-d-works b/i/pc104/initrd/conf/busybox/testsuite/tr/tr-d-works
new file mode 100644
index 0000000..d939e8b
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tr/tr-d-works
@@ -0,0 +1,4 @@
+echo testing | tr -d aeiou > logfile.gnu
+echo testing | busybox tr -d aeiou > logfile.bb
+
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tr/tr-non-gnu b/i/pc104/initrd/conf/busybox/testsuite/tr/tr-non-gnu
new file mode 100644
index 0000000..ffa6951
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tr/tr-non-gnu
@@ -0,0 +1 @@
+echo fdhrnzvfu bffvsentr | busybox tr '[a-z]' '[n-z][a-m]'
diff --git a/i/pc104/initrd/conf/busybox/testsuite/tr/tr-works b/i/pc104/initrd/conf/busybox/testsuite/tr/tr-works
new file mode 100644
index 0000000..9b2e90e
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/tr/tr-works
@@ -0,0 +1,24 @@
+run_tr ()
+{
+ echo -n "echo '$1' | tr '$2' '$3': "
+ echo "$1" | $bb tr "$2" "$3"
+ echo
+}
+tr_test ()
+{
+ run_tr "cbaab" abc zyx
+ run_tr "TESTING A B C" '[A-Z]' '[a-z]'
+ run_tr "abc[]" "a[b" AXB
+ run_tr abc '[:alpha:]' A-ZA-Z
+ run_tr abc56 '[:alnum:]' A-ZA-Zxxxxxxxxxx
+ run_tr 012 '[:digit:]' abcdefghi
+ run_tr abc56 '[:lower:]' '[:upper:]'
+ run_tr " " '[:space:]' 12345
+ run_tr " " '[:blank:]' 12
+ run_tr 'a b' '[= =]' X
+ run_tr "[:" '[:' ab
+}
+
+bb= tr_test > logfile.gnu
+bb=busybox tr_test > logfile.bb
+cmp logfile.gnu logfile.bb
diff --git a/i/pc104/initrd/conf/busybox/testsuite/true/true-is-silent b/i/pc104/initrd/conf/busybox/testsuite/true/true-is-silent
new file mode 100644
index 0000000..1d1bdb2
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/true/true-is-silent
@@ -0,0 +1 @@
+busybox true 2>&1 | cmp - /dev/null
diff --git a/i/pc104/initrd/conf/busybox/testsuite/true/true-returns-success b/i/pc104/initrd/conf/busybox/testsuite/true/true-returns-success
new file mode 100644
index 0000000..cdf2d55
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/true/true-returns-success
@@ -0,0 +1 @@
+busybox true
diff --git a/i/pc104/initrd/conf/busybox/testsuite/umlwrapper.sh b/i/pc104/initrd/conf/busybox/testsuite/umlwrapper.sh
new file mode 100755
index 0000000..e55e4db
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/umlwrapper.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Wrapper for User Mode Linux emulation environment
+
+RUNFILE="$(pwd)/${1}.testroot"
+if [ -z "$RUNFILE" ] || [ ! -x "$RUNFILE" ]
+then
+ echo "Can't run '$RUNFILE'"
+ exit 1
+fi
+
+shift
+
+if [ -z $(which linux) ]
+then
+ echo "No User Mode Linux."
+ exit 1;
+fi
+
+linux rootfstype=hostfs rw init="$RUNFILE" TESTDIR=`pwd` PATH="$PATH" $* quiet
diff --git a/i/pc104/initrd/conf/busybox/testsuite/uniq.tests b/i/pc104/initrd/conf/busybox/testsuite/uniq.tests
new file mode 100755
index 0000000..49d4bed
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/uniq.tests
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# SUSv3 compliant uniq tests.
+# Copyright 2005 by Rob Landley <rob@landley.net>
+# Licensed under GPL v2, see file LICENSE for details.
+
+# AUDIT: Full SUSv3 coverage (except internationalization).
+
+. testing.sh
+
+# testing "test name" "options" "expected result" "file input" "stdin"
+# file input will be file called "input"
+# test can create a file "actual" instead of writing to stdout
+
+# Test exit status
+
+testing "uniq (exit with error)" "uniq nonexistent 2> /dev/null || echo yes" \
+ "yes\n" "" ""
+testing "uniq (exit success)" "uniq /dev/null && echo yes" "yes\n" "" ""
+
+# Test various data sources and destinations
+
+testing "uniq (default to stdin)" "uniq" "one\ntwo\nthree\n" "" \
+ "one\ntwo\ntwo\nthree\nthree\nthree\n"
+testing "uniq - (specify stdin)" "uniq -" "one\ntwo\nthree\n" "" \
+ "one\ntwo\ntwo\nthree\nthree\nthree\n"
+testing "uniq input (specify file)" "uniq input" "one\ntwo\nthree\n" \
+ "one\ntwo\ntwo\nthree\nthree\nthree\n" ""
+
+testing "uniq input outfile (two files)" "uniq input actual > /dev/null" \
+ "one\ntwo\nthree\n" "one\ntwo\ntwo\nthree\nthree\nthree\n" ""
+testing "uniq (stdin) outfile" "uniq - actual" \
+ "one\ntwo\nthree\n" "" "one\ntwo\ntwo\nthree\nthree\nthree\n"
+# Note: SUSv3 doesn't seem to require support for "-" output, but we do anyway.
+testing "uniq input - (specify stdout)" "uniq input -" \
+ "one\ntwo\nthree\n" "one\ntwo\ntwo\nthree\nthree\nthree\n" ""
+
+
+#-f skip fields
+#-s skip chars
+#-c occurrences
+#-d dups only
+#-u
+
+# Test various command line options
+
+# Leading whitespace is a minor technical violation of the spec,
+# but since gnu does it...
+testing "uniq -c (occurrence count)" "uniq -c | sed 's/^[ \t]*//'" \
+ "1 one\n2 two\n3 three\n" "" \
+ "one\ntwo\ntwo\nthree\nthree\nthree\n"
+testing "uniq -d (dups only) " "uniq -d" "two\nthree\n" "" \
+ "one\ntwo\ntwo\nthree\nthree\nthree\n"
+
+testing "uniq -f -s (skip fields and chars)" "uniq -f2 -s 3" \
+"cc dd ee8
+aa bb cc9
+" "" \
+"cc dd ee8
+bb cc dd8
+aa bb cc9
+"
+
+# -d is "Suppress the writing fo lines that are not repeated in the input."
+# -u is "Suppress the writing of lines that are repeated in the input."
+# Therefore, together this means they should produce no output.
+testing "uniq -u and -d produce no output" "uniq -d -u" "" "" \
+ "one\ntwo\ntwo\nthree\nthree\nthree\n"
+
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/unzip.tests b/i/pc104/initrd/conf/busybox/testsuite/unzip.tests
new file mode 100755
index 0000000..7781488
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/unzip.tests
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# Tests for unzip.
+# Copyright 2006 Rob Landley <rob@landley.net>
+# Copyright 2006 Glenn McGrath <bug1@ihug.co.nz>
+# Licensed under GPL v2, see file LICENSE for details.
+
+. testing.sh
+
+# testing "test name" "options" "expected result" "file input" "stdin"
+# file input will be file called "input"
+# test can create a file "actual" instead of writing to stdout
+
+# Create a scratch directory
+
+mkdir temp
+cd temp
+
+# Create test file to work with.
+
+mkdir foo
+touch foo/bar
+zip foo.zip foo foo/bar > /dev/null
+rm -f foo/bar
+rmdir foo
+
+# Test that unzipping just foo doesn't create bar.
+testing "unzip (subdir only)" "unzip -q foo.zip foo/ && test -d foo && test ! -f foo/bar && echo yes" "yes\n" "" ""
+
+rmdir foo
+rm foo.zip
+
+# Clean up scratch directory.
+
+cd ..
+rm -rf temp
+
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/uptime/uptime-works b/i/pc104/initrd/conf/busybox/testsuite/uptime/uptime-works
new file mode 100644
index 0000000..80e5787
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/uptime/uptime-works
@@ -0,0 +1,2 @@
+busybox uptime
+
diff --git a/i/pc104/initrd/conf/busybox/testsuite/uuencode.tests b/i/pc104/initrd/conf/busybox/testsuite/uuencode.tests
new file mode 100755
index 0000000..cb658db
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/uuencode.tests
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# unit test for uuencode to test functionality.
+# Copyright 2006 by Erik Hovland <erik@hovland.org>
+# Licensed under GPL v2, see file LICENSE for details.
+
+# AUDIT: Unit tests for uuencode
+
+. testing.sh
+
+# testing "test name" "options" "expected result" "file input" "stdin"
+# file input will be file called "input"
+# test can create a file "actual" instead of writing to stdout
+
+# Test setup of standard input
+saved_umask=$(umask)
+umask 0
+testing "uuencode sets standard input mode correctly" \
+ "uuencode foo </dev/null | head -n 1 | grep -q 666 && echo yes" "yes\n" "" ""
+umask $saved_umask
+
+testing "uuencode correct encoding" "uuencode bb_uuenc_test.out" \
+"begin 644 bb_uuenc_test.out\nM5&AE(&9A<W0@9W)E>2!F;W@@:G5M<&5D(&]V97(@=&AE(&QA>GD@8G)O=VX@\n%9&]G+@H\`\n\`\nend\n" \
+ "" "The fast grey fox jumped over the lazy brown dog.\n"
+testing "uuencode correct base64 encoding" "uuencode -m bb_uuenc_test.out" \
+"begin-base64 644 bb_uuenc_test.out\nVGhlIGZhc3QgZ3JleSBmb3gganVtcGVkIG92ZXIgdGhlIGxhenkgYnJvd24g\nZG9nLgo=\n====\n" \
+ "" "The fast grey fox jumped over the lazy brown dog.\n"
+exit $FAILCOUNT
diff --git a/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-all b/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-all
new file mode 100644
index 0000000..7083645
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-all
@@ -0,0 +1,2 @@
+# 1 line, 4 words, 20 chars.
+test "`echo i\'m a little teapot | busybox wc | sed 's/ */ /g' | sed 's/^ //'`" = '1 4 20'
diff --git a/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-characters b/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-characters
new file mode 100644
index 0000000..7558646
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-characters
@@ -0,0 +1 @@
+test `echo i\'m a little teapot | busybox wc -c` -eq 20
diff --git a/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-lines b/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-lines
new file mode 100644
index 0000000..5be6ed0
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-lines
@@ -0,0 +1 @@
+test `echo i\'m a little teapot | busybox wc -l` -eq 1
diff --git a/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-words b/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-words
new file mode 100644
index 0000000..331650e
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/wc/wc-counts-words
@@ -0,0 +1 @@
+test `echo i\'m a little teapot | busybox wc -w` -eq 4
diff --git a/i/pc104/initrd/conf/busybox/testsuite/wc/wc-prints-longest-line-length b/i/pc104/initrd/conf/busybox/testsuite/wc/wc-prints-longest-line-length
new file mode 100644
index 0000000..78831fc
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/wget/wget--O-overrides--P b/i/pc104/initrd/conf/busybox/testsuite/wget/wget--O-overrides--P
new file mode 100644
index 0000000..fdb5d47
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/wget/wget-handles-empty-path b/i/pc104/initrd/conf/busybox/testsuite/wget/wget-handles-empty-path
new file mode 100644
index 0000000..5b59183
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/wget/wget-handles-empty-path
@@ -0,0 +1 @@
+busybox wget http://www.google.com
diff --git a/i/pc104/initrd/conf/busybox/testsuite/wget/wget-retrieves-google-index b/i/pc104/initrd/conf/busybox/testsuite/wget/wget-retrieves-google-index
new file mode 100644
index 0000000..7be9a80
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/wget/wget-supports--P b/i/pc104/initrd/conf/busybox/testsuite/wget/wget-supports--P
new file mode 100644
index 0000000..9b4d095
--- /dev/null
+++ b/i/pc104/initrd/conf/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/i/pc104/initrd/conf/busybox/testsuite/which/which-uses-default-path b/i/pc104/initrd/conf/busybox/testsuite/which/which-uses-default-path
new file mode 100644
index 0000000..63ceb9f
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/which/which-uses-default-path
@@ -0,0 +1,4 @@
+BUSYBOX=$(type -p busybox)
+SAVED_PATH=$PATH
+unset PATH
+$BUSYBOX which ls
diff --git a/i/pc104/initrd/conf/busybox/testsuite/xargs/xargs-works b/i/pc104/initrd/conf/busybox/testsuite/xargs/xargs-works
new file mode 100644
index 0000000..c95869e
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/testsuite/xargs/xargs-works
@@ -0,0 +1,4 @@
+[ -n "$d" ] || d=..
+find "$d" -name \*works -type f | xargs md5sum > logfile.gnu
+find "$d" -name \*works -type f | busybox xargs md5sum > logfile.bb
+diff -u logfile.gnu logfile.bb