From fe358600abc1bf3d109f6610011f3f3a84a9ef55 Mon Sep 17 00:00:00 2001 From: Craig Smith Date: Thu, 19 Jan 2017 05:11:53 +1030 Subject: [PATCH] Add cleanup trap to integration test script (#4075) The integration test script spins up Python webservers. This trap will ensure that those webservers are shutdown at exit. --- tests/boulder-integration.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/boulder-integration.sh b/tests/boulder-integration.sh index 790e5a263..9c6bc7708 100755 --- a/tests/boulder-integration.sh +++ b/tests/boulder-integration.sh @@ -20,6 +20,18 @@ else readlink="readlink" fi +cleanup_and_exit() { + EXIT_STATUS=$? + if SERVER_STILL_RUNNING=`ps -p $python_server_pid -o pid=` + then + echo Kill server subprocess, left running by abnormal exit + kill $SERVER_STILL_RUNNING + fi + exit $EXIT_STATUS +} + +trap cleanup_and_exit EXIT + common_no_force_renew() { certbot_test_no_force_renew \ --authenticator standalone \