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
test_that.py 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).

BUG=chromium:213051
TEST=Sent a SIGTERM to script process using `kill` command, saw that
test_that child processes and autoserv processes cleaned up and exited.
CQ-DEPEND=CL:I6bba284f28736e26e0685c9911dbaa4e82a90472

Change-Id: I2391bccbb9086582ee530a129703912690396134
Reviewed-on: https://gerrit.chromium.org/gerrit/58594
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
1 file changed