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}" |