diff options
author | Cole Robinson <crobinso@redhat.com> | 2022-02-16 11:21:18 -0500 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2022-02-16 12:31:52 -0500 |
commit | 8eeebce4bccd8be358cbaf5f7d570af65c6ca79f (patch) | |
tree | 82bace9eb960f183f816438a77d6744fdd58f2f0 /tests | |
parent | 0cce75addc20769d0d068d54edd1696d4c0c37da (diff) | |
download | virt-manager-8eeebce4bccd8be358cbaf5f7d570af65c6ca79f.tar.gz |
tests: more capabilities data cleanup
* Merge kvm-x86_64-domcaps{-q35} variants
* Add -oldfirmware for explicitly testing secboot fallback setup
* Use consistent kvm-x86_64-domcaps-* prefix
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/capabilities/kvm-x86_64-domcaps-insecure.xml (renamed from tests/data/capabilities/kvm-x86_64-insecure-domcaps.xml) | 0 | ||||
-rw-r--r-- | tests/data/capabilities/kvm-x86_64-domcaps-latest.xml (renamed from tests/data/capabilities/kvm-x86_64-domcaps.xml) | 38 | ||||
-rw-r--r-- | tests/data/capabilities/kvm-x86_64-domcaps-oldfirmware.xml | 235 | ||||
-rw-r--r-- | tests/data/capabilities/kvm-x86_64-domcaps-q35.xml | 137 | ||||
-rw-r--r-- | tests/data/cli/compare/virt-install-boot-uefi-oldcaps.xml (renamed from tests/data/cli/compare/virt-install-boot-uefi-notpm.xml) | 2 | ||||
-rw-r--r-- | tests/data/cli/compare/virt-install-boot-uefi.xml | 15 | ||||
-rw-r--r-- | tests/data/cli/compare/virt-install-kvm-i686-uefi.xml | 6 | ||||
-rw-r--r-- | tests/data/cli/compare/virt-install-qemu-plain.xml | 3 | ||||
-rw-r--r-- | tests/data/cli/compare/virt-install-win7-uefi.xml | 6 | ||||
-rw-r--r-- | tests/test_capabilities.py | 14 | ||||
-rw-r--r-- | tests/test_cli.py | 9 | ||||
-rw-r--r-- | tests/test_xmlparse.py | 2 | ||||
-rw-r--r-- | tests/utils.py | 10 |
13 files changed, 302 insertions, 175 deletions
diff --git a/tests/data/capabilities/kvm-x86_64-insecure-domcaps.xml b/tests/data/capabilities/kvm-x86_64-domcaps-insecure.xml index 8071e69b..8071e69b 100644 --- a/tests/data/capabilities/kvm-x86_64-insecure-domcaps.xml +++ b/tests/data/capabilities/kvm-x86_64-domcaps-insecure.xml diff --git a/tests/data/capabilities/kvm-x86_64-domcaps.xml b/tests/data/capabilities/kvm-x86_64-domcaps-latest.xml index 1d51c3d8..ee586e1a 100644 --- a/tests/data/capabilities/kvm-x86_64-domcaps.xml +++ b/tests/data/capabilities/kvm-x86_64-domcaps-latest.xml @@ -1,17 +1,17 @@ <domainCapabilities> <path>/usr/bin/qemu-system-x86_64</path> <domain>kvm</domain> - <machine>pc-i440fx-6.1</machine> + <machine>pc-q35-6.1</machine> <arch>x86_64</arch> - <vcpu max='255'/> + <vcpu max='288'/> <iothreads supported='yes'/> <os supported='yes'> <enum name='firmware'> <value>efi</value> </enum> <loader supported='yes'> + <value>/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</value> <value>/usr/share/edk2/ovmf/OVMF_CODE.fd</value> - <value>/usr/share/edk2/ovmf-ia32/OVMF_CODE.fd</value> <enum name='type'> <value>rom</value> <value>pflash</value> @@ -21,6 +21,7 @@ <value>no</value> </enum> <enum name='secure'> + <value>yes</value> <value>no</value> </enum> </loader> @@ -39,30 +40,34 @@ </enum> </mode> <mode name='host-model' supported='yes'> - <model fallback='forbid'>Skylake-Client-IBRS</model> + <model fallback='forbid'>Cooperlake</model> <vendor>Intel</vendor> <feature policy='require' name='ss'/> <feature policy='require' name='vmx'/> <feature policy='require' name='pdcm'/> <feature policy='require' name='hypervisor'/> <feature policy='require' name='tsc_adjust'/> - <feature policy='require' name='clflushopt'/> + <feature policy='require' name='mpx'/> <feature policy='require' name='umip'/> <feature policy='require' name='md-clear'/> - <feature policy='require' name='stibp'/> - <feature policy='require' name='arch-capabilities'/> - <feature policy='require' name='ssbd'/> <feature policy='require' name='xsaves'/> - <feature policy='require' name='pdpe1gb'/> <feature policy='require' name='invtsc'/> <feature policy='require' name='ibpb'/> <feature policy='require' name='ibrs'/> <feature policy='require' name='amd-stibp'/> <feature policy='require' name='amd-ssbd'/> - <feature policy='require' name='skip-l1dfl-vmentry'/> - <feature policy='require' name='pschange-mc-no'/> <feature policy='disable' name='hle'/> <feature policy='disable' name='rtm'/> + <feature policy='disable' name='avx512f'/> + <feature policy='disable' name='avx512dq'/> + <feature policy='disable' name='clwb'/> + <feature policy='disable' name='avx512cd'/> + <feature policy='disable' name='avx512bw'/> + <feature policy='disable' name='avx512vl'/> + <feature policy='disable' name='avx512vnni'/> + <feature policy='disable' name='avx-vnni'/> + <feature policy='disable' name='avx512-bf16'/> + <feature policy='disable' name='taa-no'/> </mode> <mode name='custom' supported='yes'> <model usable='yes'>qemu64</model> @@ -138,7 +143,6 @@ <value>lun</value> </enum> <enum name='bus'> - <value>ide</value> <value>fdc</value> <value>scsi</value> <value>virtio</value> @@ -211,6 +215,16 @@ <value>virtiofs</value> </enum> </filesystem> + <tpm supported='yes'> + <enum name='model'> + <value>tpm-tis</value> + <value>tpm-crb</value> + </enum> + <enum name='backendModel'> + <value>passthrough</value> + <value>emulator</value> + </enum> + </tpm> </devices> <features> <gic supported='no'/> diff --git a/tests/data/capabilities/kvm-x86_64-domcaps-oldfirmware.xml b/tests/data/capabilities/kvm-x86_64-domcaps-oldfirmware.xml new file mode 100644 index 00000000..62ab437e --- /dev/null +++ b/tests/data/capabilities/kvm-x86_64-domcaps-oldfirmware.xml @@ -0,0 +1,235 @@ +<domainCapabilities> + <path>/usr/bin/qemu-system-x86_64</path> + <domain>kvm</domain> + <machine>pc-q35-6.1</machine> + <arch>x86_64</arch> + <vcpu max='288'/> + <iothreads supported='yes'/> + <os supported='yes'> + <loader supported='yes'> + <value>/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</value> + <enum name='type'> + <value>rom</value> + <value>pflash</value> + </enum> + <enum name='readonly'> + <value>yes</value> + <value>no</value> + </enum> + <enum name='secure'> + <value>yes</value> + <value>no</value> + </enum> + </loader> + </os> + <cpu> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> + <mode name='maximum' supported='yes'> + <enum name='maximumMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> + <mode name='host-model' supported='yes'> + <model fallback='forbid'>Cooperlake</model> + <vendor>Intel</vendor> + <feature policy='require' name='ss'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='pdcm'/> + <feature policy='require' name='hypervisor'/> + <feature policy='require' name='tsc_adjust'/> + <feature policy='require' name='mpx'/> + <feature policy='require' name='umip'/> + <feature policy='require' name='md-clear'/> + <feature policy='require' name='xsaves'/> + <feature policy='require' name='invtsc'/> + <feature policy='require' name='ibpb'/> + <feature policy='require' name='ibrs'/> + <feature policy='require' name='amd-stibp'/> + <feature policy='require' name='amd-ssbd'/> + <feature policy='disable' name='hle'/> + <feature policy='disable' name='rtm'/> + <feature policy='disable' name='avx512f'/> + <feature policy='disable' name='avx512dq'/> + <feature policy='disable' name='clwb'/> + <feature policy='disable' name='avx512cd'/> + <feature policy='disable' name='avx512bw'/> + <feature policy='disable' name='avx512vl'/> + <feature policy='disable' name='avx512vnni'/> + <feature policy='disable' name='avx-vnni'/> + <feature policy='disable' name='avx512-bf16'/> + <feature policy='disable' name='taa-no'/> + </mode> + <mode name='custom' supported='yes'> + <model usable='yes'>qemu64</model> + <model usable='yes'>qemu32</model> + <model usable='no'>phenom</model> + <model usable='yes'>pentium3</model> + <model usable='yes'>pentium2</model> + <model usable='yes'>pentium</model> + <model usable='yes'>n270</model> + <model usable='yes'>kvm64</model> + <model usable='yes'>kvm32</model> + <model usable='yes'>coreduo</model> + <model usable='yes'>core2duo</model> + <model usable='no'>athlon</model> + <model usable='yes'>Westmere-IBRS</model> + <model usable='yes'>Westmere</model> + <model usable='no'>Snowridge</model> + <model usable='no'>Skylake-Server-noTSX-IBRS</model> + <model usable='no'>Skylake-Server-IBRS</model> + <model usable='no'>Skylake-Server</model> + <model usable='yes'>Skylake-Client-noTSX-IBRS</model> + <model usable='no'>Skylake-Client-IBRS</model> + <model usable='no'>Skylake-Client</model> + <model usable='yes'>SandyBridge-IBRS</model> + <model usable='yes'>SandyBridge</model> + <model usable='yes'>Penryn</model> + <model usable='no'>Opteron_G5</model> + <model usable='no'>Opteron_G4</model> + <model usable='no'>Opteron_G3</model> + <model usable='yes'>Opteron_G2</model> + <model usable='yes'>Opteron_G1</model> + <model usable='yes'>Nehalem-IBRS</model> + <model usable='yes'>Nehalem</model> + <model usable='yes'>IvyBridge-IBRS</model> + <model usable='yes'>IvyBridge</model> + <model usable='no'>Icelake-Server-noTSX</model> + <model usable='no'>Icelake-Server</model> + <model usable='no' deprecated='yes'>Icelake-Client-noTSX</model> + <model usable='no' deprecated='yes'>Icelake-Client</model> + <model usable='yes'>Haswell-noTSX-IBRS</model> + <model usable='yes'>Haswell-noTSX</model> + <model usable='no'>Haswell-IBRS</model> + <model usable='no'>Haswell</model> + <model usable='no'>EPYC-Rome</model> + <model usable='no'>EPYC-Milan</model> + <model usable='no'>EPYC-IBPB</model> + <model usable='no'>EPYC</model> + <model usable='no'>Dhyana</model> + <model usable='no'>Cooperlake</model> + <model usable='yes'>Conroe</model> + <model usable='no'>Cascadelake-Server-noTSX</model> + <model usable='no'>Cascadelake-Server</model> + <model usable='yes'>Broadwell-noTSX-IBRS</model> + <model usable='yes'>Broadwell-noTSX</model> + <model usable='no'>Broadwell-IBRS</model> + <model usable='no'>Broadwell</model> + <model usable='yes'>486</model> + </mode> + </cpu> + <memoryBacking supported='yes'> + <enum name='sourceType'> + <value>file</value> + <value>anonymous</value> + <value>memfd</value> + </enum> + </memoryBacking> + <devices> + <disk supported='yes'> + <enum name='diskDevice'> + <value>disk</value> + <value>cdrom</value> + <value>floppy</value> + <value>lun</value> + </enum> + <enum name='bus'> + <value>fdc</value> + <value>scsi</value> + <value>virtio</value> + <value>usb</value> + <value>sata</value> + </enum> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + </disk> + <graphics supported='yes'> + <enum name='type'> + <value>sdl</value> + <value>vnc</value> + <value>spice</value> + <value>egl-headless</value> + </enum> + </graphics> + <video supported='yes'> + <enum name='modelType'> + <value>vga</value> + <value>cirrus</value> + <value>vmvga</value> + <value>qxl</value> + <value>virtio</value> + <value>none</value> + <value>bochs</value> + <value>ramfb</value> + </enum> + </video> + <hostdev supported='yes'> + <enum name='mode'> + <value>subsystem</value> + </enum> + <enum name='startupPolicy'> + <value>default</value> + <value>mandatory</value> + <value>requisite</value> + <value>optional</value> + </enum> + <enum name='subsysType'> + <value>usb</value> + <value>pci</value> + <value>scsi</value> + </enum> + <enum name='capsType'/> + <enum name='pciBackend'> + <value>default</value> + <value>vfio</value> + </enum> + </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + <value>builtin</value> + </enum> + </rng> + <filesystem supported='yes'> + <enum name='driverType'> + <value>path</value> + <value>handle</value> + <value>virtiofs</value> + </enum> + </filesystem> + <tpm supported='yes'> + <enum name='model'> + <value>tpm-tis</value> + <value>tpm-crb</value> + </enum> + <enum name='backendModel'> + <value>passthrough</value> + <value>emulator</value> + </enum> + </tpm> + </devices> + <features> + <gic supported='no'/> + <vmcoreinfo supported='yes'/> + <genid supported='yes'/> + <backingStoreInput supported='yes'/> + <backup supported='yes'/> + <sev supported='no'/> + </features> +</domainCapabilities> + + diff --git a/tests/data/capabilities/kvm-x86_64-domcaps-q35.xml b/tests/data/capabilities/kvm-x86_64-domcaps-q35.xml deleted file mode 100644 index b66e2eb5..00000000 --- a/tests/data/capabilities/kvm-x86_64-domcaps-q35.xml +++ /dev/null @@ -1,137 +0,0 @@ -<domainCapabilities> - <path>/home/phrdina/work/qemu/x86_64-softmmu/qemu-system-x86_64</path> - <domain>kvm</domain> - <machine>pc-q35-2.9</machine> - <arch>x86_64</arch> - <vcpu max='288'/> - <os supported='yes'> - <loader supported='yes'> - <value>/usr/share/ovmf/OVMF_CODE.secboot.fd</value> - <enum name='type'> - <value>rom</value> - <value>pflash</value> - </enum> - <enum name='readonly'> - <value>yes</value> - <value>no</value> - </enum> - </loader> - </os> - <cpu> - <mode name='host-passthrough' supported='yes'/> - <mode name='host-model' supported='yes'> - <model fallback='forbid'>Skylake-Client-IBRS</model> - <vendor>Intel</vendor> - <feature policy='require' name='ss'/> - <feature policy='require' name='vmx'/> - <feature policy='require' name='hypervisor'/> - <feature policy='require' name='tsc_adjust'/> - <feature policy='require' name='clflushopt'/> - <feature policy='require' name='xsaves'/> - <feature policy='require' name='ssbd'/> - <feature policy='require' name='pdpe1gb'/> - <feature policy='require' name='invtsc'/> - </mode> - <mode name='custom' supported='yes'> - <model usable='yes'>qemu64</model> - <model usable='yes'>qemu32</model> - <model usable='no'>phenom</model> - <model usable='yes'>pentium3</model> - <model usable='yes'>pentium2</model> - <model usable='yes'>pentium</model> - <model usable='yes'>n270</model> - <model usable='yes'>kvm64</model> - <model usable='yes'>kvm32</model> - <model usable='yes'>coreduo</model> - <model usable='yes'>core2duo</model> - <model usable='no'>athlon</model> - <model usable='yes'>Westmere</model> - <model usable='yes'>Skylake-Client</model> - <model usable='yes'>SandyBridge</model> - <model usable='yes'>Penryn</model> - <model usable='no'>Opteron_G5</model> - <model usable='no'>Opteron_G4</model> - <model usable='no'>Opteron_G3</model> - <model usable='yes'>Opteron_G2</model> - <model usable='yes'>Opteron_G1</model> - <model usable='yes'>Nehalem</model> - <model usable='yes'>IvyBridge</model> - <model usable='yes'>Haswell</model> - <model usable='yes'>Haswell-noTSX</model> - <model usable='yes'>Conroe</model> - <model usable='yes'>Broadwell</model> - <model usable='yes'>Broadwell-noTSX</model> - <model usable='yes'>486</model> - </mode> - </cpu> - <devices> - <disk supported='yes'> - <enum name='diskDevice'> - <value>disk</value> - <value>cdrom</value> - <value>floppy</value> - <value>lun</value> - </enum> - <enum name='bus'> - <value>fdc</value> - <value>scsi</value> - <value>virtio</value> - <value>usb</value> - <value>sata</value> - </enum> - </disk> - <graphics supported='yes'> - <enum name='type'> - <value>sdl</value> - <value>vnc</value> - <value>spice</value> - </enum> - </graphics> - <video supported='yes'> - <enum name='modelType'> - <value>vga</value> - <value>cirrus</value> - <value>vmvga</value> - <value>qxl</value> - <value>virtio</value> - </enum> - </video> - <hostdev supported='yes'> - <enum name='mode'> - <value>subsystem</value> - </enum> - <enum name='startupPolicy'> - <value>default</value> - <value>mandatory</value> - <value>requisite</value> - <value>optional</value> - </enum> - <enum name='subsysType'> - <value>usb</value> - <value>pci</value> - <value>scsi</value> - </enum> - <enum name='capsType'/> - <enum name='pciBackend'> - <value>default</value> - <value>kvm</value> - <value>vfio</value> - </enum> - </hostdev> - <tpm supported='yes'> - <enum name='model'> - <value>tpm-tis</value> - <value>tpm-crb</value> - </enum> - <enum name='backendModel'> - <value>passthrough</value> - <value>emulator</value> - </enum> - </tpm> - </devices> - <features> - <gic supported='no'/> - </features> -</domainCapabilities> - - diff --git a/tests/data/cli/compare/virt-install-boot-uefi-notpm.xml b/tests/data/cli/compare/virt-install-boot-uefi-oldcaps.xml index ea564aac..92e4053b 100644 --- a/tests/data/cli/compare/virt-install-boot-uefi-notpm.xml +++ b/tests/data/cli/compare/virt-install-boot-uefi-oldcaps.xml @@ -6,7 +6,7 @@ <vcpu>1</vcpu> <os> <type arch="x86_64" machine="q35">hvm</type> - <loader readonly="yes" secure="yes" type="pflash">/usr/share/ovmf/OVMF_CODE.secboot.fd</loader> + <loader readonly="yes" secure="yes" type="pflash">/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</loader> <boot dev="hd"/> </os> <features> diff --git a/tests/data/cli/compare/virt-install-boot-uefi.xml b/tests/data/cli/compare/virt-install-boot-uefi.xml index 87df74f1..651498b1 100644 --- a/tests/data/cli/compare/virt-install-boot-uefi.xml +++ b/tests/data/cli/compare/virt-install-boot-uefi.xml @@ -4,15 +4,13 @@ <memory>65536</memory> <currentMemory>65536</currentMemory> <vcpu>1</vcpu> - <os> - <type arch="x86_64" machine="q35">hvm</type> - <loader readonly="yes" secure="yes" type="pflash">/usr/share/ovmf/OVMF_CODE.secboot.fd</loader> + <os firmware="efi"> + <type arch="x86_64" machine="pc-i440fx-6.1">hvm</type> <boot dev="hd"/> </os> <features> <acpi/> <apic/> - <smm state="on"/> <vmport state="off"/> </features> <cpu mode="host-model"/> @@ -27,6 +25,11 @@ </pm> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> + <disk type="file" device="disk"> + <driver name="qemu" type="qcow2" discard="unmap"/> + <source file="/var/lib/libvirt/images/disk.qcow2"/> + <target dev="hda" bus="ide"/> + </disk> <controller type="usb" model="ich9-ehci1"/> <controller type="usb" model="ich9-uhci1"> <master startport="0"/> @@ -40,7 +43,7 @@ <interface type="bridge"> <source bridge="testsuitebr0"/> <mac address="00:11:22:33:44:55"/> - <model type="e1000e"/> + <model type="e1000"/> </interface> <console type="pty"/> <channel type="spicevmc"> @@ -53,7 +56,7 @@ <graphics type="spice" port="-1" tlsPort="-1" autoport="yes"> <image compression="off"/> </graphics> - <sound model="ich9"/> + <sound model="ich6"/> <video> <model type="qxl"/> </video> diff --git a/tests/data/cli/compare/virt-install-kvm-i686-uefi.xml b/tests/data/cli/compare/virt-install-kvm-i686-uefi.xml index 7b0f8546..ee1783d0 100644 --- a/tests/data/cli/compare/virt-install-kvm-i686-uefi.xml +++ b/tests/data/cli/compare/virt-install-kvm-i686-uefi.xml @@ -47,6 +47,9 @@ <target type="virtio" name="com.redhat.spice.0"/> </channel> <input type="tablet" bus="usb"/> + <tpm model="tpm-tis"> + <backend type="emulator"/> + </tpm> <graphics type="spice" port="-1" tlsPort="-1" autoport="yes"> <image compression="off"/> </graphics> @@ -105,6 +108,9 @@ <target type="virtio" name="com.redhat.spice.0"/> </channel> <input type="tablet" bus="usb"/> + <tpm model="tpm-tis"> + <backend type="emulator"/> + </tpm> <graphics type="spice" port="-1" tlsPort="-1" autoport="yes"> <image compression="off"/> </graphics> diff --git a/tests/data/cli/compare/virt-install-qemu-plain.xml b/tests/data/cli/compare/virt-install-qemu-plain.xml index 6238823b..953dcfe8 100644 --- a/tests/data/cli/compare/virt-install-qemu-plain.xml +++ b/tests/data/cli/compare/virt-install-qemu-plain.xml @@ -52,6 +52,9 @@ </interface> <console type="pty"/> <input type="tablet" bus="usb"/> + <tpm model="tpm-tis"> + <backend type="emulator"/> + </tpm> <graphics type="vnc" port="-1"/> <video> <model type="bochs"/> diff --git a/tests/data/cli/compare/virt-install-win7-uefi.xml b/tests/data/cli/compare/virt-install-win7-uefi.xml index d02ebc35..0d072268 100644 --- a/tests/data/cli/compare/virt-install-win7-uefi.xml +++ b/tests/data/cli/compare/virt-install-win7-uefi.xml @@ -71,6 +71,9 @@ <target type="virtio" name="com.redhat.spice.0"/> </channel> <input type="tablet" bus="usb"/> + <tpm model="tpm-tis"> + <backend type="emulator"/> + </tpm> <graphics type="spice" port="-1" tlsPort="-1" autoport="yes"> <image compression="off"/> </graphics> @@ -153,6 +156,9 @@ <target type="virtio" name="com.redhat.spice.0"/> </channel> <input type="tablet" bus="usb"/> + <tpm model="tpm-tis"> + <backend type="emulator"/> + </tpm> <graphics type="spice" port="-1" tlsPort="-1" autoport="yes"> <image compression="off"/> </graphics> diff --git a/tests/test_capabilities.py b/tests/test_capabilities.py index 95208bba..7deadd24 100644 --- a/tests/test_capabilities.py +++ b/tests/test_capabilities.py @@ -51,16 +51,19 @@ def testCapsUtilFuncs(): caps_empty.guest_lookup() - ############################## # domcapabilities.py testing # ############################## - def testDomainCapabilities(): xml = open(DATADIR + "/test-domcaps.xml").read() caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml) + assert caps.machine == "my-machine-type" + assert caps.arch == "x86_64" + assert caps.domain == "kvm" + assert caps.path == "/bin/emulatorbin" + assert caps.os.loader.supported is True assert caps.os.loader.get_values() == ["/foo/bar", "/tmp/my_path"] assert caps.os.loader.enum_names() == ["type", "readonly"] @@ -70,14 +73,9 @@ def testDomainCapabilities(): def testDomainCapabilitiesx86(): - xml = open(DATADIR + "/kvm-x86_64-domcaps.xml").read() + xml = open(DATADIR + "/kvm-x86_64-domcaps-latest.xml").read() caps = DomainCapabilities(utils.URIs.open_testdriver_cached(), xml) - assert caps.machine == "pc-i440fx-6.1" - assert caps.arch == "x86_64" - assert caps.domain == "kvm" - assert caps.path == "/usr/bin/qemu-system-x86_64" - custom_mode = caps.cpu.get_mode("custom") assert bool(custom_mode) cpu_model = custom_mode.get_model("Opteron_G4") diff --git a/tests/test_cli.py b/tests/test_cli.py index ac0419b3..bdceca49 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -799,7 +799,7 @@ c.add_invalid("--clock foo_tickpolicy=merge", grep="Unknown --clock options: ['f c.add_compare("--cpuset auto --vcpus 2", "cpuset-auto") # --cpuset=auto actually works c.add_compare("--memory hotplugmemorymax=2048,hotplugmemoryslots=2 --cpu cell0.cpus=0,cell0.memory=1048576 --memdev dimm,access=private,target_size=512,target_node=0,source_pagesize=4,source_nodemask=1-2 --memdev nvdimm,source_path=/path/to/nvdimm,target_size=512,target_node=0,target_label_size=128,alias.name=mymemdev3,target.block=2048,target.requested=1048576,target.current=524288", "memory-hotplug", precompare_check="5.3.0") c.add_compare("--memory currentMemory=100,memory=200,maxmemory=300,maxMemory=400,maxMemory.slots=1", "memory-option-backcompat", precompare_check="5.3.0") -c.add_compare("--connect " + utils.URIs.kvm_x86_q35 + " --cpu qemu64,secure=off", "cpu-disable-sec") # disable security features that are added by default +c.add_compare("--connect " + utils.URIs.kvm_x86 + " --cpu qemu64,secure=off", "cpu-disable-sec") # disable security features that are added by default c.add_compare("--cpu host-passthrough,migratable=on", "cpu-host-passthrough-migratable") # Passthrough with migratable attribute c.add_compare("--cpu host-model,model.fallback=forbid", "cpu-host-model-no-fallback") # Host-Model with fallback disabled c.add_compare("--cpu model=core2duo,model.fallback=allow,model.vendor_id=GenuineIntel", "cpu-model") # Specific CPU with fallback enabled @@ -1039,6 +1039,8 @@ c.add_compare("--osinfo generic --machine q35 --cdrom %(EXISTIMG2)s --disk %(EXI c.add_compare("--disk size=1 --os-variant openbsd4.9", "openbsd-defaults") # triggers net fallback scenario c.add_compare("--connect " + utils.URIs.kvm_x86_remote + " --import --disk %(EXISTIMG1)s --os-variant fedora21 --pm suspend_to_disk=yes", "f21-kvm-remote", prerun_check=has_old_osinfo) c.add_compare("--connect %(URI-KVM-X86)s --os-variant fedora26 --graphics spice --controller usb,model=none", "graphics-usb-disable") +c.add_compare("--osinfo generic --boot uefi --disk size=1", "boot-uefi") +c.add_compare("--osinfo generic --boot uefi --disk size=1 --tpm none --connect " + utils.URIs.kvm_x86_oldfirmware, "boot-uefi-oldcaps") c.add_valid("--arch aarch64 --nodisks --pxe --connect " + utils.URIs.kvm_x86_nodomcaps) # attempt to default to aarch64 UEFI, but it fails, but should only print warnings @@ -1055,12 +1057,9 @@ c.add_valid("--boot uefi --machine q35 --launchSecurity sev,reducedPhysBits=1,cb c.add_valid("--boot firmware=efi --machine q35 --launchSecurity sev,reducedPhysBits=1,cbitpos=47 --connect " + utils.URIs.kvm_amd_sev) # Default policy == 0x0003 will be used c.add_invalid("--launchSecurity policy=0x0001 --connect " + utils.URIs.kvm_amd_sev, grep="Missing mandatory attribute 'type'") c.add_invalid("--boot uefi --launchSecurity sev --connect " + utils.URIs.kvm_amd_sev, grep="SEV launch security requires a Q35 UEFI machine") -c.add_invalid("--boot uefi --machine q35 --launchSecurity sev,policy=0x0001 --connect " + utils.URIs.kvm_x86_q35, grep="SEV launch security is not supported") # Fail with no SEV capabilities +c.add_invalid("--boot uefi --machine q35 --launchSecurity sev,policy=0x0001 --connect " + utils.URIs.kvm_x86, grep="SEV launch security is not supported") # Fail with no SEV capabilities -c = vinst.add_category("kvm-q35", "--noautoconsole --osinfo generic --connect " + utils.URIs.kvm_x86_q35) -c.add_compare("--boot uefi --disk none", "boot-uefi") -c.add_compare("--boot uefi --disk size=8 --tpm none", "boot-uefi-notpm") c = vinst.add_category("kvm-arm", "--connect %(URI-KVM-X86)s --noautoconsole", precompare_check="3.3.0") # required qemu-xhci from libvirt 3.3.0 diff --git a/tests/test_xmlparse.py b/tests/test_xmlparse.py index 71911f55..ea02eea9 100644 --- a/tests/test_xmlparse.py +++ b/tests/test_xmlparse.py @@ -230,7 +230,7 @@ def testAlterCpuMode(): conn = utils.URIs.open_testdefault_cached() xml = open(DATADIR + "change-cpumode-in.xml").read() outfile = DATADIR + "change-cpumode-out.xml" - conn = utils.URIs.openconn(utils.URIs.kvm_x86_q35) + conn = utils.URIs.openconn(utils.URIs.kvm_x86) guest = virtinst.Guest(conn, xml) check = _make_checker(guest.cpu) diff --git a/tests/utils.py b/tests/utils.py index 84a58651..3196feaa 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -89,21 +89,21 @@ class _URIs(object): _uri_qemu = _m("qemu:///system") # KVM x86 URIs - _kvm_x86_caps = _caps("kvm-x86_64.xml") + _domcaps("kvm-x86_64-domcaps.xml") + _kvm_x86_caps = _caps("kvm-x86_64.xml") + _domcaps("kvm-x86_64-domcaps-latest.xml") self.kvm_x86_session = _m("qemu:///session") + _kvm_x86_caps self.kvm_x86 = _uri_qemu + _kvm_x86_caps self.kvm_x86_remote = _m("qemu+tls://fakeuri.example.com/system") + _kvm_x86_caps self.kvm_x86_nodomcaps = _uri_qemu + _caps("kvm-x86_64.xml") - self.kvm_x86_q35 = self.kvm_x86_nodomcaps + _domcaps("kvm-x86_64-domcaps-q35.xml") - self.kvm_x86_cpu_insecure = self.kvm_x86_nodomcaps + _domcaps("kvm-x86_64-insecure-domcaps.xml") + self.kvm_x86_cpu_insecure = self.kvm_x86_nodomcaps + _domcaps("kvm-x86_64-domcaps-insecure.xml") + self.kvm_x86_oldfirmware = self.kvm_x86_nodomcaps + _domcaps("kvm-x86_64-domcaps-oldfirmware.xml") self.kvm_amd_sev = self.kvm_x86_nodomcaps + _domcaps("kvm-x86_64-domcaps-amd-sev.xml") # Non-x86 arch URIs self.kvm_armv7l_nodomcaps = _uri_qemu + _caps("kvm-armv7l.xml") self.kvm_armv7l = self.kvm_armv7l_nodomcaps + _domcaps("kvm-armv7l-domcaps.xml") self.kvm_aarch64 = _uri_qemu + _caps("kvm-aarch64.xml") + _domcaps("kvm-aarch64-domcaps.xml") - self.kvm_ppc64le = _uri_qemu + _caps("kvm-ppc64le.xml") + _domcaps("kvm-x86_64-domcaps.xml") - self.kvm_s390x = _uri_qemu + _caps("kvm-s390x.xml") + _domcaps("kvm-x86_64-domcaps.xml") + self.kvm_ppc64le = _uri_qemu + _caps("kvm-ppc64le.xml") + _domcaps("kvm-x86_64-domcaps-latest.xml") + self.kvm_s390x = _uri_qemu + _caps("kvm-s390x.xml") + _domcaps("kvm-x86_64-domcaps-latest.xml") self.qemu_riscv64 = _uri_qemu + _caps("qemu-riscv64.xml") + _domcaps("qemu-riscv64-domcaps.xml") |