Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1924)

Unified Diff: bin/cros_run_vm_test

Issue 3597001: Move vm constants into their own file. This will make it easier to share these constants. (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Fix ws Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | image_to_vm.sh » ('j') | lib/cros_vm_constants.sh » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cros_run_vm_test
diff --git a/bin/cros_run_vm_test b/bin/cros_run_vm_test
index 6981745ac46e49da1d67e3a470985c993fb39739..8036b230b13ee70594ae247db041a3ebfca58eb5 100755
--- a/bin/cros_run_vm_test
+++ b/bin/cros_run_vm_test
@@ -8,6 +8,7 @@
. "$(dirname $0)/../common.sh"
. "$(dirname $0)/../lib/cros_vm_lib.sh"
+. "$(dirname "$0")/../lib/cros_vm_constants.sh"
petkov 2010/09/29 20:54:07 why "$0" and not in the rest?
DEFINE_string image_path "" "Full path of the VM image"
DEFINE_string test_case "" "Name of the test case to run"
@@ -18,8 +19,16 @@ set -e
FLAGS "$@" || exit 1
eval set -- "${FLAGS_ARGV}"
-[ -n "${FLAGS_image_path}" ] || die "You must specify a path to an image"
-[ -n "${FLAGS_test_case}" ] || die "You must specify a test case"
+# Use latest if not specified.
+if [ -z "${FLAGS_image_path}" ]; then
+ LATEST_IMAGE="$(${SCRIPTS_DIR}/get_latest_image.sh)/${DEFAULT_QEMU_IMAGE}"
+ info "Using latest vm image ${LATEST_IMAGE}"
+ FLAGS_image_path=${LATEST_IMAGE}
petkov 2010/09/29 20:54:07 If no images or image dir, you'd be looking at "/$
+fi
+
+[ -e "${FLAGS_image_path}" ] || die "Image ${FLAGS_image_path} does not exist."
+
+[ -n "${FLAGS_test_case}" ] || die "You must specify a test case."
trap stop_kvm EXIT
start_kvm "${FLAGS_image_path}"
« no previous file with comments | « no previous file | image_to_vm.sh » ('j') | lib/cros_vm_constants.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698