svn commit: trunk/busybox/shell/ash_test: ash-redir ash-signals

vda at busybox.net vda at busybox.net
Wed Feb 13 18:09:57 UTC 2008


Author: vda
Date: 2008-02-13 10:09:56 -0800 (Wed, 13 Feb 2008)
New Revision: 21010

Log:
ash: add a testcase for recently fixed signal bug



Added:
   trunk/busybox/shell/ash_test/ash-signals/
   trunk/busybox/shell/ash_test/ash-signals/signal1.right
   trunk/busybox/shell/ash_test/ash-signals/signal1.tests

Removed:
   trunk/busybox/shell/ash_test/ash-redir/redir.tests

Modified:
   trunk/busybox/shell/ash_test/run-all


Changeset:
Deleted: trunk/busybox/shell/ash_test/ash-redir/redir.tests
===================================================================
--- trunk/busybox/shell/ash_test/ash-redir/redir.tests	2008-02-13 17:52:42 UTC (rev 21009)
+++ trunk/busybox/shell/ash_test/ash-redir/redir.tests	2008-02-13 18:09:56 UTC (rev 21010)
@@ -1,6 +0,0 @@
-# test: closed fds should stay closed
-exec 1>&-
-echo TEST >TEST
-echo JUNK # lost: stdout is closed
-cat TEST >&2
-rm TEST

Added: trunk/busybox/shell/ash_test/ash-signals/signal1.right
===================================================================
--- trunk/busybox/shell/ash_test/ash-signals/signal1.right	                        (rev 0)
+++ trunk/busybox/shell/ash_test/ash-signals/signal1.right	2008-02-13 18:09:56 UTC (rev 21010)
@@ -0,0 +1,20 @@
+got signal
+trap -- 'echo got signal' USR1
+sent 1 signal
+got signal
+sleep interrupted
+trap -- 'echo got signal' USR1
+sent 2 signal
+got signal
+sleep interrupted
+trap -- 'echo got signal' USR1
+sent 3 signal
+got signal
+sleep interrupted
+trap -- 'echo got signal' USR1
+sent 4 signal
+got signal
+sleep interrupted
+trap -- 'echo got signal' USR1
+sent 5 signal
+sleep completed

Added: trunk/busybox/shell/ash_test/ash-signals/signal1.tests
===================================================================
--- trunk/busybox/shell/ash_test/ash-signals/signal1.tests	                        (rev 0)
+++ trunk/busybox/shell/ash_test/ash-signals/signal1.tests	2008-02-13 18:09:56 UTC (rev 21010)
@@ -0,0 +1,24 @@
+sleeping=true
+
+trap "echo got signal" USR1
+
+for try in 1 2 3 4 5; do
+    kill -USR1 $$
+    sleep 1
+    echo sent $try signal
+done &
+
+sleep 10 &
+
+while $sleeping; do
+    trap
+    if wait %%; then
+        echo sleep completed
+        sleeping=false
+    elif [ $? == 127 ]; then
+        echo no sleep tonite
+        sleeping=false
+    else
+        echo sleep interrupted;
+    fi
+done


Property changes on: trunk/busybox/shell/ash_test/ash-signals/signal1.tests
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/busybox/shell/ash_test/run-all
===================================================================
--- trunk/busybox/shell/ash_test/run-all	2008-02-13 17:52:42 UTC (rev 21009)
+++ trunk/busybox/shell/ash_test/run-all	2008-02-13 18:09:56 UTC (rev 21010)
@@ -1,6 +1,9 @@
 #!/bin/sh
 
-test -x ash || { echo "No ./ash?!"; exit; }
+test -x ash || {
+    echo "No ./ash?! Perhaps you want to run 'ln -s ../../busybox ash'"
+    exit
+}
 test -x printenv || gcc -O2 -o printenv printenv.c || exit $?
 test -x recho    || gcc -O2 -o recho    recho.c    || exit $?
 test -x zecho    || gcc -O2 -o zecho    zecho.c    || exit $?
@@ -50,6 +53,7 @@
     modules=`ls -d ash-*`
 
     for module in $modules; do
+	echo do_test $module
 	do_test $module
     done
 else




More information about the busybox-cvs mailing list