You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/signal_propagation/runme.sh

22 lines
448 B
Bash

#!/usr/bin/env bash
set -x
../test_utils/scripts/timeout.py -s SIGINT 3 -- \
ansible all -i inventory -m debug -a 'msg={{lookup("pipe", "sleep 33")}}' -f 10
if [[ "$?" != "124" ]]; then
echo "Process was not terminated due to timeout"
exit 1
fi
# a short sleep to let processes die
sleep 2
sleeps="$(pgrep -alf 'sleep\ 33')"
rc="$?"
if [[ "$rc" == "0" ]]; then
echo "Found lingering processes:"
echo "$sleeps"
exit 1
fi