summaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-signals/signal9.tests
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash_test/ash-signals/signal9.tests')
-rwxr-xr-xshell/ash_test/ash-signals/signal9.tests21
1 files changed, 21 insertions, 0 deletions
diff --git a/shell/ash_test/ash-signals/signal9.tests b/shell/ash_test/ash-signals/signal9.tests
new file mode 100755
index 0000000..18e7101
--- /dev/null
+++ b/shell/ash_test/ash-signals/signal9.tests
@@ -0,0 +1,21 @@
+# Note: the inner script is a test which checks for a different bug
+# (ordering between INT handler and exit on "set -e"),
+# but so far I did not figure out how to simulate it non-interactively.
+
+"$THIS_SH" -c '
+exit_func() {
+ echo "Removing traps"
+ trap - EXIT TERM INT
+ echo "End of exit_func"
+}
+set -e
+trap exit_func EXIT TERM INT
+sleep 2
+exit 77
+' &
+
+child=$!
+sleep 1
+kill -TERM $child
+wait
+echo Done: $?