OLD | NEW |
| (Empty) |
1 #!/bin/bash | |
2 | |
3 # Copyright (c) 2010 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 # Run remote access test to ensure ssh access to a host is working. Exits with | |
8 # a code of 0 if successful and non-zero otherwise. Used by test infrastructure | |
9 # scripts. | |
10 | |
11 . $(dirname "$(readlink -f "$0")")/outside_chroot_common.sh 2> /dev/null || | |
12 SCRIPT_ROOT=/usr/lib/crosutils | |
13 . "${SCRIPT_ROOT}/common.sh" || | |
14 (echo "Unable to load common.sh" && false) || | |
15 exit 1 | |
16 . "${SCRIPT_ROOT}/remote_access.sh" || die "Unable to load remote_access.sh" | |
17 | |
18 function cleanup { | |
19 cleanup_remote_access | |
20 rm -rf "${TMP}" | |
21 } | |
22 | |
23 function main() { | |
24 cd "${SCRIPTS_DIR}" | |
25 | |
26 FLAGS "$@" || exit 1 | |
27 eval set -- "${FLAGS_ARGV}" | |
28 | |
29 set -e | |
30 | |
31 trap cleanup EXIT | |
32 | |
33 TMP=$(mktemp -d /tmp/ssh_test.XXXX) | |
34 | |
35 remote_access_init | |
36 } | |
37 | |
38 main $@ | |
OLD | NEW |