2017-10-30 10:38:50 +00:00
|
|
|
#!/bin/bash
|
2018-02-28 21:34:27 +00:00
|
|
|
|
|
|
|
timeout()
|
|
|
|
{
|
|
|
|
python -c '
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
|
|
|
|
deadline = time.time() + float(sys.argv[1])
|
|
|
|
proc = subprocess.Popen(sys.argv[2:])
|
|
|
|
while time.time() < deadline and proc.poll() is None:
|
|
|
|
time.sleep(1.0)
|
|
|
|
|
|
|
|
if proc.poll() is not None:
|
|
|
|
sys.exit(proc.returncode)
|
|
|
|
proc.terminate()
|
|
|
|
print
|
|
|
|
print >> sys.stderr, "Timeout! Command was:", sys.argv[2:]
|
|
|
|
print
|
|
|
|
sys.exit(1)
|
|
|
|
' "$@"
|
|
|
|
}
|
|
|
|
|
2018-03-21 23:36:42 +00:00
|
|
|
trap 'sigint' INT
|
|
|
|
sigint()
|
|
|
|
{
|
|
|
|
echo "SIGINT received, stopping.."
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
run_test()
|
|
|
|
{
|
|
|
|
echo "Running $1.."
|
|
|
|
timeout 10 python $1 || fail=$?
|
|
|
|
}
|
|
|
|
|
|
|
|
run_test tests/ansible_helpers_test.py
|
2018-03-29 06:08:02 +00:00
|
|
|
run_test tests/call_error_test.py
|
2018-03-21 23:36:42 +00:00
|
|
|
run_test tests/call_function_test.py
|
|
|
|
run_test tests/channel_test.py
|
|
|
|
run_test tests/fakessh_test.py
|
|
|
|
run_test tests/first_stage_test.py
|
2018-03-24 10:43:13 +00:00
|
|
|
run_test tests/fork_test.py
|
2018-03-21 23:36:42 +00:00
|
|
|
run_test tests/id_allocation_test.py
|
|
|
|
run_test tests/importer_test.py
|
|
|
|
run_test tests/latch_test.py
|
|
|
|
run_test tests/local_test.py
|
|
|
|
run_test tests/master_test.py
|
|
|
|
run_test tests/module_finder_test.py
|
|
|
|
run_test tests/nested_test.py
|
|
|
|
run_test tests/parent_test.py
|
2018-03-29 09:47:55 +00:00
|
|
|
run_test tests/receiver_test.py
|
2018-03-21 23:36:42 +00:00
|
|
|
run_test tests/responder_test.py
|
|
|
|
run_test tests/router_test.py
|
|
|
|
run_test tests/select_test.py
|
|
|
|
run_test tests/ssh_test.py
|
|
|
|
run_test tests/utils_test.py
|
2018-03-21 05:24:14 +00:00
|
|
|
|
|
|
|
if [ "$fail" ]; then
|
|
|
|
echo "AT LEAST ONE TEST FAILED" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|