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: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4551 (master)
(cherry picked from commit c4c37f1cf1
)
Change-Id: I75c457fe75f005b0ab43ca909be7886529ed115b
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4944
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
ea364da638
commit
fc9ae4f30f
@ -208,7 +208,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
|
|||||||
# enabled, it catches SEGV earlier than our handler which
|
# enabled, it catches SEGV earlier than our handler which
|
||||||
# breaks the hotplug logic.
|
# breaks the hotplug logic.
|
||||||
if [ $SPDK_RUN_ASAN -eq 0 ]; then
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -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.")
|
each virtual machine gets it's own bdev to work on.")
|
||||||
parser.add_argument('-v', '--vm-count', default=1, type=int,
|
parser.add_argument('-v', '--vm-count', default=1, type=int,
|
||||||
help="How many VMs to run in test. Default: 1")
|
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.")
|
type=str, help="VM image to use for running VMs.")
|
||||||
|
|
||||||
subparsers = parser.add_subparsers()
|
subparsers = parser.add_subparsers()
|
||||||
|
@ -54,9 +54,8 @@ function devices_delete() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
password=$1
|
password=$1
|
||||||
base_img=${DEPENDENCY_DIR}/fedora-hotplug.qcow2
|
base_img=$HOME/spdk_test_image.qcow2
|
||||||
test_img=${DEPENDENCY_DIR}/fedora-hotplug-test.qcow2
|
qemu_pidfile=$HOME/qemupid
|
||||||
qemu_pidfile=${DEPENDENCY_DIR}/qemupid
|
|
||||||
|
|
||||||
if [ ! -e "$base_img" ]; then
|
if [ ! -e "$base_img" ]; then
|
||||||
echo "Hotplug VM image not found; skipping test"
|
echo "Hotplug VM image not found; skipping test"
|
||||||
@ -65,8 +64,6 @@ fi
|
|||||||
|
|
||||||
timing_enter start_qemu
|
timing_enter start_qemu
|
||||||
|
|
||||||
qemu-img create -b "$base_img" -f qcow2 "$test_img"
|
|
||||||
|
|
||||||
for i in {0..3}; do
|
for i in {0..3}; do
|
||||||
dd if=/dev/zero of="$SPDK_TEST_STORAGE/nvme$i.img" bs=1M count=1024
|
dd if=/dev/zero of="$SPDK_TEST_STORAGE/nvme$i.img" bs=1M count=1024
|
||||||
done
|
done
|
||||||
@ -74,7 +71,7 @@ done
|
|||||||
qemu-system-x86_64 \
|
qemu-system-x86_64 \
|
||||||
-daemonize -display none -m 8192 \
|
-daemonize -display none -m 8192 \
|
||||||
-pidfile "$qemu_pidfile" \
|
-pidfile "$qemu_pidfile" \
|
||||||
-hda "$test_img" \
|
-hda "$base_img" \
|
||||||
-net user,hostfwd=tcp::10022-:22 \
|
-net user,hostfwd=tcp::10022-:22 \
|
||||||
-net nic \
|
-net nic \
|
||||||
-cpu host \
|
-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/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/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/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
|
timing_exit start_qemu
|
||||||
|
|
||||||
@ -129,6 +127,5 @@ trap - SIGINT SIGTERM EXIT
|
|||||||
qemupid=$(awk '{printf $0}' "$qemu_pidfile")
|
qemupid=$(awk '{printf $0}' "$qemu_pidfile")
|
||||||
kill -9 $qemupid
|
kill -9 $qemupid
|
||||||
rm "$qemu_pidfile"
|
rm "$qemu_pidfile"
|
||||||
rm "$test_img"
|
|
||||||
|
|
||||||
timing_exit hotplug_test
|
timing_exit hotplug_test
|
||||||
|
@ -8,8 +8,7 @@ VM_DIR=$VHOST_DIR/vms
|
|||||||
TARGET_DIR=$VHOST_DIR/vhost
|
TARGET_DIR=$VHOST_DIR/vhost
|
||||||
VM_PASSWORD="root"
|
VM_PASSWORD="root"
|
||||||
|
|
||||||
#TODO: Move vhost_vm_image.qcow2 into VHOST_DIR on test systems.
|
VM_IMAGE=$HOME/spdk_test_image.qcow2
|
||||||
VM_IMAGE=$HOME/vhost_vm_image.qcow2
|
|
||||||
|
|
||||||
if ! hash $QEMU_IMG_BIN $QEMU_BIN; then
|
if ! hash $QEMU_IMG_BIN $QEMU_BIN; then
|
||||||
error 'QEMU is not installed on this system. Unable to run vhost tests.'
|
error 'QEMU is not installed on this system. Unable to run vhost tests.'
|
||||||
|
@ -21,7 +21,7 @@ case $1 in
|
|||||||
echo " -h |--help prints this message"
|
echo " -h |--help prints this message"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Environment:"
|
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 ""
|
||||||
echo "Tests are performed only on Linux machine. For other OS no action is performed."
|
echo "Tests are performed only on Linux machine. For other OS no action is performed."
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -53,7 +53,7 @@ function usage() {
|
|||||||
echo " --vm-memory=INT Amount of RAM memory (in MB) to pass to a single VM."
|
echo " --vm-memory=INT Amount of RAM memory (in MB) to pass to a single VM."
|
||||||
echo " Default: 2048 MB"
|
echo " Default: 2048 MB"
|
||||||
echo " --vm-image=PATH OS image to use for running the VMs."
|
echo " --vm-image=PATH OS image to use for running the VMs."
|
||||||
echo " Default: \$HOME/vhost_vm_image.qcow2"
|
echo " Default: \$HOME/spdk_test_image.qcow2"
|
||||||
echo " --vm-sar-enable Measure CPU utilization in guest VMs using sar."
|
echo " --vm-sar-enable Measure CPU utilization in guest VMs using sar."
|
||||||
echo " --host-sar-enable Measure CPU utilization on host using sar."
|
echo " --host-sar-enable Measure CPU utilization on host using sar."
|
||||||
echo " --sar-delay=INT Wait for X seconds before starting SAR measurement. Default: 0."
|
echo " --sar-delay=INT Wait for X seconds before starting SAR measurement. Default: 0."
|
||||||
|
Loading…
Reference in New Issue
Block a user