ash: add slightly different testcase
authorDenis Vlasenko <vda.linux@googlemail.com>
Sat, 26 Jul 2008 14:20:04 +0000 (14:20 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sat, 26 Jul 2008 14:20:04 +0000 (14:20 -0000)
shell/ash_test/ash-signals/signal2.right
shell/ash_test/ash-signals/signal2.tests
shell/ash_test/ash-signals/signal3.right [new file with mode: 0644]
shell/ash_test/ash-signals/signal3.tests [new file with mode: 0755]

index 96d2d6ad3751683dbffbd29fd847290069ed30ce..a2af919c00aa30572ac26b8aa9b355e620bd9708 100644 (file)
@@ -1,3 +1,3 @@
-sleeping
+child sleeps
 child exits as expected
 parent exits
index 04f981c2d01b0582f330e9c0e8256434913af5d3..df639ca2cd84f836f756c462f5a6b0ae8477d606 100755 (executable)
@@ -6,7 +6,7 @@ cleanup() {
     exit
 }
 trap cleanup HUP
-echo "sleeping"
+echo "child sleeps"
 sleep 1
 echo "BAD exit from child!"
 ' &
diff --git a/shell/ash_test/ash-signals/signal3.right b/shell/ash_test/ash-signals/signal3.right
new file mode 100644 (file)
index 0000000..3113ba5
--- /dev/null
@@ -0,0 +1,4 @@
+child sleeps
+child got HUP
+child exits
+parent exits
diff --git a/shell/ash_test/ash-signals/signal3.tests b/shell/ash_test/ash-signals/signal3.tests
new file mode 100755 (executable)
index 0000000..b56c2d9
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+$THIS_SH -c '
+hup() {
+    echo "child got HUP"
+}
+trap hup HUP
+echo "child sleeps"
+sleep 1
+echo "child exits"
+' &
+
+child=$!
+sleep 0.1 # let child install handler first
+kill -HUP $child
+wait
+echo "parent exits"