From 37cccf3c330e8e0a140c7db149758d8620bdca4c Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Fri, 25 Mar 2011 15:58:20 -0700 Subject: [PATCH] Fix vm lib to work both in/out chroot. Change-Id: I41ca87d7970ce59c7bbbc0e8cdaeaf5bedb43776 BUG=chromium-os:13498 TEST=Ran it both in/out Review URL: http://codereview.chromium.org/6750012 --- lib/cros_vm_lib.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/cros_vm_lib.sh b/lib/cros_vm_lib.sh index 1246baae39..525729db0f 100644 --- a/lib/cros_vm_lib.sh +++ b/lib/cros_vm_lib.sh @@ -91,7 +91,14 @@ function start_kvm() { # Checks to see if we can access the target virtual machine with ssh. function ssh_ping() { - "${SCRIPT_ROOT}/ssh_test.sh" \ + # TODO(sosa): Remove outside chroot use once all callers work inside chroot. + local cmd + if [ $INSIDE_CHROOT -ne 1 ]; then + cmd="${GCLIENT_ROOT}/src/scripts/ssh_test.sh" + else + cmd=/usr/lib/crosutils/ssh_test.sh + fi + "${cmd}" \ --ssh_port=${FLAGS_ssh_port} \ --remote=127.0.0.1 >&2 }