mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-25 07:31:01 +02:00
crosutils: Add vnc view of tests running multiple tests for VM tests
Change-Id: I87c41e60797848192cee1f0c165215fcec8f5bd2 BUG=8850 TEST=Ran a few tests including suite_Smoke Review URL: http://codereview.chromium.org/4647001
This commit is contained in:
parent
ec5d7f0d2d
commit
08145697a5
@ -24,7 +24,6 @@ set -e
|
|||||||
|
|
||||||
# Parse command line.
|
# Parse command line.
|
||||||
FLAGS "$@" || exit 1
|
FLAGS "$@" || exit 1
|
||||||
eval set -- "${FLAGS_ARGV}"
|
|
||||||
|
|
||||||
# Use latest if not specified.
|
# Use latest if not specified.
|
||||||
if [ -z "${FLAGS_image_path}" ]; then
|
if [ -z "${FLAGS_image_path}" ]; then
|
||||||
@ -36,7 +35,20 @@ fi
|
|||||||
|
|
||||||
[ -e "${FLAGS_image_path}" ] || die "Image ${FLAGS_image_path} does not exist."
|
[ -e "${FLAGS_image_path}" ] || die "Image ${FLAGS_image_path} does not exist."
|
||||||
|
|
||||||
[ -n "${FLAGS_test_case}" ] || die "You must specify a test case."
|
if [ -n "${FLAGS_test_case}" ]; then
|
||||||
|
warn "Use of --test_case=<test> is being deprecated. Just pass test names \
|
||||||
|
as separate command line arguments."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${FLAGS_test_case}" ] && [ -z "${FLAGS_ARGV}" ]; then
|
||||||
|
die "You must specify a test case."
|
||||||
|
fi
|
||||||
|
|
||||||
|
tests=( )
|
||||||
|
[ -n "${FLAGS_test_case}" ] && tests=( "${FLAGS_test_case}" )
|
||||||
|
for test in ${FLAGS_ARGV}; do
|
||||||
|
tests=( "${tests[@]}" "$(remove_quotes "${test}")" )
|
||||||
|
done
|
||||||
|
|
||||||
trap stop_kvm EXIT
|
trap stop_kvm EXIT
|
||||||
start_kvm "${FLAGS_image_path}"
|
start_kvm "${FLAGS_image_path}"
|
||||||
@ -47,4 +59,4 @@ retry_until_ssh ${MAX_RETRIES}
|
|||||||
--ssh_port=${FLAGS_ssh_port} \
|
--ssh_port=${FLAGS_ssh_port} \
|
||||||
--remote=127.0.0.1 \
|
--remote=127.0.0.1 \
|
||||||
--results_dir_root="${FLAGS_results_dir_root}" \
|
--results_dir_root="${FLAGS_results_dir_root}" \
|
||||||
"${FLAGS_test_case}"
|
"${tests[@]}"
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
. "$(dirname $0)/../lib/cros_vm_lib.sh"
|
. "$(dirname $0)/../lib/cros_vm_lib.sh"
|
||||||
. "$(dirname "$0")/../lib/cros_vm_constants.sh"
|
. "$(dirname "$0")/../lib/cros_vm_constants.sh"
|
||||||
|
|
||||||
|
get_default_board
|
||||||
|
|
||||||
|
DEFINE_string board "${DEFAULT_BOARD}" \
|
||||||
|
"Board for VM image (unnecessary if path given)"
|
||||||
DEFINE_string image_path "" "Full path of the VM image"
|
DEFINE_string image_path "" "Full path of the VM image"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@ -20,7 +24,8 @@ eval set -- "${FLAGS_ARGV}"
|
|||||||
|
|
||||||
# Use latest if not specified.
|
# Use latest if not specified.
|
||||||
if [ -z "${FLAGS_image_path}" ]; then
|
if [ -z "${FLAGS_image_path}" ]; then
|
||||||
LATEST_IMAGE="$(${SCRIPTS_DIR}/get_latest_image.sh)/${DEFAULT_QEMU_IMAGE}"
|
LATEST_IMAGE="$(${SCRIPTS_DIR}/get_latest_image.sh \
|
||||||
|
--board=${FLAGS_board})/${DEFAULT_QEMU_IMAGE}"
|
||||||
info "Using latest vm image ${LATEST_IMAGE}"
|
info "Using latest vm image ${LATEST_IMAGE}"
|
||||||
FLAGS_image_path=${LATEST_IMAGE}
|
FLAGS_image_path=${LATEST_IMAGE}
|
||||||
fi
|
fi
|
||||||
|
@ -10,6 +10,7 @@ DEFINE_boolean no_graphics ${FLAGS_FALSE} "Runs the KVM instance silently."
|
|||||||
DEFINE_boolean persist "${FLAGS_FALSE}" "Persist vm."
|
DEFINE_boolean persist "${FLAGS_FALSE}" "Persist vm."
|
||||||
DEFINE_boolean snapshot ${FLAGS_FALSE} "Don't commit changes to image."
|
DEFINE_boolean snapshot ${FLAGS_FALSE} "Don't commit changes to image."
|
||||||
DEFINE_integer ssh_port 9222 "Port to tunnel ssh traffic over."
|
DEFINE_integer ssh_port 9222 "Port to tunnel ssh traffic over."
|
||||||
|
DEFINE_string vnc "" "VNC Server to display to instead of SDL."
|
||||||
|
|
||||||
KVM_PID_FILE=/tmp/kvm.$$.pid
|
KVM_PID_FILE=/tmp/kvm.$$.pid
|
||||||
LIVE_VM_IMAGE=
|
LIVE_VM_IMAGE=
|
||||||
@ -42,6 +43,9 @@ function start_kvm() {
|
|||||||
if [ ${FLAGS_no_graphics} -eq ${FLAGS_TRUE} ]; then
|
if [ ${FLAGS_no_graphics} -eq ${FLAGS_TRUE} ]; then
|
||||||
nographics="-nographic -serial none"
|
nographics="-nographic -serial none"
|
||||||
fi
|
fi
|
||||||
|
if [ -n "${FLAGS_vnc}" ]; then
|
||||||
|
nographics="-vnc ${FLAGS_vnc}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ${FLAGS_snapshot} -eq ${FLAGS_TRUE} ]; then
|
if [ ${FLAGS_snapshot} -eq ${FLAGS_TRUE} ]; then
|
||||||
snapshot="-snapshot"
|
snapshot="-snapshot"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user