make test_that wrapper script handle SIGTERM and SIGINT correctly

Prior to this CL, sending either a SIGTERM or a SIGINT signal to this
script process using the `kill` command would result in the underlying processing being left around as an orphan.

This CL traps causes the script to trap SIGTERM and SIGINT signals. When
either signal is received, the child `sudo test_that` process is sent a
SIGTERM signal using the `kill` command, and the script waits on that
process to end (since it may take up to 5 seconds for autoserv to clean
up after itself).

TEST=Sent a SIGTERM to script process using `kill` command, saw that
test_that child processes and autoserv processes cleaned up and exited.

Change-Id: I2391bccbb9086582ee530a129703912690396134
Tested-by: Aviv Keshet <>
Reviewed-by: Scott Zawalski <>
Commit-Queue: Aviv Keshet <>
1 file changed