Pass ssh private key when calling cros_run_vm_update script
This also ensures that the update_engine is started before calling
image_to_live.sh. This is done as a prerequisite for enabling the
SimpleTestUpdateAndVerify for lakitu builds.
BUG=b:27858147
TEST=manually run cros_au_test_harness that later calls cros_run_vm_update
Change-Id: Ic7bb5557af3e705d83e2149e7383d5867bc4e969
Reviewed-on: https://chromium-review.googlesource.com/360633
Commit-Ready: Roberta Dobrescu <rdob@google.com>
Tested-by: Roberta Dobrescu <rdob@google.com>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
diff --git a/au_test_harness/vm_au_worker.py b/au_test_harness/vm_au_worker.py
index 7471978..64cc0f2 100644
--- a/au_test_harness/vm_au_worker.py
+++ b/au_test_harness/vm_au_worker.py
@@ -100,8 +100,12 @@
'--persist',
'--kvm_pid=%s' % self._kvm_pid_file,
'--ssh_port=%s' % self._ssh_port,
+ '--remote=127.0.0.1',
stateful_change_flag,
]
+ if self.ssh_private_key is not None:
+ cmd.append('--ssh_private_key=%s' % self.ssh_private_key)
+ cmd.append('--private_key=%s' % self.ssh_private_key)
self.AppendUpdateFlags(cmd, image_path, src_image_path, proxy_port,
payload_signing_key)
self.TestInfo(self.GetUpdateMessage(image_path, src_image_path, True,
@@ -126,8 +130,12 @@
'--persist',
'--kvm_pid=%s' % self._kvm_pid_file,
'--ssh_port=%s' % self._ssh_port,
+ '--remote=127.0.0.1',
stateful_change_flag,
]
+ if self.ssh_private_key is not None:
+ cmd.append('--ssh_private_key=%s' % self.ssh_private_key)
+ cmd.append('--private_key=%s' % self.ssh_private_key)
if proxy_port:
cmd.append('--proxy_port=%s' % proxy_port)
self.TestInfo(self.GetUpdateMessage(update_path, None, True, proxy_port))
diff --git a/cros_run_vm_update b/cros_run_vm_update
index ba427a0..630bfd7 100755
--- a/cros_run_vm_update
+++ b/cros_run_vm_update
@@ -9,6 +9,7 @@
. $(dirname "$(readlink -f "$0")")/outside_chroot_common.sh || exit 1
. "${SCRIPT_ROOT}/common.sh" || exit 1
. "${SCRIPT_ROOT}/lib/cros_vm_lib.sh" || die "Unable to load cros_vm_lib.sh"
+. "${SCRIPT_ROOT}/remote_access.sh" || die "Unable to load remote_access.sh"
DEFINE_string board "$DEFAULT_BOARD" \
"The board for which you built autotest." b
@@ -56,9 +57,14 @@
QUICK_TEST_FLAGS="--noupdate --noupdate_stateful"
fi
+TMP=$(mktemp -d /tmp/cros_run_vm_update.XXXX)
+remote_access_init
+remote_sh "update_engine"
+
"${SCRIPT_ROOT}/image_to_live.sh" \
--remote=127.0.0.1 \
--ssh_port=${FLAGS_ssh_port} \
+ --private_key=${FLAGS_ssh_private_key} \
--stateful_update_flag=${FLAGS_stateful_update_flag} \
--src_image="${FLAGS_src_image}" \
--noupdate_hostkey \