Commit c4c37f1c authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Tomasz Zawadzki
Browse files

Modifications for using universal qcow2 image in tests



We want to replace few qcow2 images with one universal.
This commit contains:
 - change password in autotest.sh
 - change image path
 - change image name
 - use snapshot mode in hotplug.sh instead of copying base image

Signed-off-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I75c457fe75f005b0ab43ca909be7886529ed115b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4551


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarPawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent 1e83b640
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
		# enabled, it catches SEGV earlier than our handler which
		# breaks the hotplug logic.
		if [ $SPDK_RUN_ASAN -eq 0 ]; then
			run_test "nvme_hotplug" test/nvme/hotplug.sh intel
			run_test "nvme_hotplug" test/nvme/hotplug.sh root
		fi
	fi

+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ parser.add_argument('-d', '--max-disks', default=0, type=int,
                    each virtual machine gets it's own bdev to work on.")
parser.add_argument('-v', '--vm-count', default=1, type=int,
                    help="How many VMs to run in test. Default: 1")
parser.add_argument('-i', '--vm-image', default="$HOME/vhost_vm_image.qcow2",
parser.add_argument('-i', '--vm-image', default="$HOME/spdk_test_image.qcow2",
                    type=str, help="VM image to use for running VMs.")

subparsers = parser.add_subparsers()
+5 −8
Original line number Diff line number Diff line
@@ -54,9 +54,8 @@ function devices_delete() {
}

password=$1
base_img=${DEPENDENCY_DIR}/fedora-hotplug.qcow2
test_img=${DEPENDENCY_DIR}/fedora-hotplug-test.qcow2
qemu_pidfile=${DEPENDENCY_DIR}/qemupid
base_img=$HOME/spdk_test_image.qcow2
qemu_pidfile=$HOME/qemupid

if [ ! -e "$base_img" ]; then
	echo "Hotplug VM image not found; skipping test"
@@ -65,8 +64,6 @@ fi

timing_enter start_qemu

qemu-img create -b "$base_img" -f qcow2 "$test_img"

for i in {0..3}; do
	dd if=/dev/zero of="$SPDK_TEST_STORAGE/nvme$i.img" bs=1M count=1024
done
@@ -74,7 +71,7 @@ done
qemu-system-x86_64 \
	-daemonize -display none -m 8192 \
	-pidfile "$qemu_pidfile" \
	-hda "$test_img" \
	-hda "$base_img" \
	-net user,hostfwd=tcp::10022-:22 \
	-net nic \
	-cpu host \
@@ -85,7 +82,8 @@ qemu-system-x86_64 \
	-drive format=raw,file="$SPDK_TEST_STORAGE/nvme0.img",if=none,id=drive0 \
	-drive format=raw,file="$SPDK_TEST_STORAGE/nvme1.img",if=none,id=drive1 \
	-drive format=raw,file="$SPDK_TEST_STORAGE/nvme2.img",if=none,id=drive2 \
	-drive format=raw,file="$SPDK_TEST_STORAGE/nvme3.img",if=none,id=drive3
	-drive format=raw,file="$SPDK_TEST_STORAGE/nvme3.img",if=none,id=drive3 \
	-snapshot

timing_exit start_qemu

@@ -129,6 +127,5 @@ trap - SIGINT SIGTERM EXIT
qemupid=$(awk '{printf $0}' "$qemu_pidfile")
kill -9 $qemupid
rm "$qemu_pidfile"
rm "$test_img"

timing_exit hotplug_test
+1 −2
Original line number Diff line number Diff line
@@ -8,8 +8,7 @@ VM_DIR=$VHOST_DIR/vms
TARGET_DIR=$VHOST_DIR/vhost
VM_PASSWORD="root"

#TODO: Move vhost_vm_image.qcow2 into VHOST_DIR on test systems.
VM_IMAGE=$HOME/vhost_vm_image.qcow2
VM_IMAGE=$HOME/spdk_test_image.qcow2

if ! hash $QEMU_IMG_BIN $QEMU_BIN; then
	error 'QEMU is not installed on this system. Unable to run vhost tests.'
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ case $1 in
		echo "  -h |--help                           prints this message"
		echo ""
		echo "Environment:"
		echo "  VM_IMAGE        path to QCOW2 VM image used during test (default: $HOME/vhost_vm_image.qcow2)"
		echo "  VM_IMAGE        path to QCOW2 VM image used during test (default: $HOME/spdk_test_image.qcow2)"
		echo ""
		echo "Tests are performed only on Linux machine. For other OS no action is performed."
		echo ""
Loading