Aviv Keshet | f81b438 | 2013-04-26 14:30:47 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | SCR="/mnt/host/source/src/third_party/autotest/files/site_utils/test_that.py" |
| 8 | |
| 9 | if [ ! -f $SCR ]; then |
| 10 | echo "You appear to have a minilayout checkout, without autotest and" |
| 11 | echo "test_that.py available in your source tree. Aborting." |
| 12 | exit 1 |
| 13 | fi |
| 14 | |
Aviv Keshet | a9fc852 | 2013-06-13 14:32:01 -0700 | [diff] [blame] | 15 | trap : SIGTERM SIGINT |
| 16 | |
Aviv Keshet | 87b1178 | 2013-08-19 14:23:20 -0700 | [diff] [blame] | 17 | ssh-agent $SCR "$@" & |
Aviv Keshet | a9fc852 | 2013-06-13 14:32:01 -0700 | [diff] [blame] | 18 | child_pid=$! |
| 19 | wait $child_pid |
Aviv Keshet | d2967f9 | 2013-08-05 16:20:08 -0700 | [diff] [blame] | 20 | readonly cached_exit_status=$? |
Aviv Keshet | a9fc852 | 2013-06-13 14:32:01 -0700 | [diff] [blame] | 21 | |
Aviv Keshet | d2967f9 | 2013-08-05 16:20:08 -0700 | [diff] [blame] | 22 | if [[ $cached_exit_status -gt 128 ]] |
Aviv Keshet | a9fc852 | 2013-06-13 14:32:01 -0700 | [diff] [blame] | 23 | then |
| 24 | sudo kill $child_pid |
| 25 | wait $child_pid |
Aviv Keshet | d2967f9 | 2013-08-05 16:20:08 -0700 | [diff] [blame] | 26 | fi |
| 27 | |
| 28 | exit $cached_exit_status |