[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    testsuite bug fixes
From:       Chris Metcalf <cmetcalf () tilera ! com>
Date:       2010-03-29 15:55:56
Message-ID: 201003291555.o2TFtuvD002797 () farm-0002 ! internal ! tilera ! com
[Download RAW message or body]

The appended diffs fix a couple of minor test suite issues I've seen
getting the test suite to work with our config file.  These diffs are
against 1.16.1 with plain diff, rather than a proper git diff; I
apologize but I have some other fire-fighting to do at the moment and
am still coming up to speed on git.

The changes are:

- cp-parents requires FEATURE_CP_LONG_OPTIONS
- grep NUL testing requires EXTRA_COMPAT
- mount.tests requires MINIX
- tar.tests requires FEATURE_TAR_LONG_OPTIONS
- runtest needs to handle multiple FEATURE lines correctly

Note that in grep.tests I put a hardcoded "SKIP=" after the block of
tests guarded by the "optional EXTRA_COMPAT"; there doesn't seem to be
a shell function for "reset to non-optional testing".  Perhaps there
should be a "required" function (parallel to "optional") that just
does "SKIP="?  I suppose alternately you could just require that all
optional tests follow all required tests, and move the "grep NUL"
tests down to later in grep.tests.

There also isn't an explicit way to bail out completely if "SKIP" is
set by an "optional" line, as I do in mount.tests to avoid running
mkfs explicitly and failing, but perhaps the idiom I used is sufficient.

I also have marked the "pidof -s" tests as "buggy" in our tree, though
I don't include those diffs here.  The concern is that if you have an
init that is running "askfirst" somewhere, it will fork and wait, and
then you will have multiple "init" processes, and "pidof -s init" will
report the wrong process and the test will fail.  I'm not sure what
better solution to suggest; "pidof -s kthreadd" = 2 perhaps?

--
Chris Metcalf, Tilera Corp.
http://www.tilera.com


diff -ruN busybox-1.16.1/testsuite/cp/cp-parents busybox-1.16.1.tilera/testsuite/cp/cp-parents
--- busybox-1.16.1/testsuite/cp/cp-parents	2010-03-19 22:58:07.000000000 -0400
+++ busybox-1.16.1.tilera/testsuite/cp/cp-parents	2010-03-29 11:20:31.263507000 -0400
@@ -1,3 +1,4 @@
+# FEATURE: CONFIG_FEATURE_CP_LONG_OPTIONS
 mkdir -p foo/bar/baz
 touch foo/bar/baz/file
 mkdir dir
diff -ruN busybox-1.16.1/testsuite/grep.tests busybox-1.16.1.tilera/testsuite/grep.tests
--- busybox-1.16.1/testsuite/grep.tests	2010-03-28 13:43:36.000000000 -0400
+++ busybox-1.16.1.tilera/testsuite/grep.tests	2010-03-29 11:24:27.901267000 -0400
@@ -62,11 +62,13 @@
 	"grep -s domatch nonexistent - ; echo \$?" \
 	"(standard input):domatch\n2\n" "" "nomatch\ndomatch\nend\n"
 
+optional EXTRA_COMPAT
 testing "grep handles NUL in files" "grep -a foo input" "\0foo\n" "\0foo\n\n" ""
 testing "grep handles NUL on stdin" "grep -a foo" "\0foo\n" "" "\0foo\n\n"
 
 testing "grep matches NUL" "grep . input > /dev/null 2>&1 ; echo \$?" \
 	"0\n" "\0\n" ""
+SKIP=
 
 # -e regex
 testing "grep handles multiple regexps" "grep -e one -e two input ; echo \$?" \
diff -ruN busybox-1.16.1/testsuite/mount.tests busybox-1.16.1.tilera/testsuite/mount.tests
--- busybox-1.16.1/testsuite/mount.tests	2010-03-19 22:58:07.000000000 -0400
+++ busybox-1.16.1.tilera/testsuite/mount.tests	2010-03-29 10:52:59.146607000 -0400
@@ -9,6 +9,13 @@
 	exit 0
 }
 
+optional MKFS_MINIX
+if [ -n "$SKIP" ]
+then
+  echo "SKIPPED: mount"
+  exit 0
+fi
+
 testdir=$PWD/testdir
 
 dd if=/dev/zero of=mount.image1m count=1 bs=1M 2>/dev/null || { echo "dd error"; exit 1; }
diff -ruN busybox-1.16.1/testsuite/tar.tests busybox-1.16.1.tilera/testsuite/tar.tests
--- busybox-1.16.1/testsuite/tar.tests	2010-03-19 22:58:07.000000000 -0400
+++ busybox-1.16.1.tilera/testsuite/tar.tests	2010-03-29 11:25:51.049899000 -0400
@@ -31,6 +31,7 @@
 " \
 "" ""
 
+optional FEATURE_TAR_LONG_OPTIONS
 testing "tar --overwrite" "\
 rm -rf input_* test.tar 2>/dev/null
 ln input input_hard
diff -ruN busybox-1.16.1/testsuite/runtest busybox-1.16.1.tilera/testsuite/runtest
--- busybox-1.16.1/testsuite/runtest	2010-03-28 13:43:36.000000000 -0400
+++ busybox-1.16.1.tilera/testsuite/runtest	2010-03-29 10:52:59.156602000 -0400
@@ -26,10 +26,12 @@
 	if grep "^# FEATURE: " "$testcase" >/dev/null; then
 		local feature=$(sed -ne 's/^# FEATURE: //p' "$testcase")
 
-		if grep "^# $feature is not set$" "$bindir/.config" >/dev/null; then
-			echo "UNTESTED: $testname"
-			return 0
-		fi
+		for f in $feature; do
+			if grep "^# $f is not set$" "$bindir/.config" >/dev/null; then
+				echo "UNTESTED: $testname"
+				return 0
+			fi
+		done
 	fi
 
 	rm -rf ".tmpdir.$applet"
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic