Commit 123ccd10 authored by Ben Walker's avatar Ben Walker
Browse files

test/vhost: Automatically download VM image in iso mode

parent 88da8a91
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -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
}