blob: 843395d0a3f93086fd885277314d7ef0a45c0ed4 [file] [log] [blame]
Aviv Keshetf81b4382013-04-26 14:30:47 -07001#!/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
7SCR="/mnt/host/source/src/third_party/autotest/files/site_utils/test_that.py"
8
9if [ ! -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
13fi
14
Aviv Kesheta9fc8522013-06-13 14:32:01 -070015trap : SIGTERM SIGINT
16
Aviv Keshet87b11782013-08-19 14:23:20 -070017ssh-agent $SCR "$@" &
Aviv Kesheta9fc8522013-06-13 14:32:01 -070018child_pid=$!
19wait $child_pid
Aviv Keshetd2967f92013-08-05 16:20:08 -070020readonly cached_exit_status=$?
Aviv Kesheta9fc8522013-06-13 14:32:01 -070021
Aviv Keshetd2967f92013-08-05 16:20:08 -070022if [[ $cached_exit_status -gt 128 ]]
Aviv Kesheta9fc8522013-06-13 14:32:01 -070023then
24 sudo kill $child_pid
25 wait $child_pid
Aviv Keshetd2967f92013-08-05 16:20:08 -070026fi
27
28exit $cached_exit_status