]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tests: refactor pseries features parse failure tests
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Thu, 15 Sep 2022 16:22:08 +0000 (13:22 -0300)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Thu, 13 Oct 2022 19:28:01 +0000 (16:28 -0300)
commit06ebad7c783fc44b23284c86cbaf4052f99834fd
treee03ea51a3ff4bb76464c9ccb3256949d7d84c694
parent8ff73d22c7405049452e2bf7f281f7460a6b9d10
tests: refactor pseries features parse failure tests

The qemuxml2argvtest pseries-feature parse failure tests uses a symlink
to the pseries-features.xml test domain and control which feature it is
supposed to fail by excluding it from the capabilities list. The
advantage of this approach is that the same XML can be used in multiple
tests.

One downside is that any new pseries capability must be declared in all
existent tests, otherwise all other tests can break if this new
capability happens to be validated early in qemu_validate.c. Any new
parse_error test must declare all other existent capabilities.

Another downside is the fact that we're testing fairly improbable
scenarios: all pseries capabilities being tested here were introduced by
the same QEMU version, 4.2.0, at least as far as libvirt is aware of.
This means that it's no possible to have a scenario where, for example,
ccf-assist is not present but cfpc is. And last, but not the least, it's
getting in the way of our effort to convert all pseries tests to not use
explicit capabilities.

Changing all these tests to use DO_TEST_PARSE_ERROR_NOCAPS() will allow
us to test exactly what we want to test, which is the parse error given
for each feature if the binary does not have support for it. The XML
being used for each test can be simplified to just declare a single
feature. In the end we'll end up with more XML lines, but less
complexity inside qemuxml2argvtest.c.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
tests/qemuxml2argvdata/pseries-features-ccf.xml [changed from symlink to file mode: 0644]
tests/qemuxml2argvdata/pseries-features-cfpc.xml [changed from symlink to file mode: 0644]
tests/qemuxml2argvdata/pseries-features-hpt-pagesize.xml [changed from symlink to file mode: 0644]
tests/qemuxml2argvdata/pseries-features-htm.xml [changed from symlink to file mode: 0644]
tests/qemuxml2argvdata/pseries-features-ibs.xml [changed from symlink to file mode: 0644]
tests/qemuxml2argvdata/pseries-features-nested-hv.xml [changed from symlink to file mode: 0644]
tests/qemuxml2argvdata/pseries-features-sbbc.xml [changed from symlink to file mode: 0644]
tests/qemuxml2argvtest.c