Skip to content

Commit 66a66a5

Browse files
committed
Add a smaller test for cross-process signals
An earlier version of this PR had a bug in cross-process signals that was only caught by one of the extra tests (basic-file-transfer). This is a more focused test for the corresponding functionality.
1 parent 44a3554 commit 66a66a5

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/test/signal/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,12 @@ add_shadow_tests(BASENAME signal)
99
## More complete signal functionality.
1010
add_linux_tests(BASENAME signals-extra COMMAND sh -c "../../target/debug/test_signals --libc-passing")
1111
add_shadow_tests(BASENAME signals-extra)
12+
13+
## Basic cross-process signal tests.
14+
add_shadow_tests(
15+
BASENAME signals-multiprocess
16+
# `sleep` should die with signal SIGINT (2), giving exitcode 128+2=130
17+
POST_CMD "test `cat hosts/*/*.sleep.*.exitcode` -eq 130"
18+
# Shadow should return failure
19+
EXPECT_ERROR TRUE
20+
CHECK_RETVAL FALSE)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Test sending a signal between processes.
2+
# In CMakeLists.txt we validate that `sleep` is killed by the signal.
3+
general:
4+
stop_time: 5
5+
network:
6+
graph:
7+
type: 1_gbit_switch
8+
hosts:
9+
mytesthost:
10+
network_node_id: 0
11+
processes:
12+
- path: sleep
13+
args: '10'
14+
start_time: 1
15+
- path: kill
16+
args: -SIGINT '1000'
17+
start_time: 2

0 commit comments

Comments
 (0)