From 123ccd10a9d55fe57b8cba4affd1dada323cadf8 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Mon, 3 Jun 2019 15:24:27 -0700 Subject: [PATCH] test/vhost: Automatically download VM image in iso mode Change-Id: If95a5c464169c4027ac3827ccd7325e56fed9281 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458596 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto Reviewed-by: Darek Stojaczyk --- test/vhost/common.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/vhost/common.sh b/test/vhost/common.sh index aecc6b318..531eea4b8 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -24,7 +24,22 @@ function vhosttestinit() { if [ "$TEST_MODE" == "iso" ]; then $rootdir/scripts/setup.sh - # TODO: Test for VM image in correct spot + + # Look for the VM image + if [[ ! -f $VM_IMAGE ]]; then + echo "VM image not found at $VM_IMAGE" + echo "Download to $HOME? [yn]" + read download + if [ "$download" = "y" ]; then + curl https://dqtibwqq6s6ux.cloudfront.net/download/test_resources/vhost_vm_image.tar.gz | tar xz -C $HOME + fi + fi + fi + + # Look for the VM image + if [[ ! -f $VM_IMAGE ]]; then + error "VM image not found at $VM_IMAGE" + exit 1 fi }