aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2020-10-24 04:26:43 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2020-10-24 04:26:43 +0200
commite16f7eb5967b9a960f4600c20690af63fb830b60 (patch)
tree3a07d75e1bb30874324816aa3ec1e7a6cfc898dc /shell/hush_test
parentb65d6cb00fa0ea51bac4c4e62b576b43ae2c996b (diff)
downloadbusybox-w32-e16f7eb5967b9a960f4600c20690af63fb830b60.tar.gz
busybox-w32-e16f7eb5967b9a960f4600c20690af63fb830b60.tar.bz2
busybox-w32-e16f7eb5967b9a960f4600c20690af63fb830b60.zip
hush: output bash-compat killing signal names
This significantly syncronises ash-signals and hush-signals tests. function old new delta process_wait_result 449 450 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-misc/sig_exitcode.right4
-rw-r--r--shell/hush_test/hush-signals/catch.right2
-rw-r--r--shell/hush_test/hush-signals/signal1.right20
-rwxr-xr-xshell/hush_test/hush-signals/signal1.tests28
-rw-r--r--shell/hush_test/hush-signals/signal_read2.right2
-rw-r--r--shell/hush_test/hush-signals/subshell.right2
6 files changed, 53 insertions, 5 deletions
diff --git a/shell/hush_test/hush-misc/sig_exitcode.right b/shell/hush_test/hush-misc/sig_exitcode.right
index d5f000a08..7cbc1072d 100644
--- a/shell/hush_test/hush-misc/sig_exitcode.right
+++ b/shell/hush_test/hush-misc/sig_exitcode.right
@@ -1,5 +1,5 @@
1KILL 1Killed
2137:137 2137:137
3KILL 3Killed
40:0 40:0
5Done 5Done
diff --git a/shell/hush_test/hush-signals/catch.right b/shell/hush_test/hush-signals/catch.right
index 80a062c4b..68530c6e7 100644
--- a/shell/hush_test/hush-signals/catch.right
+++ b/shell/hush_test/hush-signals/catch.right
@@ -2,4 +2,4 @@ sending USR2
2caught 2caught
3sending USR2 3sending USR2
4sending USR2 4sending USR2
5USR2 5User defined signal 2
diff --git a/shell/hush_test/hush-signals/signal1.right b/shell/hush_test/hush-signals/signal1.right
new file mode 100644
index 000000000..cf403ac62
--- /dev/null
+++ b/shell/hush_test/hush-signals/signal1.right
@@ -0,0 +1,20 @@
1got signal
2trap -- 'echo got signal' USR1
3sent 1 signal
4got signal
5wait interrupted
6trap -- 'echo got signal' USR1
7sent 2 signal
8got signal
9wait interrupted
10trap -- 'echo got signal' USR1
11sent 3 signal
12got signal
13wait interrupted
14trap -- 'echo got signal' USR1
15sent 4 signal
16got signal
17wait interrupted
18trap -- 'echo got signal' USR1
19sent 5 signal
20sleep completed
diff --git a/shell/hush_test/hush-signals/signal1.tests b/shell/hush_test/hush-signals/signal1.tests
new file mode 100755
index 000000000..61943467a
--- /dev/null
+++ b/shell/hush_test/hush-signals/signal1.tests
@@ -0,0 +1,28 @@
1trap "echo got signal" USR1
2
3for try in 1 2 3 4 5; do
4 kill -USR1 $$
5 sleep 0.2
6 echo "sent $try signal"
7done &
8
9# Ensure "wait" has something to wait for
10sleep 2 &
11
12# Ensure we do not execute "trap" below before "kill -USR1" above
13# (was getting failure on loaded machine without this)
14sleep 0.1
15
16sleeping=true
17while $sleeping; do
18 trap
19 if wait %%; then
20 echo "sleep completed"
21 sleeping=false
22 elif [ $? = 127 ]; then
23 echo "BUG: no processes to wait for?!"
24 sleeping=false
25 else
26 echo "wait interrupted"
27 fi
28done
diff --git a/shell/hush_test/hush-signals/signal_read2.right b/shell/hush_test/hush-signals/signal_read2.right
index 71a6bc16d..87d8da304 100644
--- a/shell/hush_test/hush-signals/signal_read2.right
+++ b/shell/hush_test/hush-signals/signal_read2.right
@@ -1,2 +1,2 @@
1HUP 1Hangup
2Done:129 2Done:129
diff --git a/shell/hush_test/hush-signals/subshell.right b/shell/hush_test/hush-signals/subshell.right
index f865b932b..248fcc41a 100644
--- a/shell/hush_test/hush-signals/subshell.right
+++ b/shell/hush_test/hush-signals/subshell.right
@@ -17,5 +17,5 @@ Ok
17trap -- '' HUP 17trap -- '' HUP
18trap -- '' QUIT 18trap -- '' QUIT
19trap -- '' SYS 19trap -- '' SYS
20TERM 20Terminated
21Done 21Done