mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
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:
+3
-19
@@ -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) \
|
||||
|
||||
Reference in New Issue
Block a user