From: Boris Fiuczynski <fiu...@linux.ibm.com> Add tests for active/inactive XML with deprecated_features attribute.
Note that deprecated_features is not set by default when the attribute is absent while running the active/inactive tests. The active XML should contain the attribute, but it doesn't. This is because the method introduced in the previous patch to check the configured default behavior for the attribute does not get called at all -- just the method virDomainDefCheckABIStability is called. Therefore the test's expected file qemuxmlactive2xmldata/cpu-model-deprecated-features-none-active.s390x-latest.xml should really contain deprecated_features='off'. However, due to the config method not being hit, the attribute has to be omitted to ensure the test passes. Some coverage is handled via the qemuxmlconf test, which will check the expected args to see the respective features disabled when the domain XML does not contain the attribute. Signed-off-by: Boris Fiuczynski <fiu...@linux.ibm.com> Reviewed-by: Collin Walling <wall...@linux.ibm.com> --- ...ated-features-none-active.s390x-latest.xml | 25 +++++++++++++++ ...ed-features-none-inactive.s390x-latest.xml | 25 +++++++++++++++ ...cated-features-off-active.s390x-latest.xml | 25 +++++++++++++++ ...ted-features-off-inactive.s390x-latest.xml | 25 +++++++++++++++ ...ecated-features-on-active.s390x-latest.xml | 25 +++++++++++++++ ...ated-features-on-inactive.s390x-latest.xml | 25 +++++++++++++++ tests/qemuxmlactivetest.c | 11 +++++-- ...deprecated-features-none.s390x-latest.args | 32 +++++++++++++++++++ ...-deprecated-features-none.s390x-latest.xml | 25 +++++++++++++++ .../cpu-model-deprecated-features-none.xml | 15 +++++++++ tests/qemuxmlconftest.c | 1 + 11 files changed, 232 insertions(+), 2 deletions(-) create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-none-active.s390x-latest.xml create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-none-inactive.s390x-latest.xml create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-active.s390x-latest.xml create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-inactive.s390x-latest.xml create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-active.s390x-latest.xml create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-inactive.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-none.xml diff --git a/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-none-active.s390x-latest.xml b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-none-active.s390x-latest.xml new file mode 100644 index 0000000000..bed2ea8552 --- /dev/null +++ b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-none-active.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm' id='1337'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-none-inactive.s390x-latest.xml b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-none-inactive.s390x-latest.xml new file mode 100644 index 0000000000..e4d688ab44 --- /dev/null +++ b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-none-inactive.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-active.s390x-latest.xml b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-active.s390x-latest.xml new file mode 100644 index 0000000000..c5761b1f89 --- /dev/null +++ b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-active.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm' id='1337'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial' deprecated_features='off'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-inactive.s390x-latest.xml b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-inactive.s390x-latest.xml new file mode 100644 index 0000000000..fdd87acb1d --- /dev/null +++ b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-inactive.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial' deprecated_features='off'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-active.s390x-latest.xml b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-active.s390x-latest.xml new file mode 100644 index 0000000000..789b7ba018 --- /dev/null +++ b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-active.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm' id='1337'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial' deprecated_features='on'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-inactive.s390x-latest.xml b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-inactive.s390x-latest.xml new file mode 100644 index 0000000000..3bea664f40 --- /dev/null +++ b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-inactive.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial' deprecated_features='on'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlactivetest.c b/tests/qemuxmlactivetest.c index de2b1e48eb..c63441c8b9 100644 --- a/tests/qemuxmlactivetest.c +++ b/tests/qemuxmlactivetest.c @@ -232,9 +232,12 @@ mymain(void) virSetConnectSecret(conn); virSetConnectStorage(conn); +#define DO_TEST_ACTIVE_CAPS_ARCH_LATEST(_name, arch) \ + testRunActive(_name, "." arch "-latest", &testConf, &ret, \ + ARG_CAPS_ARCH, arch, ARG_CAPS_VER, "latest", ARG_END); + #define DO_TEST_ACTIVE_CAPS_LATEST(_name) \ - testRunActive(_name, ".x86_64-latest", &testConf, &ret, \ - ARG_CAPS_ARCH, "x86_64", ARG_CAPS_VER, "latest", ARG_END); + DO_TEST_ACTIVE_CAPS_ARCH_LATEST(_name, "x86_64"); DO_TEST_ACTIVE_CAPS_LATEST("channel-unix-source-path"); DO_TEST_ACTIVE_CAPS_LATEST("channel-virtio-state"); @@ -247,6 +250,10 @@ mymain(void) DO_TEST_ACTIVE_CAPS_LATEST("graphics-vnc-remove-generated-socket"); DO_TEST_ACTIVE_CAPS_LATEST("seclabel-static-labelskip"); + DO_TEST_ACTIVE_CAPS_ARCH_LATEST("cpu-model-deprecated-features-on", "s390x"); + DO_TEST_ACTIVE_CAPS_ARCH_LATEST("cpu-model-deprecated-features-off", "s390x"); + DO_TEST_ACTIVE_CAPS_ARCH_LATEST("cpu-model-deprecated-features-none", "s390x"); + #define DO_TEST_STATUS(_name) \ do { \ if (testRunStatus(_name, &testConf, ARG_END) < 0) \ diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args new file mode 100644 index 0000000000..ba6e7c5304 --- /dev/null +++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args @@ -0,0 +1,32 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ +-accel kvm \ +-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=off,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=off,ais=on,bpb=off,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=off,cmm=on,vxpdeh2=on \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 22782664-6b93-46bf-9595-317220dd2d1c \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0000"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.xml b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.xml new file mode 100644 index 0000000000..e4d688ab44 --- /dev/null +++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.xml b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.xml new file mode 100644 index 0000000000..5b3c57adb2 --- /dev/null +++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.xml @@ -0,0 +1,15 @@ +<domain type='kvm'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <cpu mode='host-model' check='partial'/> + <clock offset='utc'/> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 5615a7b130..7281497344 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2283,6 +2283,7 @@ mymain(void) DO_TEST_CAPS_ARCH_VER_FAILURE("cpu-model-deprecated-features-off", "s390x", "8.2.0"); DO_TEST_CAPS_ARCH_LATEST("cpu-model-deprecated-features-off", "s390x"); DO_TEST_CAPS_ARCH_LATEST("cpu-model-deprecated-features-on", "s390x"); + DO_TEST_CAPS_ARCH_LATEST("cpu-model-deprecated-features-none", "s390x"); DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-Haswell", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL); DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-Haswell2", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL); -- 2.47.1