6 #include "secret_conf.h"
8 #define VIR_FROM_THIS VIR_FROM_NONE
11 testCompareXMLToXMLFiles(const char *inxml
, const char *outxml
)
15 virSecretDefPtr secret
= NULL
;
17 if (!(secret
= virSecretDefParseFile(inxml
)))
20 if (!(actual
= virSecretDefFormat(secret
)))
23 if (virTestCompareToFile(actual
, outxml
) < 0)
30 virSecretDefFree(secret
);
40 testCompareXMLToXMLHelper(const void *data
)
45 const struct testInfo
*info
= data
;
47 if (virAsprintf(&inxml
, "%s/secretxml2xmlin/%s.xml",
48 abs_srcdir
, info
->name
) < 0 ||
49 virAsprintf(&outxml
, "%s/secretxml2xml%s/%s.xml",
51 info
->different
? "out" : "in",
56 result
= testCompareXMLToXMLFiles(inxml
, outxml
);
70 #define DO_TEST(name) \
72 const struct testInfo info = {name, false}; \
73 if (virTestRun("Secret XML->XML " name, \
74 testCompareXMLToXMLHelper, &info) < 0) \
78 DO_TEST("ephemeral-usage-volume");
79 DO_TEST("usage-volume");
80 DO_TEST("usage-ceph");
81 DO_TEST("usage-iscsi");
84 return ret
== 0 ? EXIT_SUCCESS
: EXIT_FAILURE
;