mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
convert TAB-based indentation in C sources to use only spaces
Done using this command (also includes .c.in and .h.in files): for i in $(g ls-files|grep -E '\.[ch](\.in)?$'|grep -v gnulib); do expand -i $i > j && mv j $i;done
This commit is contained in:
@@ -15,23 +15,23 @@ int main(int argc, char **argv) {
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s conf_file\n", argv[0]);
|
||||
exit(1);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
conf = virConfReadFile(argv[1]);
|
||||
if (conf == NULL) {
|
||||
fprintf(stderr, "Failed to process %s\n", argv[1]);
|
||||
exit(2);
|
||||
exit(2);
|
||||
}
|
||||
ret = virConfWriteMem(&buffer[0], &len, conf);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Failed to serialize %s back\n", argv[1]);
|
||||
exit(3);
|
||||
exit(3);
|
||||
}
|
||||
virConfFree(conf);
|
||||
if (fwrite(buffer, 1, len, stdout) != len) {
|
||||
fprintf(stderr, "Write failed: %s\n", strerror (errno));
|
||||
exit(1);
|
||||
fprintf(stderr, "Write failed: %s\n", strerror (errno));
|
||||
exit(1);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ main(int argc, char **argv)
|
||||
|
||||
for (i = 0 ; i < (sizeof(nodeData)/sizeof(nodeData[0])) ; i++)
|
||||
if (virtTestRun(nodeData[i], 1, linuxTestNodeInfo, nodeData[i]) != 0)
|
||||
ret = -1;
|
||||
ret = -1;
|
||||
#endif
|
||||
|
||||
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "internal.h"
|
||||
|
||||
static void errorHandler(void *userData ATTRIBUTE_UNUSED,
|
||||
virErrorPtr error ATTRIBUTE_UNUSED) {
|
||||
virErrorPtr error ATTRIBUTE_UNUSED) {
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
@@ -22,31 +22,31 @@ int main(void) {
|
||||
conn = virConnectOpen(NULL);
|
||||
if (conn == NULL) {
|
||||
ro = 1;
|
||||
conn = virConnectOpenReadOnly(NULL);
|
||||
conn = virConnectOpenReadOnly(NULL);
|
||||
}
|
||||
if (conn == NULL) {
|
||||
fprintf(stderr, "First virConnectOpen() failed\n");
|
||||
exit(1);
|
||||
exit(1);
|
||||
}
|
||||
dom = virDomainLookupByID(conn, id);
|
||||
if (dom == NULL) {
|
||||
fprintf(stderr, "First lookup for domain %d failed\n", id);
|
||||
exit(1);
|
||||
exit(1);
|
||||
}
|
||||
virDomainFree(dom);
|
||||
virConnectClose(conn);
|
||||
if (ro == 1)
|
||||
conn = virConnectOpenReadOnly(NULL);
|
||||
conn = virConnectOpenReadOnly(NULL);
|
||||
else
|
||||
conn = virConnectOpen(NULL);
|
||||
conn = virConnectOpen(NULL);
|
||||
if (conn == NULL) {
|
||||
fprintf(stderr, "Second virConnectOpen() failed\n");
|
||||
exit(1);
|
||||
exit(1);
|
||||
}
|
||||
dom = virDomainLookupByID(conn, id);
|
||||
if (dom == NULL) {
|
||||
fprintf(stderr, "Second lookup for domain %d failed\n", id);
|
||||
exit(1);
|
||||
exit(1);
|
||||
}
|
||||
virDomainFree(dom);
|
||||
virConnectClose(conn);
|
||||
|
||||
@@ -57,20 +57,20 @@ static int testCompareFiles(const char *xml_rel, const char *sexpr_rel,
|
||||
|
||||
static int testComparePVversion1(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-pv.xml",
|
||||
"sexpr2xmldata/sexpr2xml-pv.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-pv.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareFVversion1(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-fv.xml",
|
||||
"sexpr2xmldata/sexpr2xml-fv.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-fv.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testComparePVversion2(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-pv.xml",
|
||||
"sexpr2xmldata/sexpr2xml-pv.sexpr",
|
||||
2);
|
||||
"sexpr2xmldata/sexpr2xml-pv.sexpr",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testComparePVOrigVFB(const void *data ATTRIBUTE_UNUSED) {
|
||||
@@ -89,105 +89,105 @@ static int testComparePVNewVFB(const void *data ATTRIBUTE_UNUSED) {
|
||||
|
||||
static int testCompareFVversion2(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-v2.xml",
|
||||
"sexpr2xmldata/sexpr2xml-fv-v2.sexpr",
|
||||
2);
|
||||
"sexpr2xmldata/sexpr2xml-fv-v2.sexpr",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testComparePVBootloader(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-pv-bootloader.xml",
|
||||
"sexpr2xmldata/sexpr2xml-pv-bootloader.sexpr",
|
||||
2);
|
||||
"sexpr2xmldata/sexpr2xml-pv-bootloader.sexpr",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareDiskFile(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-disk-file.xml",
|
||||
"sexpr2xmldata/sexpr2xml-disk-file.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-disk-file.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareDiskBlock(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-disk-block.xml",
|
||||
"sexpr2xmldata/sexpr2xml-disk-block.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-disk-block.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareDiskShareable(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-disk-block-shareable.xml",
|
||||
"sexpr2xmldata/sexpr2xml-disk-block-shareable.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-disk-block-shareable.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareDiskDrvBlktapQcow(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml",
|
||||
"sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareDiskDrvBlktapRaw(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml",
|
||||
"sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareResizedMemory(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-curmem.xml",
|
||||
"sexpr2xmldata/sexpr2xml-curmem.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-curmem.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
|
||||
static int testCompareNetRouted(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-net-routed.xml",
|
||||
"sexpr2xmldata/sexpr2xml-net-routed.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-net-routed.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareNetBridged(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-net-bridged.xml",
|
||||
"sexpr2xmldata/sexpr2xml-net-bridged.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-net-bridged.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareNoSourceCDRom(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-no-source-cdrom.xml",
|
||||
"sexpr2xmldata/sexpr2xml-no-source-cdrom.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-no-source-cdrom.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareFVInputUSBMouse(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-usbmouse.xml",
|
||||
"sexpr2xmldata/sexpr2xml-fv-usbmouse.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-fv-usbmouse.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareFVInputUSBTablet(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-usbtablet.xml",
|
||||
"sexpr2xmldata/sexpr2xml-fv-usbtablet.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-fv-usbtablet.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareFVclockUTC(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-utc.xml",
|
||||
"sexpr2xmldata/sexpr2xml-fv-utc.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-fv-utc.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareFVclockLocaltime(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-localtime.xml",
|
||||
"sexpr2xmldata/sexpr2xml-fv-localtime.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-fv-localtime.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareFVKernel(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-kernel.xml",
|
||||
"sexpr2xmldata/sexpr2xml-fv-kernel.sexpr",
|
||||
1);
|
||||
"sexpr2xmldata/sexpr2xml-fv-kernel.sexpr",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareFVLegacyVFB(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml",
|
||||
"sexpr2xmldata/sexpr2xml-fv-legacy-vfb.sexpr",
|
||||
4);
|
||||
"sexpr2xmldata/sexpr2xml-fv-legacy-vfb.sexpr",
|
||||
4);
|
||||
}
|
||||
|
||||
|
||||
@@ -199,27 +199,27 @@ main(int argc, char **argv)
|
||||
progname = argv[0];
|
||||
|
||||
if (argc > 1) {
|
||||
fprintf(stderr, "Usage: %s\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
fprintf(stderr, "Usage: %s\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
abs_top_srcdir = getenv("abs_top_srcdir");
|
||||
if (!abs_top_srcdir) {
|
||||
fprintf(stderr, "missing enviroment variable abs_top_srcdir\n");
|
||||
exit(EXIT_FAILURE);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML PV config (version 1)",
|
||||
1, testComparePVversion1, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testComparePVversion1, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML FV config (version 1)",
|
||||
1, testCompareFVversion1, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVversion1, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML PV config (version 2)",
|
||||
1, testComparePVversion2, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testComparePVversion2, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML PV config (Orig VFB)",
|
||||
1, testComparePVOrigVFB, NULL) != 0)
|
||||
@@ -230,71 +230,71 @@ main(int argc, char **argv)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML FV config (version 2)",
|
||||
1, testCompareFVversion2, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVversion2, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML PV config bootloader",
|
||||
1, testComparePVBootloader, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testComparePVBootloader, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML Disk File config",
|
||||
1, testCompareDiskFile, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskFile, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML Disk Block config",
|
||||
1, testCompareDiskBlock, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskBlock, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML Disk Block shareable",
|
||||
1, testCompareDiskShareable, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskShareable, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML Disk Driver blktap qcow config",
|
||||
1, testCompareDiskDrvBlktapQcow, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskDrvBlktapQcow, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML Disk Driver blktap raw config",
|
||||
1, testCompareDiskDrvBlktapRaw, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskDrvBlktapRaw, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML Resized memory config",
|
||||
1, testCompareResizedMemory, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareResizedMemory, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML net routed",
|
||||
1, testCompareNetRouted, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareNetRouted, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML net bridged",
|
||||
1, testCompareNetBridged, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareNetBridged, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML no source CDRom",
|
||||
1, testCompareNoSourceCDRom, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareNoSourceCDRom, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML USB Mouse",
|
||||
1, testCompareFVInputUSBMouse, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVInputUSBMouse, NULL) != 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("SEXPR-2-XML USB Tablet",
|
||||
1, testCompareFVInputUSBTablet, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVInputUSBTablet, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML clock UTC",
|
||||
1, testCompareFVclockUTC, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVclockUTC, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML clock Localtime",
|
||||
1, testCompareFVclockLocaltime, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVclockLocaltime, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML FV kernel",
|
||||
1, testCompareFVKernel, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVKernel, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("SEXPR-2-XML FV legacy VFB",
|
||||
1, testCompareFVLegacyVFB, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVLegacyVFB, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ static char *abs_top_srcdir;
|
||||
#define MAX_FILE 4096
|
||||
|
||||
static int testFilterLine(char *buffer,
|
||||
const char *toRemove) {
|
||||
const char *toRemove) {
|
||||
char *start;
|
||||
char *end;
|
||||
|
||||
@@ -78,8 +78,8 @@ static int testCompareListDefault(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/list-default.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
static int testCompareListCustom(const void *data ATTRIBUTE_UNUSED) {
|
||||
@@ -89,8 +89,8 @@ static int testCompareListCustom(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/list-custom.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,8 +101,8 @@ static int testCompareNodeinfoDefault(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/nodeinfo-default.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
static int testCompareNodeinfoCustom(const void *data ATTRIBUTE_UNUSED) {
|
||||
@@ -112,8 +112,8 @@ static int testCompareNodeinfoCustom(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/nodeinfo-custom.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
static int testCompareDominfoByID(const void *data ATTRIBUTE_UNUSED) {
|
||||
@@ -124,8 +124,8 @@ static int testCompareDominfoByID(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/dominfo-fc4.txt",
|
||||
"\nCPU time:",
|
||||
argv);
|
||||
"\nCPU time:",
|
||||
argv);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,8 +137,8 @@ static int testCompareDominfoByUUID(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/dominfo-fc4.txt",
|
||||
"\nCPU time:",
|
||||
argv);
|
||||
"\nCPU time:",
|
||||
argv);
|
||||
}
|
||||
|
||||
|
||||
@@ -150,8 +150,8 @@ static int testCompareDominfoByName(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/dominfo-fc4.txt",
|
||||
"\nCPU time:",
|
||||
argv);
|
||||
"\nCPU time:",
|
||||
argv);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,8 +163,8 @@ static int testCompareDomuuidByID(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/domuuid-fc4.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
static int testCompareDomuuidByName(const void *data ATTRIBUTE_UNUSED) {
|
||||
@@ -175,8 +175,8 @@ static int testCompareDomuuidByName(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/domuuid-fc4.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
static int testCompareDomidByName(const void *data ATTRIBUTE_UNUSED) {
|
||||
@@ -187,8 +187,8 @@ static int testCompareDomidByName(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/domid-fc4.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
|
||||
@@ -200,8 +200,8 @@ static int testCompareDomidByUUID(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/domid-fc4.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
|
||||
@@ -213,8 +213,8 @@ static int testCompareDomnameByID(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/domname-fc4.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
|
||||
@@ -226,8 +226,8 @@ static int testCompareDomnameByUUID(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/domname-fc4.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
static int testCompareDomstateByID(const void *data ATTRIBUTE_UNUSED) {
|
||||
@@ -238,8 +238,8 @@ static int testCompareDomstateByID(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/domstate-fc4.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
|
||||
@@ -251,8 +251,8 @@ static int testCompareDomstateByUUID(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/domstate-fc4.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
static int testCompareDomstateByName(const void *data ATTRIBUTE_UNUSED) {
|
||||
@@ -263,8 +263,8 @@ static int testCompareDomstateByName(const void *data ATTRIBUTE_UNUSED) {
|
||||
NULL
|
||||
};
|
||||
return testCompareOutput("virshdata/domstate-fc4.txt",
|
||||
NULL,
|
||||
argv);
|
||||
NULL,
|
||||
argv);
|
||||
}
|
||||
|
||||
|
||||
@@ -290,67 +290,67 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (virtTestRun("virsh list (default)",
|
||||
1, testCompareListDefault, NULL) != 0)
|
||||
1, testCompareListDefault, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh list (custom)",
|
||||
1, testCompareListCustom, NULL) != 0)
|
||||
1, testCompareListCustom, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh nodeinfo (default)",
|
||||
1, testCompareNodeinfoDefault, NULL) != 0)
|
||||
1, testCompareNodeinfoDefault, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh nodeinfo (custom)",
|
||||
1, testCompareNodeinfoCustom, NULL) != 0)
|
||||
1, testCompareNodeinfoCustom, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh dominfo (by id)",
|
||||
1, testCompareDominfoByID, NULL) != 0)
|
||||
1, testCompareDominfoByID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh dominfo (by uuid)",
|
||||
1, testCompareDominfoByUUID, NULL) != 0)
|
||||
1, testCompareDominfoByUUID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh dominfo (by name)",
|
||||
1, testCompareDominfoByName, NULL) != 0)
|
||||
1, testCompareDominfoByName, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domid (by name)",
|
||||
1, testCompareDomidByName, NULL) != 0)
|
||||
1, testCompareDomidByName, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domid (by uuid)",
|
||||
1, testCompareDomidByUUID, NULL) != 0)
|
||||
1, testCompareDomidByUUID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domuuid (by id)",
|
||||
1, testCompareDomuuidByID, NULL) != 0)
|
||||
1, testCompareDomuuidByID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domuuid (by name)",
|
||||
1, testCompareDomuuidByName, NULL) != 0)
|
||||
1, testCompareDomuuidByName, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domname (by id)",
|
||||
1, testCompareDomnameByID, NULL) != 0)
|
||||
1, testCompareDomnameByID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domname (by uuid)",
|
||||
1, testCompareDomnameByUUID, NULL) != 0)
|
||||
1, testCompareDomnameByUUID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domstate (by id)",
|
||||
1, testCompareDomstateByID, NULL) != 0)
|
||||
1, testCompareDomstateByID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domstate (by uuid)",
|
||||
1, testCompareDomstateByUUID, NULL) != 0)
|
||||
1, testCompareDomstateByUUID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domstate (by name)",
|
||||
1, testCompareDomstateByName, NULL) != 0)
|
||||
1, testCompareDomstateByName, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
|
||||
@@ -74,23 +74,23 @@ static int testCompareFiles(const char *hostmachine,
|
||||
|
||||
static int testXeni686(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("i686",
|
||||
"xencapsdata/xen-i686.xml",
|
||||
"xencapsdata/xen-i686.cpuinfo",
|
||||
"xencapsdata/xen-i686.caps");
|
||||
"xencapsdata/xen-i686.xml",
|
||||
"xencapsdata/xen-i686.cpuinfo",
|
||||
"xencapsdata/xen-i686.caps");
|
||||
}
|
||||
|
||||
static int testXeni686PAE(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("i686",
|
||||
"xencapsdata/xen-i686-pae.xml",
|
||||
"xencapsdata/xen-i686-pae.cpuinfo",
|
||||
"xencapsdata/xen-i686-pae.caps");
|
||||
"xencapsdata/xen-i686-pae.xml",
|
||||
"xencapsdata/xen-i686-pae.cpuinfo",
|
||||
"xencapsdata/xen-i686-pae.caps");
|
||||
}
|
||||
|
||||
static int testXeni686PAEHVM(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("i686",
|
||||
"xencapsdata/xen-i686-pae-hvm.xml",
|
||||
"xencapsdata/xen-i686-pae-hvm.cpuinfo",
|
||||
"xencapsdata/xen-i686-pae-hvm.caps");
|
||||
"xencapsdata/xen-i686-pae-hvm.xml",
|
||||
"xencapsdata/xen-i686-pae-hvm.cpuinfo",
|
||||
"xencapsdata/xen-i686-pae-hvm.caps");
|
||||
}
|
||||
|
||||
/* No PAE + HVM is non-sensical - all VMX capable
|
||||
@@ -98,56 +98,56 @@ static int testXeni686PAEHVM(const void *data ATTRIBUTE_UNUSED) {
|
||||
/*
|
||||
static int testXeni686HVM(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("i686",
|
||||
"xencapsdata/xen-i686-hvm.xml",
|
||||
"xencapsdata/xen-i686.cpuinfo",
|
||||
"xencapsdata/xen-i686-hvm.caps");
|
||||
"xencapsdata/xen-i686-hvm.xml",
|
||||
"xencapsdata/xen-i686.cpuinfo",
|
||||
"xencapsdata/xen-i686-hvm.caps");
|
||||
}
|
||||
*/
|
||||
|
||||
static int testXenx86_64(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("x86_64",
|
||||
"xencapsdata/xen-x86_64.xml",
|
||||
"xencapsdata/xen-x86_64.cpuinfo",
|
||||
"xencapsdata/xen-x86_64.caps");
|
||||
"xencapsdata/xen-x86_64.xml",
|
||||
"xencapsdata/xen-x86_64.cpuinfo",
|
||||
"xencapsdata/xen-x86_64.caps");
|
||||
}
|
||||
static int testXenx86_64HVM(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("x86_64",
|
||||
"xencapsdata/xen-x86_64-hvm.xml",
|
||||
"xencapsdata/xen-x86_64-hvm.cpuinfo",
|
||||
"xencapsdata/xen-x86_64-hvm.caps");
|
||||
"xencapsdata/xen-x86_64-hvm.xml",
|
||||
"xencapsdata/xen-x86_64-hvm.cpuinfo",
|
||||
"xencapsdata/xen-x86_64-hvm.caps");
|
||||
}
|
||||
|
||||
static int testXenia64(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("ia64",
|
||||
"xencapsdata/xen-ia64.xml",
|
||||
"xencapsdata/xen-ia64.cpuinfo",
|
||||
"xencapsdata/xen-ia64.caps");
|
||||
"xencapsdata/xen-ia64.xml",
|
||||
"xencapsdata/xen-ia64.cpuinfo",
|
||||
"xencapsdata/xen-ia64.caps");
|
||||
}
|
||||
static int testXenia64BE(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("ia64",
|
||||
"xencapsdata/xen-ia64-be.xml",
|
||||
"xencapsdata/xen-ia64-be.cpuinfo",
|
||||
"xencapsdata/xen-ia64-be.caps");
|
||||
"xencapsdata/xen-ia64-be.xml",
|
||||
"xencapsdata/xen-ia64-be.cpuinfo",
|
||||
"xencapsdata/xen-ia64-be.caps");
|
||||
}
|
||||
|
||||
static int testXenia64HVM(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("ia64",
|
||||
"xencapsdata/xen-ia64-hvm.xml",
|
||||
"xencapsdata/xen-ia64-hvm.cpuinfo",
|
||||
"xencapsdata/xen-ia64-hvm.caps");
|
||||
"xencapsdata/xen-ia64-hvm.xml",
|
||||
"xencapsdata/xen-ia64-hvm.cpuinfo",
|
||||
"xencapsdata/xen-ia64-hvm.caps");
|
||||
}
|
||||
static int testXenia64BEHVM(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("ia64",
|
||||
"xencapsdata/xen-ia64-be-hvm.xml",
|
||||
"xencapsdata/xen-ia64-be-hvm.cpuinfo",
|
||||
"xencapsdata/xen-ia64-be-hvm.caps");
|
||||
"xencapsdata/xen-ia64-be-hvm.xml",
|
||||
"xencapsdata/xen-ia64-be-hvm.cpuinfo",
|
||||
"xencapsdata/xen-ia64-be-hvm.caps");
|
||||
}
|
||||
|
||||
static int testXenppc64(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("ppc64",
|
||||
"xencapsdata/xen-ppc64.xml",
|
||||
"xencapsdata/xen-ppc64.cpuinfo",
|
||||
"xencapsdata/xen-ppc64.caps");
|
||||
"xencapsdata/xen-ppc64.xml",
|
||||
"xencapsdata/xen-ppc64.cpuinfo",
|
||||
"xencapsdata/xen-ppc64.caps");
|
||||
}
|
||||
|
||||
|
||||
@@ -159,8 +159,8 @@ main(int argc, char **argv)
|
||||
progname = argv[0];
|
||||
|
||||
if (argc > 1) {
|
||||
fprintf(stderr, "Usage: %s\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
fprintf(stderr, "Usage: %s\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
abs_top_srcdir = getenv("abs_top_srcdir");
|
||||
@@ -170,51 +170,51 @@ main(int argc, char **argv)
|
||||
virInitialize();
|
||||
|
||||
if (virtTestRun("Capabilities for i686, no PAE, no HVM",
|
||||
1, testXeni686, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testXeni686, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Capabilities for i686, PAE, no HVM",
|
||||
1, testXeni686PAE, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testXeni686PAE, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
/* No PAE + HVM is non-sensical - all VMX capable
|
||||
CPUs have PAE */
|
||||
/*if (virtTestRun("Capabilities for i686, no PAE, HVM",
|
||||
1, testXeni686HVM, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testXeni686HVM, NULL) != 0)
|
||||
ret = -1;
|
||||
*/
|
||||
|
||||
if (virtTestRun("Capabilities for i686, PAE, HVM",
|
||||
1, testXeni686PAEHVM, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testXeni686PAEHVM, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Capabilities for x86_64, no HVM",
|
||||
1, testXenx86_64, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testXenx86_64, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Capabilities for x86_64, HVM",
|
||||
1, testXenx86_64HVM, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testXenx86_64HVM, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Capabilities for ia64, no HVM, LE",
|
||||
1, testXenia64, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testXenia64, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Capabilities for ia64, HVM, LE",
|
||||
1, testXenia64HVM, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testXenia64HVM, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Capabilities for ia64, no HVM, BE",
|
||||
1, testXenia64BE, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testXenia64BE, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Capabilities for ia64, HVM, BE",
|
||||
1, testXenia64BEHVM, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testXenia64BEHVM, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Capabilities for ppc64",
|
||||
1, testXenppc64, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testXenppc64, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
|
||||
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
|
||||
@@ -44,8 +44,8 @@ static int testCompareFiles(const char *xml_rel, const char *sexpr_rel,
|
||||
|
||||
if (strcmp(sexprData, gotsexpr)) {
|
||||
if (getenv("DEBUG_TESTS")) {
|
||||
printf("Expect %d '%s'\n", (int)strlen(sexprData), sexprData);
|
||||
printf("Actual %d '%s'\n", (int)strlen(gotsexpr), gotsexpr);
|
||||
printf("Expect %d '%s'\n", (int)strlen(sexprData), sexprData);
|
||||
printf("Actual %d '%s'\n", (int)strlen(gotsexpr), gotsexpr);
|
||||
}
|
||||
goto fail;
|
||||
}
|
||||
@@ -67,43 +67,43 @@ static int testCompareFiles(const char *xml_rel, const char *sexpr_rel,
|
||||
|
||||
static int testComparePVversion1(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-pv.xml",
|
||||
"xml2sexprdata/xml2sexpr-pv.sexpr",
|
||||
"pvtest",
|
||||
1);
|
||||
"xml2sexprdata/xml2sexpr-pv.sexpr",
|
||||
"pvtest",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareFVversion1(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv.xml",
|
||||
"xml2sexprdata/xml2sexpr-fv.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
"xml2sexprdata/xml2sexpr-fv.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testComparePVversion2(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-pv.xml",
|
||||
"xml2sexprdata/xml2sexpr-pv.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-pv.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareFVversion2(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv.xml",
|
||||
"xml2sexprdata/xml2sexpr-fv-v2.sexpr",
|
||||
"fvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-fv-v2.sexpr",
|
||||
"fvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareFVversion2VNC(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-vncunused.xml",
|
||||
"xml2sexprdata/xml2sexpr-fv-vncunused.sexpr",
|
||||
"fvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-fv-vncunused.sexpr",
|
||||
"fvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testComparePVOrigVFB(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-pv-vfb-orig.xml",
|
||||
"xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr",
|
||||
"pvtest",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
@@ -111,135 +111,135 @@ static int testComparePVOrigVFB(const void *data ATTRIBUTE_UNUSED) {
|
||||
static int testComparePVNewVFB(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-pv-vfb-new.xml",
|
||||
"xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr",
|
||||
"pvtest",
|
||||
"pvtest",
|
||||
3);
|
||||
}
|
||||
|
||||
static int testComparePVBootloader(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-pv-bootloader.xml",
|
||||
"xml2sexprdata/xml2sexpr-pv-bootloader.sexpr",
|
||||
"pvtest",
|
||||
1);
|
||||
"xml2sexprdata/xml2sexpr-pv-bootloader.sexpr",
|
||||
"pvtest",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareDiskFile(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-file.xml",
|
||||
"xml2sexprdata/xml2sexpr-disk-file.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-disk-file.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareDiskBlock(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-block.xml",
|
||||
"xml2sexprdata/xml2sexpr-disk-block.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-disk-block.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareDiskShareable(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-block-shareable.xml",
|
||||
"xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareDiskDrvLoop(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-loop.xml",
|
||||
"xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareDiskDrvBlkback(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blkback.xml",
|
||||
"xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareDiskDrvBlktap(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap.xml",
|
||||
"xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareDiskDrvBlktapQcow(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.xml",
|
||||
"xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareDiskDrvBlktapRaw(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.xml",
|
||||
"xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareMemoryResize(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-curmem.xml",
|
||||
"xml2sexprdata/xml2sexpr-curmem.sexpr",
|
||||
"rhel5",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-curmem.sexpr",
|
||||
"rhel5",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareNetRouted(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-net-routed.xml",
|
||||
"xml2sexprdata/xml2sexpr-net-routed.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-net-routed.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareNetBridged(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-net-bridged.xml",
|
||||
"xml2sexprdata/xml2sexpr-net-bridged.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-net-bridged.sexpr",
|
||||
"pvtest",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareNoSourceCDRom(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-no-source-cdrom.xml",
|
||||
"xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr",
|
||||
"test",
|
||||
2);
|
||||
"xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr",
|
||||
"test",
|
||||
2);
|
||||
}
|
||||
|
||||
static int testCompareFVclockUTC(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-utc.xml",
|
||||
"xml2sexprdata/xml2sexpr-fv-utc.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
"xml2sexprdata/xml2sexpr-fv-utc.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareFVclockLocaltime(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-localtime.xml",
|
||||
"xml2sexprdata/xml2sexpr-fv-localtime.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
"xml2sexprdata/xml2sexpr-fv-localtime.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
}
|
||||
|
||||
|
||||
static int testCompareFVInputUSBMouse(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-usbmouse.xml",
|
||||
"xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
"xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareFVInputUSBTablet(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-usbtablet.xml",
|
||||
"xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
"xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
}
|
||||
|
||||
static int testCompareFVKernel(const void *data ATTRIBUTE_UNUSED) {
|
||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-kernel.xml",
|
||||
"xml2sexprdata/xml2sexpr-fv-kernel.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
"xml2sexprdata/xml2sexpr-fv-kernel.sexpr",
|
||||
"fvtest",
|
||||
1);
|
||||
}
|
||||
|
||||
|
||||
@@ -254,34 +254,34 @@ main(int argc, char **argv)
|
||||
abs_top_srcdir = getenv("abs_top_srcdir");
|
||||
if (!abs_top_srcdir) {
|
||||
fprintf(stderr, "missing enviroment variable abs_top_srcdir\n");
|
||||
exit(EXIT_FAILURE);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
if (argc > 1) {
|
||||
fprintf(stderr, "Usage: %s\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
fprintf(stderr, "Usage: %s\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR PV config (format 1)",
|
||||
1, testComparePVversion1, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testComparePVversion1, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR FV config (format 1)",
|
||||
1, testCompareFVversion1, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVversion1, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR PV config (format 2)",
|
||||
1, testComparePVversion2, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testComparePVversion2, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR FV config (format 2)",
|
||||
1, testCompareFVversion2, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVversion2, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR FV config (format 2, VNC unused)",
|
||||
1, testCompareFVversion2VNC, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVversion2VNC, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR PV config (Orig VFB)",
|
||||
1, testComparePVOrigVFB, NULL) != 0)
|
||||
@@ -292,75 +292,75 @@ main(int argc, char **argv)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR PV config with bootloader",
|
||||
1, testComparePVBootloader, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testComparePVBootloader, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR Disk File",
|
||||
1, testCompareDiskFile, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskFile, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR Disk Block",
|
||||
1, testCompareDiskBlock, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskBlock, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR Disk Shareable",
|
||||
1, testCompareDiskShareable, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskShareable, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR Disk Drv Loop",
|
||||
1, testCompareDiskDrvLoop, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskDrvLoop, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR Disk Drv Blkback",
|
||||
1, testCompareDiskDrvBlkback, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskDrvBlkback, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR Disk Drv Blktap",
|
||||
1, testCompareDiskDrvBlktap, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskDrvBlktap, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR Disk Drv Blktap QCow",
|
||||
1, testCompareDiskDrvBlktapQcow, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskDrvBlktapQcow, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR Disk Drv Blktap Raw",
|
||||
1, testCompareDiskDrvBlktapRaw, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareDiskDrvBlktapRaw, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR Memory Resize",
|
||||
1, testCompareMemoryResize, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareMemoryResize, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR Net Routed",
|
||||
1, testCompareNetRouted, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareNetRouted, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR Net Bridged",
|
||||
1, testCompareNetBridged, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareNetBridged, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR No Source CDRom",
|
||||
1, testCompareNoSourceCDRom, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareNoSourceCDRom, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR FV usb mouse)",
|
||||
1, testCompareFVInputUSBMouse, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVInputUSBMouse, NULL) != 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("XML-2-SEXPR FV usb tablet)",
|
||||
1, testCompareFVInputUSBTablet, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVInputUSBTablet, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR clock UTC",
|
||||
1, testCompareFVclockUTC, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVclockUTC, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR clock Localtime",
|
||||
1, testCompareFVclockLocaltime, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVclockLocaltime, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("XML-2-SEXPR FV kernel",
|
||||
1, testCompareFVKernel, NULL) != 0)
|
||||
ret = -1;
|
||||
1, testCompareFVKernel, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -205,29 +205,29 @@ testBufferVSprintf(const void *data ATTRIBUTE_UNUSED)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
xmlRpcContextPtr cxt = NULL;
|
||||
xmlRpcContextPtr cxt = NULL;
|
||||
int check = 1;
|
||||
int ret = 0;
|
||||
int ret = 0;
|
||||
const char *url = "http://localhost:8000";
|
||||
|
||||
progname = argv[0];
|
||||
progname = argv[0];
|
||||
|
||||
if (argc > 2)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s [url]\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (argc > 2)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s [url]\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (argc == 2)
|
||||
url = argv[1];
|
||||
|
||||
/*
|
||||
* client-server tests
|
||||
*/
|
||||
if (!(cxt = xmlRpcContextNew(url)))
|
||||
{
|
||||
fprintf(stderr, "%s: failed create new RPC context\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (!(cxt = xmlRpcContextNew(url)))
|
||||
{
|
||||
fprintf(stderr, "%s: failed create new RPC context\n", progname);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (virtTestRun("XML-RPC methodCall INT+INT",
|
||||
NLOOPS, testMethodPlusINT, (const void *) cxt) != 0)
|
||||
@@ -237,7 +237,7 @@ main(int argc, char **argv)
|
||||
NLOOPS, testMethodPlusDOUBLE, (const void *) cxt) != 0)
|
||||
ret = -1;
|
||||
|
||||
xmlRpcContextFree(cxt);
|
||||
xmlRpcContextFree(cxt);
|
||||
|
||||
/*
|
||||
* regression / performance tests
|
||||
@@ -269,7 +269,7 @@ main(int argc, char **argv)
|
||||
ret = -1;
|
||||
|
||||
|
||||
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user