Debian Codegraph @

test/integration/targets/signal_propagation/runme.sh

raw
1 #!/usr/bin/env bash
2
3 set -x
4
5 echo "Test signal propagation with isolated and non-isolated workers"
6 for isolation in 0 1
7 do
8 ANSIBLE_WORKER_SESSION_ISOLATION=$isolation ../test_utils/scripts/timeout.py -s SIGINT 3 -- \
9 ansible all -i inventory -m debug -a 'msg={{lookup("pipe", "sleep 33")}}' -f 10
10 if [[ "$?" != "124" ]]; then
11 echo "Process was not terminated due to timeout"
12 exit 1
13 fi
14
15 # a short sleep to let processes die
16 sleep 2
17
18 sleeps="$(pgrep -alf 'sleep\ 33')"
19 rc="$?"
20 if [[ "$rc" == "0" ]]; then
21 echo "Found lingering processes:"
22 echo "$sleeps"
23 exit 1
24 fi
25 done