3 .
"${TEST_SCRIPTS_DIR}/unit.sh"
7 etimedout
=$
(errcode ETIMEDOUT
)
9 test_case
"No pings, only child monitors, so gets EPIPE"
11 parent: async wait start 5
12 child: async wait start 10
13 parent: async wait end
16 unit_test tmon_ping_test false
0 5 0 0 false
0 10 0 "$epipe"
18 test_case
"No pings, only parent monitors, so gets EPIPE"
20 parent: async wait start 10
21 child: async wait start 5
25 unit_test tmon_ping_test false
0 10 0 "$epipe" false
0 5 0 0
27 test_case
"No pings, Child exits first, parent notices"
29 parent: async wait start 10
30 child: async wait start 1
34 unit_test tmon_ping_test false
0 10 0 "$epipe" false
0 1 0 0
36 test_case
"No pings, parent exits first, child notices"
38 parent: async wait start 1
39 child: async wait start 10
40 parent: async wait end
43 unit_test tmon_ping_test false
0 1 0 0 false
0 10 0 "$epipe"
45 test_case
"Parent pings, child doesn't expect them, EIO"
47 parent: async wait start 5
48 child: async wait start 5
52 unit_test tmon_ping_test true
0 5 0 "$epipe" false
0 5 0 "$eio"
54 test_case
"Child pings, parent doesn't expect them, EIO"
56 parent: async wait start 5
57 child: async wait start 5
61 unit_test tmon_ping_test false
0 5 0 "$eio" true
0 5 0 "$epipe"
63 test_case
"Both ping, child doesn't expect them, EIO"
65 parent: async wait start 5
66 child: async wait start 5
70 unit_test tmon_ping_test true
3 5 0 "$epipe" true
0 5 0 "$eio"
72 test_case
"Both ping, parent doesn't expect them, EIO"
74 parent: async wait start 5
75 child: async wait start 5
79 unit_test tmon_ping_test true
0 5 0 "$eio" true
3 5 0 "$epipe"
81 test_case
"Child pings, no ping timeout error, child exits first"
83 parent: async wait start 10
84 child: async wait start 5
88 unit_test tmon_ping_test false
3 10 0 "$epipe" true
0 5 0 0
90 test_case
"Parent pings, no ping timeout error, parent exits first"
92 parent: async wait start 5
93 child: async wait start 10
94 parent: async wait end
97 unit_test tmon_ping_test true
0 5 0 0 false
3 10 0 "$epipe"
99 test_case
"Both ping, no ping timeout error, parent exits first"
101 parent: async wait start 5
102 child: async wait start 10
103 parent: async wait end
106 unit_test tmon_ping_test true
3 5 0 0 true
3 10 0 "$epipe"
108 test_case
"Both ping, no ping timeout error, child exits first"
110 parent: async wait start 10
111 child: async wait start 5
112 child: async wait end
115 unit_test tmon_ping_test true
3 10 0 "$epipe" true
3 5 0 0
117 test_case
"Both ping, child blocks, parent ping timeout error"
119 parent: async wait start 20
120 child: blocking sleep start 7
122 child: blocking sleep end
124 unit_test tmon_ping_test true
3 20 0 "$etimedout" true
3 0 7 0
126 test_case
"Both ping, parent blocks, child ping timeout error"
128 parent: blocking sleep start 7
129 child: async wait start 20
131 parent: blocking sleep end
133 unit_test tmon_ping_test true
3 0 7 0 true
3 20 0 "$etimedout"
135 test_case
"Both ping, child waits, child blocks, parent ping timeout error"
137 parent: async wait start 20
138 child: async wait start 2
139 child: async wait end
140 child: blocking sleep start 7
142 child: blocking sleep end
144 unit_test tmon_ping_test true
3 20 0 "$etimedout" true
3 2 7 0
146 test_case
"Both ping, parent waits, parent blocks, child ping timeout error"
148 parent: async wait start 2
149 child: async wait start 20
150 parent: async wait end
151 parent: blocking sleep start 7
153 parent: blocking sleep end
155 unit_test tmon_ping_test true
3 2 7 0 true
3 20 0 "$etimedout"
157 test_case
"Both ping, child blocks for less than ping timeout"
159 parent: async wait start 20
160 child: blocking sleep start 3
161 child: blocking sleep end
164 unit_test tmon_ping_test true
7 20 0 "$epipe" true
7 0 3 0
166 test_case
"Both ping, parent blocks for less than ping timeout"
168 parent: blocking sleep start 3
169 child: async wait start 20
170 parent: blocking sleep end
173 unit_test tmon_ping_test true
7 0 3 0 true
7 20 3 "$epipe"
175 test_case
"Both ping, child waits, child blocks for less than ping timeout"
177 parent: async wait start 20
178 child: async wait start 2
179 child: async wait end
180 child: blocking sleep start 3
181 child: blocking sleep end
184 unit_test tmon_ping_test true
7 20 0 "$epipe" true
7 2 3 0
186 test_case
"Both ping, parent waits, parent blocks for less than ping timeout"
188 parent: async wait start 2
189 child: async wait start 20
190 parent: async wait end
191 parent: blocking sleep start 3
192 parent: blocking sleep end
195 unit_test tmon_ping_test true
7 2 3 0 true
7 20 0 "$epipe"