10 #include "storage_conf.h"
11 #include "testutilsqemu.h"
12 #include "virstring.h"
14 #include "storage/storage_util.h"
16 #define VIR_FROM_THIS VIR_FROM_NONE
19 testCompareXMLToXMLFiles(const char *inxml
, const char *outxml
)
21 VIR_AUTOFREE(char *) actual
= NULL
;
22 VIR_AUTOPTR(virStoragePoolDef
) dev
= NULL
;
24 if (!(dev
= virStoragePoolDefParseFile(inxml
)))
27 if (!(actual
= virStoragePoolDefFormat(dev
)))
30 if (virTestCompareToFile(actual
, outxml
) < 0)
37 testCompareXMLToXMLHelper(const void *data
)
39 VIR_AUTOFREE(char *) inxml
= NULL
;
40 VIR_AUTOFREE(char *) outxml
= NULL
;
42 if (virAsprintf(&inxml
, "%s/storagepoolxml2xmlin/%s.xml",
43 abs_srcdir
, (const char*)data
) < 0 ||
44 virAsprintf(&outxml
, "%s/storagepoolxml2xmlout/%s.xml",
45 abs_srcdir
, (const char*)data
) < 0)
48 return testCompareXMLToXMLFiles(inxml
, outxml
);
56 #define DO_TEST(name) \
57 if (virTestRun("Storage Pool XML-2-XML " name, \
58 testCompareXMLToXMLHelper, (name)) < 0) \
61 if (storageRegisterAll() < 0)
65 DO_TEST("pool-dir-naming");
67 DO_TEST("pool-logical");
68 DO_TEST("pool-logical-nopath");
69 DO_TEST("pool-logical-create");
70 DO_TEST("pool-logical-noname");
72 DO_TEST("pool-disk-device-nopartsep");
73 DO_TEST("pool-iscsi");
74 DO_TEST("pool-iscsi-auth");
75 DO_TEST("pool-netfs");
76 DO_TEST("pool-netfs-slash");
77 DO_TEST("pool-netfs-auto");
78 DO_TEST("pool-netfs-protocol-ver");
79 DO_TEST("pool-netfs-gluster");
80 DO_TEST("pool-netfs-cifs");
81 #ifdef WITH_STORAGE_FS
82 DO_TEST("pool-netfs-ns-mountopts");
85 DO_TEST("pool-scsi-type-scsi-host");
86 DO_TEST("pool-scsi-type-fc-host");
87 DO_TEST("pool-scsi-type-fc-host-managed");
88 DO_TEST("pool-mpath");
89 DO_TEST("pool-iscsi-multiiqn");
90 DO_TEST("pool-iscsi-vendor-product");
91 DO_TEST("pool-sheepdog");
92 DO_TEST("pool-gluster");
93 DO_TEST("pool-gluster-sub");
94 DO_TEST("pool-scsi-type-scsi-host-stable");
96 DO_TEST("pool-zfs-sourcedev");
98 #ifdef WITH_STORAGE_RBD
99 DO_TEST("pool-rbd-ipv6");
100 DO_TEST("pool-rbd-refresh-volume-allocation");
101 DO_TEST("pool-rbd-ns-configopts");
103 DO_TEST("pool-vstorage");
104 DO_TEST("pool-iscsi-direct-auth");
105 DO_TEST("pool-iscsi-direct");
107 return ret
== 0 ? EXIT_SUCCESS
: EXIT_FAILURE
;
110 VIR_TEST_MAIN(mymain
)