Example #1
0
static int
testCompareXMLToXMLHelper(const void *data)
{
    const struct testInfo *info = data;
    char *xml_in = NULL;
    char *xml_out = NULL;
    int ret = -1;

    if (virAsprintf(&xml_in, "%s/qemuxml2argvdata/qemuxml2argv-%s.xml",
                    abs_srcdir, info->name) < 0 ||
        virAsprintf(&xml_out, "%s/qemuxml2xmloutdata/qemuxml2xmlout-%s.xml",
                    abs_srcdir, info->name) < 0)
        goto cleanup;

    if (info->different) {
        ret = testCompareXMLToXMLFiles(xml_in, xml_out);
    } else {
        ret = testCompareXMLToXMLFiles(xml_in, xml_in);
    }

cleanup:
    free(xml_in);
    free(xml_out);
    return ret;
}
Example #2
0
static int
testCompareXMLToXMLHelper(const void *data)
{
    const struct testInfo *info = data;
    char *xml_in = NULL;
    char *xml_out = NULL;
    int ret = -1;

    if (virAsprintf(&xml_in, "%s/qemuxml2argvdata/qemuxml2argv-%s.xml",
                    abs_srcdir, info->name) < 0 ||
        virAsprintf(&xml_out, "%s/qemuxml2xmloutdata/qemuxml2xmlout-%s.xml",
                    abs_srcdir, info->name) < 0)
        goto cleanup;

    if ((info->when & WHEN_INACTIVE) &&
        testCompareXMLToXMLFiles(xml_in,
                                 info->different ? xml_out : xml_in,
                                 false) < 0)
        goto cleanup;

    if ((info->when & WHEN_ACTIVE) &&
        testCompareXMLToXMLFiles(xml_in,
                                 info->different ? xml_out : xml_in,
                                 true) < 0)
        goto cleanup;

    ret = 0;

cleanup:
    VIR_FREE(xml_in);
    VIR_FREE(xml_out);
    return ret;
}
Example #3
0
static int
testCompareXMLToXMLHelper(const void *data)
{
    const struct testInfo *info = data;
    char *xml_in = NULL;
    char *xml_out = NULL;
    int ret = -1;

    if (virAsprintf(&xml_in, "%s/lxcxml2xmldata/lxc-%s.xml",
                    abs_srcdir, info->name) < 0 ||
        virAsprintf(&xml_out, "%s/lxcxml2xmloutdata/lxc-%s.xml",
                    abs_srcdir, info->name) < 0)
        goto cleanup;

    if (info->different) {
        ret = testCompareXMLToXMLFiles(xml_in, xml_out, false);
    } else {
        ret = testCompareXMLToXMLFiles(xml_in, xml_in, false);
    }
    if (!info->inactive_only) {
        if (info->different) {
            ret = testCompareXMLToXMLFiles(xml_in, xml_out, true);
        } else {
            ret = testCompareXMLToXMLFiles(xml_in, xml_in, true);
        }
    }

cleanup:
    VIR_FREE(xml_in);
    VIR_FREE(xml_out);
    return ret;
}
Example #4
0
static int
testCompareXMLToXMLHelper(const void *data)
{
    int result = -1;
    const struct testInfo *info = data;
    char *poolxml = NULL;
    char *inxml = NULL;
    char *outxml = NULL;

    if (virAsprintf(&poolxml, "%s/storagepoolxml2xmlin/%s.xml",
                    abs_srcdir, info->pool) < 0 ||
        virAsprintf(&inxml, "%s/storagevolxml2xmlin/%s.xml",
                    abs_srcdir, info->name) < 0 ||
        virAsprintf(&outxml, "%s/storagevolxml2xmlout/%s.xml",
                    abs_srcdir, info->name) < 0) {
        goto cleanup;
    }

    result = testCompareXMLToXMLFiles(poolxml, inxml, outxml);

cleanup:
    VIR_FREE(poolxml);
    VIR_FREE(inxml);
    VIR_FREE(outxml);

    return result;
}
static int
testCompareXMLToXMLHelper(const void *data)
{
    const struct testInfo *info = data;
    int result = -1;
    char *netxml = NULL;
    char *updatexml = NULL;
    char *outxml = NULL;

    if (virAsprintf(&netxml, "%s/networkxml2xmlin/%s.xml",
                    abs_srcdir, info->netxml) < 0 ||
        virAsprintf(&updatexml, "%s/networkxml2xmlupdatein/%s.xml",
                    abs_srcdir, info->updatexml) < 0 ||
        virAsprintf(&outxml, "%s/networkxml2xmlupdateout/%s.xml",
                    abs_srcdir, info->outxml) < 0) {
        goto cleanup;
    }

    result = testCompareXMLToXMLFiles(netxml, updatexml, outxml, info->flags,
                                      info->command, info->section,
                                      info->parentIndex, info->expectFailure);

cleanup:
    VIR_FREE(netxml);
    VIR_FREE(updatexml);
    VIR_FREE(outxml);

    return result;
}
Example #6
0
static int
testCompareXMLToXMLHelper(const void *data)
{
    int result = -1;
    char *inxml = NULL;
    char *outxml = NULL;
    const struct testInfo *info = data;

    if (virAsprintf(&inxml, "%s/secretxml2xmlin/%s.xml",
                    abs_srcdir, info->name) < 0 ||
        virAsprintf(&outxml, "%s/secretxml2xml%s/%s.xml",
                    abs_srcdir,
                    info->different ? "out" : "in",
                    info->name) < 0) {
        goto cleanup;
    }

    result = testCompareXMLToXMLFiles(inxml, outxml);

 cleanup:
    VIR_FREE(inxml);
    VIR_FREE(outxml);

    return result;
}
static int
testCompareXMLToXMLHelper(const void *data)
{
    const struct testInfo *info = data;

    return testCompareXMLToXMLFiles(info->inxml, info->outxml, info->uuid,
                                    info->internal, info->redefine);
}
static int testCompareXMLToXMLHelper(const void *data) {
    char inxml[PATH_MAX];
    char outxml[PATH_MAX];
    snprintf(inxml, PATH_MAX, "%s/networkxml2xmlin/%s.xml",
             abs_srcdir, (const char*)data);
    snprintf(outxml, PATH_MAX, "%s/networkxml2xmlout/%s.xml",
             abs_srcdir, (const char*)data);
    return testCompareXMLToXMLFiles(inxml, outxml);
}
Example #9
0
static int testCompareXMLToXMLHelper(const void *data) {
    const struct testInfo *info = data;
    char xml_in[PATH_MAX];
    char xml_out[PATH_MAX];
    int ret;

    snprintf(xml_in, PATH_MAX, "%s/qemuxml2argvdata/qemuxml2argv-%s.xml",
             abs_srcdir, info->name);
    snprintf(xml_out, PATH_MAX, "%s/qemuxml2xmloutdata/qemuxml2xmlout-%s.xml",
             abs_srcdir, info->name);

    if (info->different) {
        ret = testCompareXMLToXMLFiles(xml_in, xml_out);
    } else {
        ret = testCompareXMLToXMLFiles(xml_in, xml_in);
    }

    return ret;
}
static int testCompareXMLToXMLHelper(const void *data) {
    const test_parms *tp = data;
    char inxml[PATH_MAX];
    char outxml[PATH_MAX];
    snprintf(inxml, PATH_MAX, "%s/nwfilterxml2xmlin/%s.xml",
             abs_srcdir, tp->name);
    snprintf(outxml, PATH_MAX, "%s/nwfilterxml2xmlout/%s.xml",
             abs_srcdir, tp->name);
    return testCompareXMLToXMLFiles(inxml, outxml, tp->expect_warning);
}
static int testCompareXMLToXMLHelper(const void *data) {
    char poolxml[PATH_MAX];
    char inxml[PATH_MAX];
    char outxml[PATH_MAX];
    const struct testInfo *info = data;

    snprintf(poolxml, PATH_MAX, "%s/storagepoolxml2xmlin/%s.xml",
             abs_srcdir, (const char*)info->pool);
    snprintf(inxml, PATH_MAX, "%s/storagevolxml2xmlin/%s.xml",
             abs_srcdir, (const char*)info->name);
    snprintf(outxml, PATH_MAX, "%s/storagevolxml2xmlout/%s.xml",
             abs_srcdir, (const char*)info->name);
    return testCompareXMLToXMLFiles(poolxml, inxml, outxml);
}
Example #12
0
static int
testCompareXMLToXMLHelper(const void *data)
{
    int result = -1;
    char *xml = NULL;

    if (virAsprintf(&xml, "%s/interfaceschemadata/%s.xml",
                    abs_srcdir, (const char*)data) < 0)
        return -1;

    result = testCompareXMLToXMLFiles(xml);

    VIR_FREE(xml);
    return result;
}
Example #13
0
static int
testCompareXMLToXMLHelper(const void *data)
{
    const struct testInfo *info = data;
    char *xml_in = NULL;
    int ret = -1;

    if (virAsprintf(&xml_in, "%s/domainsnapshotxml2xmlout/%s.xml",
                    abs_srcdir, info->name) < 0)
        goto cleanup;

    ret = testCompareXMLToXMLFiles(xml_in, info->uuid, info->internal);

cleanup:
    VIR_FREE(xml_in);
    return ret;
}
static int
testCompareXMLToXMLHelper(const void *data)
{
    int result = -1;
    const test_parms *tp = data;
    char *xml = NULL;

    if (virAsprintf(&xml, "%s/virnwfilterbindingxml2xmldata/%s.xml",
                    abs_srcdir, tp->name) < 0) {
        goto cleanup;
    }

    result = testCompareXMLToXMLFiles(xml);

 cleanup:
    VIR_FREE(xml);

    return result;
}
static int
testCompareXMLToXMLHelper(const void *data)
{
    int result = -1;
    char *inxml = NULL;
    char *outxml = NULL;

    if (virAsprintf(&inxml, "%s/storagepoolxml2xmlin/%s.xml",
                    abs_srcdir, (const char*)data) < 0 ||
        virAsprintf(&outxml, "%s/storagepoolxml2xmlout/%s.xml",
                    abs_srcdir, (const char*)data) < 0) {
        goto cleanup;
    }

    result = testCompareXMLToXMLFiles(inxml, outxml);

 cleanup:
    VIR_FREE(inxml);
    VIR_FREE(outxml);

    return result;
}
Example #16
0
static int
testCompareXMLToXMLHelper(const void *data)
{
    int result = -1;
    const test_parms *tp = data;
    char *inxml = NULL;
    char *outxml = NULL;

    if (virAsprintf(&inxml, "%s/nwfilterxml2xmlin/%s.xml",
                    abs_srcdir, tp->name) < 0 ||
        virAsprintf(&outxml, "%s/nwfilterxml2xmlout/%s.xml",
                    abs_srcdir, tp->name) < 0) {
        goto cleanup;
    }

    result = testCompareXMLToXMLFiles(inxml, outxml, tp->expect_warning);

cleanup:
    VIR_FREE(inxml);
    VIR_FREE(outxml);

    return result;
}
static int
testCompareXMLToXMLHelper(const void *data)
{
    const struct testInfo *info = data;
    int result = -1;
    char *inxml = NULL;
    char *outxml = NULL;

    if (virAsprintf(&inxml, "%s/networkxml2xmlin/%s.xml",
                    abs_srcdir, info->name) < 0 ||
        virAsprintf(&outxml, "%s/networkxml2xmlout/%s.xml",
                    abs_srcdir, info->name) < 0) {
        goto cleanup;
    }

    result = testCompareXMLToXMLFiles(inxml, outxml, info->flags);

cleanup:
    free(inxml);
    free(outxml);

    return result;
}
Example #18
0
static int testCompareXMLToXMLHelper(const void *data) {
    char xml[PATH_MAX];
    snprintf(xml, PATH_MAX, "%s/qemuxml2argvdata/qemuxml2argv-%s.xml",
             abs_srcdir, (const char*)data);
    return testCompareXMLToXMLFiles(xml);
}