tests: move xmconfig tests to WITH_LIBXL

In preparation of removing the legacy Xen driver, move the
xmconfig tests from WITH_XEN to WITH_LIBXL. Even though the
legacy driver will be removed, we'll want to maintain the ability
to convert xm config to XML. Requires fixing up the tests to account
for different behavior of Xen vs libxl post parse functions. For
consistency with other Xen config tests, change the <os> arch to
x86_64.

There is some test file fallout due to differences in handling of
default values between xend and libxl.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Jim Fehlig
2018-04-09 11:36:17 -06:00
parent 212da33f81
commit 8ee83ea875
34 changed files with 125 additions and 172 deletions
+3 -19
View File
@@ -29,13 +29,12 @@
#include "internal.h"
#include "datatypes.h"
#include "xen/xen_driver.h"
#include "xen/xm_internal.h"
#include "xenconfig/xen_xm.h"
#include "testutils.h"
#include "testutilsxen.h"
#include "viralloc.h"
#include "virstring.h"
#include "libxl/libxl_conf.h"
#define VIR_FROM_THIS VIR_FROM_NONE
@@ -50,7 +49,6 @@ testCompareParseXML(const char *xmcfg, const char *xml)
int ret = -1;
virConnectPtr conn = NULL;
int wrote = 4096;
struct _xenUnifiedPrivate priv;
virDomainDefPtr def = NULL;
if (VIR_ALLOC_N(gotxmcfgData, wrote) < 0)
@@ -59,10 +57,6 @@ testCompareParseXML(const char *xmcfg, const char *xml)
conn = virGetConnect();
if (!conn) goto fail;
/* Many puppies died to bring you this code. */
priv.caps = caps;
conn->privateData = &priv;
if (!(def = virDomainDefParseFile(xml, caps, xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto fail;
@@ -101,20 +95,11 @@ testCompareFormatXML(const char *xmcfg, const char *xml)
char *gotxml = NULL;
virConfPtr conf = NULL;
int ret = -1;
virConnectPtr conn;
struct _xenUnifiedPrivate priv;
virDomainDefPtr def = NULL;
conn = virGetConnect();
if (!conn) goto fail;
if (virTestLoadFile(xmcfg, &xmcfgData) < 0)
goto fail;
/* Many puppies died to bring you this code. */
priv.caps = caps;
conn->privateData = &priv;
if (!(conf = virConfReadString(xmcfgData, 0)))
goto fail;
@@ -135,7 +120,6 @@ testCompareFormatXML(const char *xmcfg, const char *xml)
VIR_FREE(xmcfgData);
VIR_FREE(gotxml);
virDomainDefFree(def);
virObjectUnref(conn);
return ret;
}
@@ -180,10 +164,10 @@ mymain(void)
{
int ret = 0;
if (!(caps = testXenCapsInit()))
if (!(caps = testXLInitCaps()))
return EXIT_FAILURE;
if (!(xmlopt = xenDomainXMLConfInit()))
if (!(xmlopt = libxlCreateXMLConf()))
return EXIT_FAILURE;
#define DO_TEST_PARSE(name) \