From: Daniel P. Berrange Date: Fri, 19 Jan 2007 20:30:05 +0000 (+0000) Subject: Added test suite for the XML <-> XM config file conversion X-Git-Tag: LIBVIRT_0_1_11~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc073b5a4d0a9f64c629cb21d54fc25699ec7b19;p=thirdparty%2Flibvirt.git Added test suite for the XML <-> XM config file conversion --- diff --git a/ChangeLog b/ChangeLog index 5a92b114a2..6537632842 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Fri Jan 19 15:28:13 EST 2007 Daniel Berrange + + * tests/xmconfigtest.c: Test suite to check conversion from + XML to XM config files, and the reverse + * tests/xmconfigdata/*.xml: Source XML files for the test + suite + * tests/xmconfigdata/*.cfg: Source XM config files for the + test suite + * configure.ac, tests/Makefile.am: Added xmconfigdata subdir + * tests/xmconfigdata/Makefile.am: Include config files when + doing a make dist. + Fri Jan 19 15:23:13 EST 2007 Daniel Berrange * src/xm_internal.c: Finished off the conversion from XML diff --git a/configure.in b/configure.in index 43ef604fd4..aae3217cb1 100644 --- a/configure.in +++ b/configure.in @@ -269,4 +269,5 @@ AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \ tests/Makefile proxy/Makefile \ tests/xml2sexprdata/Makefile \ tests/sexpr2xmldata/Makefile \ + tests/xmconfigdata/Makefile \ tests/virshdata/Makefile tests/confdata/Makefile) diff --git a/tests/.cvsignore b/tests/.cvsignore index 5057aeab33..1fd64b3b0e 100644 --- a/tests/.cvsignore +++ b/tests/.cvsignore @@ -8,3 +8,4 @@ xml2sexprtest virshtest conftest reconnect +xmconfigtest diff --git a/tests/Makefile.am b/tests/Makefile.am index 8ee3cf3217..b045cef3cc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = virshdata confdata sexpr2xmldata xml2sexprdata +SUBDIRS = virshdata confdata sexpr2xmldata xml2sexprdata xmconfigdata LIBVIRT = $(top_builddir)/src/.libs/libvirt.a @@ -20,9 +20,9 @@ LDADDS = \ EXTRA_DIST = xmlrpcserver.py test_conf.sh noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \ - reconnect + reconnect xmconfigtest -TESTS = xml2sexprtest sexpr2xmltest virshtest test_conf.sh reconnect +TESTS = xml2sexprtest sexpr2xmltest virshtest test_conf.sh reconnect xmconfigtest valgrind: $(MAKE) check TESTS_ENVIRONMENT="valgrind --quiet --leak-check=full" @@ -49,6 +49,12 @@ sexpr2xmltest_SOURCES = \ sexpr2xmltest_LDFLAGS = sexpr2xmltest_LDADD = $(LDADDS) +xmconfigtest_SOURCES = \ + xmconfigtest.c \ + testutils.c testutils.h +xmconfigtest_LDFLAGS = +xmconfigtest_LDADD = $(LDADDS) + virshtest_SOURCES = \ virshtest.c \ testutils.c testutils.h diff --git a/tests/testutils.c b/tests/testutils.c index d6af4965cb..b32716aaa5 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -1,7 +1,7 @@ /* - * utils.c: basic test utils + * testutils.c: basic test utils * - * Copyright (C) 2005 Red Hat, Inc. + * Copyright (C) 2005-2007 Red Hat, Inc. * * See COPYING.LIB for the License of this software * @@ -23,68 +23,68 @@ #include "testutils.h" #define GETTIMEOFDAY(T) gettimeofday(T, NULL) -#define DIFF_MSEC(T, U) \ - ((((int) ((T)->tv_sec - (U)->tv_sec)) * 1000000.0 + \ - ((int) ((T)->tv_usec - (U)->tv_usec))) / 1000.0) +#define DIFF_MSEC(T, U) \ + ((((int) ((T)->tv_sec - (U)->tv_sec)) * 1000000.0 + \ + ((int) ((T)->tv_usec - (U)->tv_usec))) / 1000.0) double virtTestCountAverage(double *items, int nitems) { - long double sum = 0; - int i; + long double sum = 0; + int i; - for (i=1; i < nitems; i++) - sum += items[i]; + for (i=1; i < nitems; i++) + sum += items[i]; - return (double) (sum / nitems); + return (double) (sum / nitems); } -/* +/* * Runs test and count average time (if the nloops is grater than 1) - * - * returns: -1 = error, 0 = success + * + * returns: -1 = error, 0 = success */ int virtTestRun(const char *title, int nloops, int (*body)(void *data), void *data) { - int i, ret = 0; - double *ts = NULL; - - if (nloops > 1 && (ts = calloc(nloops, - sizeof(double)))==NULL) - return -1; - - for (i=0; i < nloops; i++) { - struct timeval before, after; - - if (ts) - GETTIMEOFDAY(&before); - if ((ret = body(data)) != 0) - break; - if (ts) { - GETTIMEOFDAY(&after); - ts[i] = DIFF_MSEC(&after, &before); - } - } - if (ret == 0 && ts) - fprintf(stderr, "%-50s ... OK [%.5f ms]\n", title, - virtTestCountAverage(ts, nloops)); - else if (ret == 0) - fprintf(stderr, "%-50s ... OK\n", title); - else - fprintf(stderr, "%-50s ... FAILED\n", title); - - if (ts) - free(ts); - return ret; + int i, ret = 0; + double *ts = NULL; + + if (nloops > 1 && (ts = calloc(nloops, + sizeof(double)))==NULL) + return -1; + + for (i=0; i < nloops; i++) { + struct timeval before, after; + + if (ts) + GETTIMEOFDAY(&before); + if ((ret = body(data)) != 0) + break; + if (ts) { + GETTIMEOFDAY(&after); + ts[i] = DIFF_MSEC(&after, &before); + } + } + if (ret == 0 && ts) + fprintf(stderr, "%-50s ... OK [%.5f ms]\n", title, + virtTestCountAverage(ts, nloops)); + else if (ret == 0) + fprintf(stderr, "%-50s ... OK\n", title); + else + fprintf(stderr, "%-50s ... FAILED\n", title); + + if (ts) + free(ts); + return ret; } int virtTestLoadFile(const char *name, - char **buf, - int buflen) { + char **buf, + int buflen) { FILE *fp = fopen(name, "r"); struct stat st; - + if (!fp) return -1; @@ -98,9 +98,11 @@ int virtTestLoadFile(const char *name, return -1; } - if (fread(*buf, st.st_size, 1, fp) != 1) { - fclose(fp); - return -1; + if (st.st_size) { + if (fread(*buf, st.st_size, 1, fp) != 1) { + fclose(fp); + return -1; + } } (*buf)[st.st_size] = '\0'; @@ -110,89 +112,99 @@ int virtTestLoadFile(const char *name, static void virtTestCaptureProgramExecChild(const char *const argv[], - int pipefd) { - int i; - int open_max; - int stdinfd = -1; - int stderrfd = -1; - const char *const env[] = { - "LANG=C", - NULL - }; - - if ((stdinfd = open(_PATH_DEVNULL, O_RDONLY)) < 0) - goto cleanup; - if ((stderrfd = open(_PATH_DEVNULL, O_WRONLY)) < 0) - goto cleanup; - - open_max = sysconf (_SC_OPEN_MAX); - for (i = 0; i < open_max; i++) { - if (i != stdinfd && - i != stderrfd && - i != pipefd) - close(i); - } - - if (dup2(stdinfd, STDIN_FILENO) != STDIN_FILENO) - goto cleanup; - if (dup2(pipefd, STDOUT_FILENO) != STDOUT_FILENO) - goto cleanup; - if (dup2(stderrfd, STDERR_FILENO) != STDERR_FILENO) - goto cleanup; - - /* SUS is crazy here, hence the cast */ - execve(argv[0], (char *const*)argv, (char *const*)env); + int pipefd) { + int i; + int open_max; + int stdinfd = -1; + int stderrfd = -1; + const char *const env[] = { + "LANG=C", + NULL + }; + + if ((stdinfd = open(_PATH_DEVNULL, O_RDONLY)) < 0) + goto cleanup; + if ((stderrfd = open(_PATH_DEVNULL, O_WRONLY)) < 0) + goto cleanup; + + open_max = sysconf (_SC_OPEN_MAX); + for (i = 0; i < open_max; i++) { + if (i != stdinfd && + i != stderrfd && + i != pipefd) + close(i); + } + + if (dup2(stdinfd, STDIN_FILENO) != STDIN_FILENO) + goto cleanup; + if (dup2(pipefd, STDOUT_FILENO) != STDOUT_FILENO) + goto cleanup; + if (dup2(stderrfd, STDERR_FILENO) != STDERR_FILENO) + goto cleanup; + + /* SUS is crazy here, hence the cast */ + execve(argv[0], (char *const*)argv, (char *const*)env); cleanup: - if (stdinfd != -1) - close(stdinfd); - if (stderrfd != -1) - close(stderrfd); + if (stdinfd != -1) + close(stdinfd); + if (stderrfd != -1) + close(stderrfd); } int virtTestCaptureProgramOutput(const char *const argv[], - char **buf, - int buflen) { - int pipefd[2]; - - if (pipe(pipefd) < 0) - return -1; - - int pid = fork(); - switch (pid) { + char **buf, + int buflen) { + int pipefd[2]; + + if (pipe(pipefd) < 0) + return -1; + + int pid = fork(); + switch (pid) { case 0: close(pipefd[0]); - virtTestCaptureProgramExecChild(argv, pipefd[1]); - - close(pipefd[1]); - _exit(1); - + virtTestCaptureProgramExecChild(argv, pipefd[1]); + + close(pipefd[1]); + _exit(1); + case -1: return -1; - + default: - { - int got = 0; - int ret = -1; - int want = buflen-1; + { + int got = 0; + int ret = -1; + int want = buflen-1; - close(pipefd[1]); + close(pipefd[1]); - while (want) { - if ((ret = read(pipefd[0], (*buf)+got, want)) <= 0) - break; - got += ret; - want -= ret; - } - close(pipefd[0]); + while (want) { + if ((ret = read(pipefd[0], (*buf)+got, want)) <= 0) + break; + got += ret; + want -= ret; + } + close(pipefd[0]); - if (!ret) - (*buf)[got] = '\0'; + if (!ret) + (*buf)[got] = '\0'; - waitpid(pid, NULL, 0); + waitpid(pid, NULL, 0); - return ret; - } - } + return ret; + } + } } + + +/* + * Local variables: + * indent-tabs-mode: nil + * c-indent-level: 4 + * c-basic-offset: 4 + * tab-width: 4 + * End: + */ diff --git a/tests/xmconfigdata/.cvsignore b/tests/xmconfigdata/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/tests/xmconfigdata/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/tests/xmconfigdata/Makefile.am b/tests/xmconfigdata/Makefile.am new file mode 100644 index 0000000000..05201a087b --- /dev/null +++ b/tests/xmconfigdata/Makefile.am @@ -0,0 +1,2 @@ + +EXTRA_DIST = $(wildcard *.xml) $(wildcard *.cfg) diff --git a/tests/xmconfigdata/test-fullvirt-new-cdrom.cfg b/tests/xmconfigdata/test-fullvirt-new-cdrom.cfg new file mode 100755 index 0000000000..8c108658b4 --- /dev/null +++ b/tests/xmconfigdata/test-fullvirt-new-cdrom.cfg @@ -0,0 +1,22 @@ +name = "XenGuest2" +uuid = "c7a5fdb2cdaf9455926ad65c16db1809" +maxmem = 579 +memory = 394 +vcpus = 1 +builder = "hvm" +kernel = "/usr/lib/xen/boot/hvmloader" +boot = "d" +pae = 1 +acpi = 1 +apic = 1 +on_poweroff = "destroy" +on_reboot = "restart" +on_crash = "restart" +device_model = "/usr/lib/xen/bin/qemu-dm" +sdl = 0 +vnc = 1 +vncunused = 1 +vnclisten = "127.0.0.1" +vncpasswd = "123poi" +disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ] +vif = [ "mac=00:16:3E:66:92:9C,type=ioemu" ] diff --git a/tests/xmconfigdata/test-fullvirt-new-cdrom.xml b/tests/xmconfigdata/test-fullvirt-new-cdrom.xml new file mode 100644 index 0000000000..1d4313a5bb --- /dev/null +++ b/tests/xmconfigdata/test-fullvirt-new-cdrom.xml @@ -0,0 +1,38 @@ + + XenGuest2 + c7a5fdb2cdaf9455926ad65c16db1809 + + hvm + /usr/lib/xen/boot/hvmloader + cdrom + + 403456 + 592896 + 1 + destroy + restart + restart + + + + + + + /usr/lib/xen/bin/qemu-dm + + + + + + + + + + + + + + + + + diff --git a/tests/xmconfigdata/test-fullvirt-old-cdrom.cfg b/tests/xmconfigdata/test-fullvirt-old-cdrom.cfg new file mode 100755 index 0000000000..1ea6d4ef2e --- /dev/null +++ b/tests/xmconfigdata/test-fullvirt-old-cdrom.cfg @@ -0,0 +1,23 @@ +name = "XenGuest2" +uuid = "c7a5fdb2cdaf9455926ad65c16db1809" +maxmem = 579 +memory = 394 +vcpus = 1 +builder = "hvm" +kernel = "/usr/lib/xen/boot/hvmloader" +boot = "d" +pae = 1 +acpi = 1 +apic = 1 +cdrom = "/root/boot.iso" +on_poweroff = "destroy" +on_reboot = "restart" +on_crash = "restart" +device_model = "/usr/lib/xen/bin/qemu-dm" +sdl = 0 +vnc = 1 +vncunused = 1 +vnclisten = "127.0.0.1" +vncpasswd = "123poi" +disk = [ "phy:/dev/HostVG/XenGuest2,ioemu:hda,w" ] +vif = [ "mac=00:16:3E:66:92:9C,type=ioemu" ] diff --git a/tests/xmconfigdata/test-fullvirt-old-cdrom.xml b/tests/xmconfigdata/test-fullvirt-old-cdrom.xml new file mode 100644 index 0000000000..1d4313a5bb --- /dev/null +++ b/tests/xmconfigdata/test-fullvirt-old-cdrom.xml @@ -0,0 +1,38 @@ + + XenGuest2 + c7a5fdb2cdaf9455926ad65c16db1809 + + hvm + /usr/lib/xen/boot/hvmloader + cdrom + + 403456 + 592896 + 1 + destroy + restart + restart + + + + + + + /usr/lib/xen/bin/qemu-dm + + + + + + + + + + + + + + + + + diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb.cfg b/tests/xmconfigdata/test-paravirt-new-pvfb.cfg new file mode 100755 index 0000000000..0d71266a8d --- /dev/null +++ b/tests/xmconfigdata/test-paravirt-new-pvfb.cfg @@ -0,0 +1,12 @@ +name = "XenGuest1" +uuid = "c7a5fdb0cdaf9455926ad65c16db1809" +maxmem = 579 +memory = 394 +vcpus = 1 +bootloader = "/usr/bin/pygrub" +on_poweroff = "destroy" +on_reboot = "restart" +on_crash = "restart" +vfb = [ "type=vnc,vncunused=1,vnclisten=127.0.0.1,vncpasswd=123poi" ] +disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ] +vif = [ "mac=00:16:3E:66:94:9C,ip=192.168.0.9" ] diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb.xml b/tests/xmconfigdata/test-paravirt-new-pvfb.xml new file mode 100644 index 0000000000..ba768adf0e --- /dev/null +++ b/tests/xmconfigdata/test-paravirt-new-pvfb.xml @@ -0,0 +1,24 @@ + + XenGuest1 + c7a5fdb0cdaf9455926ad65c16db1809 + /usr/bin/pygrub + 403456 + 592896 + 1 + destroy + restart + restart + + + + + + + + + + + + + + diff --git a/tests/xmconfigdata/test-paravirt-old-pvfb.cfg b/tests/xmconfigdata/test-paravirt-old-pvfb.cfg new file mode 100755 index 0000000000..fb112a103d --- /dev/null +++ b/tests/xmconfigdata/test-paravirt-old-pvfb.cfg @@ -0,0 +1,16 @@ +name = "XenGuest1" +uuid = "c7a5fdb0cdaf9455926ad65c16db1809" +maxmem = 579 +memory = 394 +vcpus = 1 +bootloader = "/usr/bin/pygrub" +on_poweroff = "destroy" +on_reboot = "restart" +on_crash = "restart" +sdl = 0 +vnc = 1 +vncunused = 1 +vnclisten = "127.0.0.1" +vncpasswd = "123poi" +disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ] +vif = [ "mac=00:16:3E:66:94:9C,ip=192.168.0.9" ] diff --git a/tests/xmconfigdata/test-paravirt-old-pvfb.xml b/tests/xmconfigdata/test-paravirt-old-pvfb.xml new file mode 100644 index 0000000000..ba768adf0e --- /dev/null +++ b/tests/xmconfigdata/test-paravirt-old-pvfb.xml @@ -0,0 +1,24 @@ + + XenGuest1 + c7a5fdb0cdaf9455926ad65c16db1809 + /usr/bin/pygrub + 403456 + 592896 + 1 + destroy + restart + restart + + + + + + + + + + + + + + diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c new file mode 100644 index 0000000000..4feff5fb69 --- /dev/null +++ b/tests/xmconfigtest.c @@ -0,0 +1,226 @@ +/* + * xmconfigtest.c: Test backend for xm_internal config file handling + * + * Copyright (C) 2007 Red Hat + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Daniel P. Berrange + * + */ + +#include +#include + +#include "xm_internal.h" +#include "testutils.h" +#include "internal.h" +#include "conf.h" + +static char *progname; + +#define MAX_FILE 4096 + +static int testCompareParseXML(const char *xmcfg, const char *xml, int xendConfigVersion) { + char xmlData[MAX_FILE]; + char xmcfgData[MAX_FILE]; + char gotxmcfgData[MAX_FILE]; + char *xmlPtr = &(xmlData[0]); + char *xmcfgPtr = &(xmcfgData[0]); + char *gotxmcfgPtr = &(gotxmcfgData[0]); + virConfPtr conf = NULL; + int ret = -1; + virConnectPtr conn; + int wrote = MAX_FILE; + + conn = virConnectOpen("test:///default"); + + if (virtTestLoadFile(xml, &xmlPtr, MAX_FILE) < 0) + goto fail; + + if (virtTestLoadFile(xmcfg, &xmcfgPtr, MAX_FILE) < 0) + goto fail; + + /* Yes, a nasty hack, but this is only a test suite */ + conn->xendConfigVersion = xendConfigVersion; + + if (!(conf = xenXMParseXMLToConfig(conn, xmlPtr))) + goto fail; + + if (virConfWriteMem(gotxmcfgPtr, &wrote, conf) < 0) + goto fail; + gotxmcfgPtr[wrote] = '\0'; + + if (getenv("DEBUG_TESTS")) { + printf("Expect %d '%s'\n", (int)strlen(xmcfgData), xmcfgData); + printf("Actual %d '%s'\n", (int)strlen(gotxmcfgData), gotxmcfgData); + } + if (strcmp(xmcfgData, gotxmcfgData)) + goto fail; + + ret = 0; + + fail: + if (conf) + virConfFree(conf); + + virConnectClose(conn); + return ret; +} + +static int testCompareFormatXML(const char *xmcfg, const char *xml, int xendConfigVersion) { + char xmlData[MAX_FILE]; + char xmcfgData[MAX_FILE]; + char *xmlPtr = &(xmlData[0]); + char *xmcfgPtr = &(xmcfgData[0]); + char *gotxml = NULL; + virConfPtr conf = NULL; + int ret = -1; + virConnectPtr conn; + + conn = virConnectOpen("test:///default"); + + if (virtTestLoadFile(xml, &xmlPtr, MAX_FILE) < 0) + goto fail; + + if (virtTestLoadFile(xmcfg, &xmcfgPtr, MAX_FILE) < 0) + goto fail; + + /* Yes, a nasty hack, but this is only a test suite */ + conn->xendConfigVersion = xendConfigVersion; + + if (!(conf = virConfReadMem(xmcfgPtr, strlen(xmcfgPtr)))) + goto fail; + + if (!(gotxml = xenXMDomainFormatXML(conn, conf))) + goto fail; + + if (getenv("DEBUG_TESTS")) { + printf("Expect %d '%s'\n", (int)strlen(xmlData), xmlData); + printf("Actual %d '%s'\n", (int)strlen(gotxml), gotxml); + } + if (strcmp(xmlData, gotxml)) + goto fail; + + ret = 0; + + fail: + if (conf) + virConfFree(conf); + if (gotxml) + free(gotxml); + + virConnectClose(conn); + return ret; +} + +static int testCompareParavirtOldPVFBFormat(void *data ATTRIBUTE_UNUSED) { + return testCompareFormatXML("xmconfigdata/test-paravirt-old-pvfb.cfg", + "xmconfigdata/test-paravirt-old-pvfb.xml", + 2); +} +static int testCompareParavirtOldPVFBParse(void *data ATTRIBUTE_UNUSED) { + return testCompareParseXML("xmconfigdata/test-paravirt-old-pvfb.cfg", + "xmconfigdata/test-paravirt-old-pvfb.xml", + 2); +} + +static int testCompareParavirtNewPVFBFormat(void *data ATTRIBUTE_UNUSED) { + return testCompareFormatXML("xmconfigdata/test-paravirt-new-pvfb.cfg", + "xmconfigdata/test-paravirt-new-pvfb.xml", + 3); +} +static int testCompareParavirtNewPVFBParse(void *data ATTRIBUTE_UNUSED) { + return testCompareParseXML("xmconfigdata/test-paravirt-new-pvfb.cfg", + "xmconfigdata/test-paravirt-new-pvfb.xml", + 3); +} + +static int testCompareFullvirtOldCDROMFormat(void *data ATTRIBUTE_UNUSED) { + return testCompareFormatXML("xmconfigdata/test-fullvirt-old-cdrom.cfg", + "xmconfigdata/test-fullvirt-old-cdrom.xml", + 1); +} +static int testCompareFullvirtOldCDROMParse(void *data ATTRIBUTE_UNUSED) { + return testCompareParseXML("xmconfigdata/test-fullvirt-old-cdrom.cfg", + "xmconfigdata/test-fullvirt-old-cdrom.xml", + 1); +} + +static int testCompareFullvirtNewCDROMFormat(void *data ATTRIBUTE_UNUSED) { + return testCompareFormatXML("xmconfigdata/test-fullvirt-new-cdrom.cfg", + "xmconfigdata/test-fullvirt-new-cdrom.xml", + 2); +} +static int testCompareFullvirtNewCDROMParse(void *data ATTRIBUTE_UNUSED) { + return testCompareParseXML("xmconfigdata/test-fullvirt-new-cdrom.cfg", + "xmconfigdata/test-fullvirt-new-cdrom.xml", + 2); +} + + +int +main(int argc, char **argv) +{ + int ret = 0; + + progname = argv[0]; + + if (argc > 1) { + fprintf(stderr, "Usage: %s\n", progname); + exit(EXIT_FAILURE); + } + + if (virtTestRun("Paravirt old PVFB (Format)", + 1, testCompareParavirtOldPVFBFormat, NULL) != 0) + ret = -1; + + if (virtTestRun("Paravirt new PVFB (Format)", + 1, testCompareParavirtNewPVFBFormat, NULL) != 0) + ret = -1; + + if (virtTestRun("Fullvirt old PVFB (Format)", + 1, testCompareFullvirtOldCDROMFormat, NULL) != 0) + ret = -1; + + if (virtTestRun("Fullvirt new PVFB (Format)", + 1, testCompareFullvirtNewCDROMFormat, NULL) != 0) + ret = -1; + + if (virtTestRun("Paravirt old PVFB (Parse)", + 1, testCompareParavirtOldPVFBParse, NULL) != 0) + ret = -1; + if (virtTestRun("Paravirt new PVFB (Parse)", + 1, testCompareParavirtNewPVFBParse, NULL) != 0) + ret = -1; + if (virtTestRun("Fullvirt old PVFB (Parse)", + 1, testCompareFullvirtOldCDROMParse, NULL) != 0) + ret = -1; + if (virtTestRun("Fullvirt new PVFB (Parse)", + 1, testCompareFullvirtNewCDROMParse, NULL) != 0) + ret = -1; + + exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); +} + + +/* + * Local variables: + * indent-tabs-mode: nil + * c-indent-level: 4 + * c-basic-offset: 4 + * tab-width: 4 + * End: + */