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 install and launch autotest. | 7 # Script to install and launch autotest. |
8 | 8 |
9 . "$(dirname "$0")/common.sh" | 9 . "$(dirname "$0")/common.sh" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 function cleanup { | 34 function cleanup { |
35 if [ "${TEST_AUTH_SOCKET:0:26}" == ${CHROOT_AUTHSOCK_PREFIX} ] | 35 if [ "${TEST_AUTH_SOCKET:0:26}" == ${CHROOT_AUTHSOCK_PREFIX} ] |
36 then | 36 then |
37 echo "cleaning up chrooted ssh-agent." | 37 echo "cleaning up chrooted ssh-agent." |
38 kill ${SSH_AGENT_PID} | 38 kill ${SSH_AGENT_PID} |
39 fi | 39 fi |
40 } | 40 } |
41 | 41 |
42 trap cleanup EXIT | 42 trap cleanup EXIT |
43 | 43 |
44 # Copy a local "installation" of autotest into the chroot, to avoid | |
45 # polluting the src dir with tmp files, results, etc. | |
46 # TODO: use rsync to ensure we don't get stuck with an old install. | |
47 if [ 1 != ${FLAGS_force} ] || [ ! -f "${AUTOTEST_CHROOT_DEST}/server/autosrv" ] | |
48 then | |
49 echo -n "Installing Autotest... " | |
50 sudo mkdir -p "${AUTOTEST_CHROOT_DEST}" | |
51 sudo cp -rp ${AUTOTEST_SRC}/* ${AUTOTEST_CHROOT_DEST} | |
52 echo "done." | |
53 else | |
54 echo "Autotest found in chroot, skipping copy." | |
55 fi | |
56 | |
57 # Add all third_party and system tests to site_tests. | |
58 for type in client server | |
59 do | |
60 echo -n "Adding ${type}_tests into autotest's ${type}/site_tests... " | |
61 sudo cp -rp ${GCLIENT_ROOT}/src/platform/testing/${type}_tests/* \ | |
62 ${AUTOTEST_CHROOT_DEST}/${type}/site_tests/ | |
63 done | |
64 | |
65 # If ssh-agent isn't already running, start one (possibly inside the chroot) | 44 # If ssh-agent isn't already running, start one (possibly inside the chroot) |
66 if [ ! -n "${SSH_AGENT_PID}" ] | 45 if [ ! -n "${SSH_AGENT_PID}" ] |
67 then | 46 then |
68 echo "Setting up ssh-agent in chroot for testing." | 47 echo "Setting up ssh-agent in chroot for testing." |
69 TEST_AUTH_SOCKET=$(mktemp -u ${CHROOT_AUTHSOCK_PREFIX}.XXXX) | 48 TEST_AUTH_SOCKET=$(mktemp -u ${CHROOT_AUTHSOCK_PREFIX}.XXXX) |
70 eval $(/usr/bin/ssh-agent -a ${TEST_AUTH_SOCKET}) | 49 eval $(/usr/bin/ssh-agent -a ${TEST_AUTH_SOCKET}) |
71 fi | 50 fi |
72 | 51 |
73 # Install authkey for testing | 52 # Install authkey for testing |
74 | 53 |
(...skipping 18 matching lines...) Expand all Loading... |
93 echo "running autoserv: " ${autoserv_cmd} | 72 echo "running autoserv: " ${autoserv_cmd} |
94 ${autoserv_cmd} | 73 ${autoserv_cmd} |
95 else | 74 else |
96 echo "To execute autotest manually: | 75 echo "To execute autotest manually: |
97 eval \$(ssh-agent) # start ssh-agent | 76 eval \$(ssh-agent) # start ssh-agent |
98 ssh-add $FLAGS_test_key # add test key to agent | 77 ssh-add $FLAGS_test_key # add test key to agent |
99 # Then execute autoserv: | 78 # Then execute autoserv: |
100 $autoserv_cmd" | 79 $autoserv_cmd" |
101 fi | 80 fi |
102 | 81 |
OLD | NEW |