This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
forked from cucumber/aruba
-
Notifications
You must be signed in to change notification settings - Fork 1
/
send_signal.feature
104 lines (92 loc) · 2.9 KB
/
send_signal.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Feature: Send a signal to command
You can send a command a signal with the following steps:
- `When I send the signal "HUP" to the command started last`
- `When I send the signal "HUP" to the command "bin/aruba-test-cli"`
Or just use `kill` on compatible platforms.
Background:
Given I use a fixture named "cli-app"
Scenario: Sending signal to the command started last
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
function hup {
echo "Got signal HUP."
exit 0
}
trap hup HUP
while [ true ]; do sleep 1; done
"""
And a file named "features/run.feature" with:
"""
Feature: Run it
Scenario: Run command
Given the default aruba exit timeout is 5 seconds
And I wait 5 seconds for a command to start up
When I run `cli` in background
And I send the signal "HUP" to the command started last
Then the exit status should be 0
And the output should contain:
\"\"\"
Got signal HUP.
\"\"\"
"""
When I run `cucumber`
Then the features should all pass
Scenario: Sending signal to a command given by command line
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
function hup {
echo "Got signal HUP."
exit 0
}
trap hup HUP
while [ true ]; do sleep 1; done
"""
And a file named "features/run.feature" with:
"""
Feature: Run it
Scenario: Run command
Given the default aruba exit timeout is 5 seconds
And I wait 5 seconds for a command to start up
When I run `cli` in background
And I send the signal "HUP" to the command "cli"
Then the exit status should be 0
And the output should contain:
\"\"\"
Got signal HUP.
\"\"\"
"""
When I run `cucumber`
Then the features should all pass
@unsupported-on-platform-windows
@experimental
Scenario: Using the "kill"-command
`<pid-last-command-started>` in your command line will be replaced by the
PID of the last command started. Please note, this feature is experimental.
The name of the variable may change without further notice.
Given an executable named "bin/aruba-test-cli" with:
"""bash
#!/usr/bin/env bash
function hup {
echo "Got signal HUP."
exit 0
}
trap hup HUP
while [ true ]; do sleep 1; done
"""
And a file named "features/run.feature" with:
"""
Feature: Run it
Scenario: Run command
Given the default aruba exit timeout is 5 seconds
And I wait 5 seconds for a command to start up
When I run `cli` in background
And I run `kill -HUP <pid-last-command-started>`
Then the output should contain:
\"\"\"
Got signal HUP.
\"\"\"
"""
When I run `cucumber`
Then the features should all pass