From: Michael Ellerman Date: Fri, 13 Jan 2012 03:39:25 +0000 (+1100) Subject: tests: Add qemuxml2argv tests for PPC64 pseries machine X-Git-Tag: v0.9.10-rc1~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b942fe8606ec46451ee07f9c2c3cc23399bf9a7;p=thirdparty%2Flibvirt.git tests: Add qemuxml2argv tests for PPC64 pseries machine Add four tests of the XML -> argv handling for the PPC64 pseries machine. The first is just a basic test of a bare bones machine. The three others test various aspects of the spapr-vio address handling. It seems that currently we can't include network devices, doing so leads to a segfault because the network driverState is not initialised. Working around that leads us to the problem that the 'default' network doesn't exist. So for now just leave network devices out. Signed-off-by: Michael Ellerman --- diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args new file mode 100644 index 0000000000..f9aec92027 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args @@ -0,0 +1 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu-system-ppc64 -S -M pseries -m 512 -smp 1 -nographic -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -chardev pty,id=charserial0 -device spapr-vty,chardev=charserial0,reg=0x30000000 -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.xml new file mode 100644 index 0000000000..1b164f9e7a --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.xml @@ -0,0 +1,17 @@ + + QEMUGuest1 + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + + /usr/bin/qemu-system-ppc64 + +
+ + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-address-clash.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-address-clash.args new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-address-clash.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-address-clash.xml new file mode 100644 index 0000000000..4504f060dc --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-address-clash.xml @@ -0,0 +1,42 @@ + + QEMUGuest1 + 2754dd7b-ac8a-4850-aec0-1f3fcd43235b + 524288 + 1 + + hvm + + + + /usr/bin/qemu-system-ppc64 + +
+ + + + +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args new file mode 100644 index 0000000000..e939e1b1d8 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args @@ -0,0 +1 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu-system-ppc64 -S -M pseries -m 512 -smp 1 -nographic -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -device spapr-vscsi,id=scsi0,reg=0x2000 -device spapr-vscsi,id=scsi1,reg=0x30000000 -drive file=/tmp/scsidisk.img,if=none,id=drive-scsi1-0-0 -device scsi-disk,bus=scsi1.0,scsi-id=0,drive=drive-scsi1-0-0,id=scsi1-0-0 -chardev pty,id=charserial0 -device spapr-vty,chardev=charserial0,reg=0x20000000 -chardev pty,id=charserial1 -device spapr-vty,chardev=charserial1,reg=0x30001000 -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.xml new file mode 100644 index 0000000000..cf6547879c --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.xml @@ -0,0 +1,42 @@ + + QEMUGuest1 + 2754dd7b-ac8a-4850-aec0-1f3fcd43235b + 524288 + 1 + + hvm + + + + /usr/bin/qemu-system-ppc64 + +
+ + + + +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args new file mode 100644 index 0000000000..5fe0c88d25 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args @@ -0,0 +1 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu-system-ppc64 -S -M pseries -m 512 -smp 1 -nographic -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -device spapr-vscsi,id=scsi0,reg=0x2000 -device spapr-vscsi,id=scsi1,reg=0x3000 -drive file=/tmp/scsidisk.img,if=none,id=drive-scsi1-0-0 -device scsi-disk,bus=scsi1.0,scsi-id=0,drive=drive-scsi1-0-0,id=scsi1-0-0 -chardev pty,id=charserial0 -device spapr-vty,chardev=charserial0,reg=0x30000000 -chardev pty,id=charserial1 -device spapr-vty,chardev=charserial1,reg=0x30001000 -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.xml new file mode 100644 index 0000000000..68f42164d3 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.xml @@ -0,0 +1,42 @@ + + QEMUGuest1 + 2754dd7b-ac8a-4850-aec0-1f3fcd43235b + 524288 + 1 + + hvm + + + + /usr/bin/qemu-system-ppc64 + +
+ + + + +
+ + +
+ + + + + + + +
+ + + + +
+ + +
+ + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 74d4f17484..7beaa4b8cf 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -692,6 +692,15 @@ mymain(void) DO_TEST("seclabel-static", false, QEMU_CAPS_NAME); DO_TEST("seclabel-static-relabel", false, QEMU_CAPS_NAME); + DO_TEST("pseries-basic", false, + QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); + DO_TEST("pseries-vio", false, QEMU_CAPS_DRIVE, + QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); + DO_TEST("pseries-vio-user-assigned", false, QEMU_CAPS_DRIVE, + QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); + DO_TEST("pseries-vio-address-clash", true, QEMU_CAPS_DRIVE, + QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG); + free(driver.stateDir); virCapabilitiesFree(driver.caps); free(map);