Move the FIPS detection from capabilities

We are not detecting the presence of FIPS from QEMU, but from procfs and
that means it's not QEMU capability. It was decided that we will pass
this flag to QEMU even if it's not supported by old QEMU binaries.

This patch also reverts changes done by commit a21cfb0f to
qemucapabilitestest and implements a new test case in qemuxml2argvtest.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1135431

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina
2014-09-18 17:38:32 +02:00
parent ba7468dbb1
commit da7799d879
12 changed files with 89 additions and 49 deletions

View File

@@ -31,7 +31,6 @@ typedef testQemuData *testQemuDataPtr;
struct _testQemuData {
virDomainXMLOptionPtr xmlopt;
const char *base;
bool fips;
};
static qemuMonitorTestPtr
@@ -143,12 +142,6 @@ testQemuCaps(const void *opaque)
qemuMonitorTestGetMonitor(mon)) < 0)
goto cleanup;
/* So that our test does not depend on the contents of /proc, we
* hoisted the setting of ENABLE_FIPS to virQEMUCapsInitQMP. But
* we do want to test the effect of that flag. */
if (data->fips)
virQEMUCapsSet(capsComputed, QEMU_CAPS_ENABLE_FIPS);
if (testQemuCapsCompare(capsProvided, capsComputed) < 0)
goto cleanup;
@@ -183,19 +176,18 @@ mymain(void)
data.xmlopt = xmlopt;
#define DO_TEST_FULL(name, use_fips) \
data.base = name; \
data.fips = use_fips; \
if (virtTestRun(name, testQemuCaps, &data) < 0) \
ret = -1
#define DO_TEST(name) \
do { \
data.base = name; \
if (virtTestRun(name, testQemuCaps, &data) < 0) \
ret = -1; \
} while (0)
#define DO_TEST(name) DO_TEST_FULL(name, false)
DO_TEST_FULL("caps_1.2.2-1", true);
DO_TEST("caps_1.2.2-1");
DO_TEST("caps_1.3.1-1");
DO_TEST("caps_1.4.2-1");
DO_TEST("caps_1.5.3-1");
DO_TEST_FULL("caps_1.6.0-1", true);
DO_TEST("caps_1.6.0-1");
DO_TEST("caps_1.6.50-1");
virObjectUnref(xmlopt);