| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Script to run client or server tests on a live remote image. | 7 # Script to run client or server tests on a live remote image. |
| 8 | 8 |
| 9 # Load common constants. This should be the first executable line. | 9 # Load common constants. This should be the first executable line. |
| 10 # The path to common.sh should be relative to your script's location. | 10 # The path to common.sh should be relative to your script's location. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 DEFINE_string machine_desc "" "Machine description used in database" | 22 DEFINE_string machine_desc "" "Machine description used in database" |
| 23 DEFINE_string build_desc "" "Build description used in database" | 23 DEFINE_string build_desc "" "Build description used in database" |
| 24 DEFINE_string chroot_dir "${DEFAULT_CHROOT_DIR}" "alternate chroot location" c | 24 DEFINE_string chroot_dir "${DEFAULT_CHROOT_DIR}" "alternate chroot location" c |
| 25 | 25 |
| 26 function cleanup() { | 26 function cleanup() { |
| 27 if [[ $FLAGS_cleanup -eq ${FLAGS_TRUE} ]]; then | 27 if [[ $FLAGS_cleanup -eq ${FLAGS_TRUE} ]]; then |
| 28 rm -rf "${TMP}" | 28 rm -rf "${TMP}" |
| 29 else | 29 else |
| 30 echo "Left temporary files at ${TMP}" | 30 echo "Left temporary files at ${TMP}" |
| 31 fi | 31 fi |
| 32 if [[ -n "${SSH_AGENT_PID}" ]] | 32 cleanup_remote_access |
| 33 then | |
| 34 kill ${SSH_AGENT_PID} 2>/dev/null | |
| 35 unset SSH_AGENT_PID SSH_AUTH_SOCK | |
| 36 fi | |
| 37 } | 33 } |
| 38 | 34 |
| 39 # Returns an error if the test_result_file has text which indicates | 35 # Returns an error if the test_result_file has text which indicates |
| 40 # the test was not run successfully. | 36 # the test was not run successfully. |
| 41 # Arguments: | 37 # Arguments: |
| 42 # $1 - file name of autotest status for to check for success | 38 # $1 - file name of autotest status for to check for success |
| 43 # Returns: | 39 # Returns: |
| 44 # None | 40 # None |
| 45 function is_successful_test() { | 41 function is_successful_test() { |
| 46 local file="$1" | 42 local file="$1" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 echo "Parse failed." | tee -a "${FLAGS_output_file}" | 203 echo "Parse failed." | tee -a "${FLAGS_output_file}" |
| 208 FLAGS_cleanup=${FLAGS_FALSE} | 204 FLAGS_cleanup=${FLAGS_FALSE} |
| 209 fi | 205 fi |
| 210 fi | 206 fi |
| 211 done | 207 done |
| 212 | 208 |
| 213 echo "Output stored to ${FLAGS_output_file}" | 209 echo "Output stored to ${FLAGS_output_file}" |
| 214 } | 210 } |
| 215 | 211 |
| 216 main $@ | 212 main $@ |
| OLD | NEW |