mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
S390: Adding testcases for s390
Add minimal s390-virtio domain testcase and testcases for virtio serial, net, disk for the virtio-s390 bus. Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
This commit is contained in:
parent
1af7e319ed
commit
028ba4f375
@ -0,0 +1,9 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
|
||||
s390-virtio -m 214 -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 virtio-serial-s390,id=virtio-serial0 \
|
||||
-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-virtio-disk0 \
|
||||
-device virtio-blk-s390,drive=drive-virtio-disk0,id=virtio-disk0 \
|
||||
-chardev pty,id=charconsole0 \
|
||||
-device virtconsole,chardev=charconsole0,id=console0 -usb
|
24
tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.xml
Normal file
24
tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory>219100</memory>
|
||||
<currentMemory>219100</currentMemory>
|
||||
<os>
|
||||
<type arch='s390x' machine='s390-virtio'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='virtio'/>
|
||||
</disk>
|
||||
<console type='pty'>
|
||||
<target type='virtio'/>
|
||||
</console>
|
||||
</devices>
|
||||
</domain>
|
@ -0,0 +1,5 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S \
|
||||
-M s390-virtio -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-virtio-disk0 \
|
||||
-device virtio-blk-s390,drive=drive-virtio-disk0,id=virtio-disk0 -usb
|
22
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-s390.xml
Normal file
22
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-s390.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory>219136</memory>
|
||||
<currentMemory>219136</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='s390x' machine='s390-virtio'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='virtio'/>
|
||||
</disk>
|
||||
</devices>
|
||||
</domain>
|
5
tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args
Normal file
5
tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args
Normal file
@ -0,0 +1,5 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu \
|
||||
-name QEMUGuest1 -S -M s390-virtio -m 214 -smp 1 -nographic \
|
||||
-monitor unix:/tmp/test-monitor,server,nowait -no-acpi \
|
||||
-boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial \
|
||||
none -parallel none -usb
|
21
tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.xml
Normal file
21
tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory>219100</memory>
|
||||
<currentMemory>219100</currentMemory>
|
||||
<os>
|
||||
<type arch='s390x' machine='s390-virtio'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='virtio'/>
|
||||
</disk>
|
||||
</devices>
|
||||
</domain>
|
5
tests/qemuxml2argvdata/qemuxml2argv-net-virtio-s390.args
Normal file
5
tests/qemuxml2argvdata/qemuxml2argv-net-virtio-s390.args
Normal file
@ -0,0 +1,5 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S \
|
||||
-M s390-virtio -m 214 -smp 1 -nographic -nodefaults \
|
||||
-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
|
||||
-device virtio-net-s390,vlan=0,id=net0,mac=00:11:22:33:44:55 \
|
||||
-net user,vlan=0,name=hostnet0 -usb
|
22
tests/qemuxml2argvdata/qemuxml2argv-net-virtio-s390.xml
Normal file
22
tests/qemuxml2argvdata/qemuxml2argv-net-virtio-s390.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory>219136</memory>
|
||||
<currentMemory>219136</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='s390x' machine='s390-virtio'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:55'/>
|
||||
<model type='virtio'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
@ -341,6 +341,7 @@ mymain(void)
|
||||
unsetenv("SDL_AUDIODRIVER");
|
||||
|
||||
DO_TEST("minimal", false, QEMU_CAPS_NAME);
|
||||
DO_TEST("minimal-s390", false, QEMU_CAPS_NAME);
|
||||
DO_TEST("machine-aliases1", false, NONE);
|
||||
DO_TEST("machine-aliases2", true, NONE);
|
||||
DO_TEST("boot-cdrom", false, NONE);
|
||||
@ -393,6 +394,8 @@ mymain(void)
|
||||
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE);
|
||||
DO_TEST("disk-many", false, NONE);
|
||||
DO_TEST("disk-virtio", false, QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT);
|
||||
DO_TEST("disk-virtio-s390", false, QEMU_CAPS_DRIVE,
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_S390);
|
||||
DO_TEST("disk-order", false,
|
||||
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE_BOOT,
|
||||
QEMU_CAPS_VIRTIO_BLK_SCSI, QEMU_CAPS_VIRTIO_BLK_SG_IO);
|
||||
@ -552,6 +555,8 @@ mymain(void)
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_VIRTIO_TX_ALG);
|
||||
DO_TEST("net-virtio-netdev", false,
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_NETDEV, QEMU_CAPS_NODEFCONFIG);
|
||||
DO_TEST("net-virtio-s390", false,
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_S390);
|
||||
DO_TEST("net-eth", false, NONE);
|
||||
DO_TEST("net-eth-ifname", false, NONE);
|
||||
DO_TEST("net-eth-names", false, QEMU_CAPS_NET_NAME);
|
||||
@ -609,6 +614,9 @@ mymain(void)
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG);
|
||||
DO_TEST("console-virtio-many", false,
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG);
|
||||
DO_TEST("console-virtio-s390", false,
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
|
||||
QEMU_CAPS_DRIVE, QEMU_CAPS_VIRTIO_S390);
|
||||
DO_TEST("channel-spicevmc", false,
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
|
||||
QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC);
|
||||
|
@ -87,6 +87,34 @@ error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int testQemuAddS390Guest(virCapsPtr caps)
|
||||
{
|
||||
static const char *s390_machines[] = { "s390-virtio"};
|
||||
virCapsGuestMachinePtr *machines = NULL;
|
||||
virCapsGuestPtr guest;
|
||||
|
||||
machines = virCapabilitiesAllocMachines(s390_machines,
|
||||
ARRAY_CARDINALITY(s390_machines));
|
||||
if (!machines)
|
||||
goto error;
|
||||
|
||||
guest = virCapabilitiesAddGuest(caps, "hvm", "s390x", 64,
|
||||
"/usr/bin/qemu-system-s390x", NULL,
|
||||
ARRAY_CARDINALITY(s390_machines),
|
||||
machines);
|
||||
if (!guest)
|
||||
goto error;
|
||||
|
||||
if (!virCapabilitiesAddGuestDomain(guest, "qemu", NULL, NULL, 0, NULL))
|
||||
goto error;
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virCapabilitiesFreeMachines(machines, ARRAY_CARDINALITY(s390_machines));
|
||||
return -1;
|
||||
}
|
||||
|
||||
virCapsPtr testQemuCapsInit(void) {
|
||||
virCapsPtr caps;
|
||||
virCapsGuestPtr guest;
|
||||
@ -209,6 +237,9 @@ virCapsPtr testQemuCapsInit(void) {
|
||||
if (testQemuAddPPC64Guest(caps))
|
||||
goto cleanup;
|
||||
|
||||
if (testQemuAddS390Guest(caps))
|
||||
goto cleanup;
|
||||
|
||||
if (virTestGetDebug()) {
|
||||
char *caps_str;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user