From f5534a135e7530f48f45c932b009094c29489b1d Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Tue, 24 May 2011 19:01:11 +0300 Subject: [PATCH] tests: Add a test for correct disk device ordering --- .../qemuxml2argv-disk-order.args | 20 ++++++++++ .../qemuxml2argv-disk-order.xml | 37 +++++++++++++++++++ tests/qemuxml2argvtest.c | 2 + 3 files changed, 59 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-order.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-order.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-order.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-order.args new file mode 100644 index 0000000000..6483e5e4fb --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-order.args @@ -0,0 +1,20 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu \ +-S \ +-M pc \ +-m 214 \ +-smp 1 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait \ +-no-acpi \ +-boot c \ +-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-0 \ +-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ +-drive file=/dev/HostVG/QEMUGuest2,if=none,media=cdrom,id=drive-ide0-1-0 \ +-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \ +-drive file=/tmp/data.img,if=none,id=drive-virtio-disk0 \ +-device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0 \ +-drive file=/tmp/logs.img,if=none,id=drive-virtio-disk1 \ +-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,id=virtio-disk1 \ +-usb \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-order.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-order.xml new file mode 100644 index 0000000000..b07bbedec4 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-order.xml @@ -0,0 +1,37 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c9076e14da..cbd9a5f5d5 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -283,6 +283,8 @@ mymain(void) DO_TEST("disk-floppy", false, NONE); DO_TEST("disk-many", false, NONE); DO_TEST("disk-virtio", false, QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT); + DO_TEST("disk-order", false, + QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE_BOOT); DO_TEST("disk-xenvbd", false, QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT); DO_TEST("disk-drive-boot-disk", false, QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT);