diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-11-02 12:09:26 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-11-02 12:09:26 +0100 |
commit | 7e3dbba7e329a858948eb4c3e4e87c7741d1d7fe (patch) | |
tree | fda3b9931292218ca2b64d46717f8e5d2bcbc609 /tests | |
parent | 360da793491fee45fa0b1cb26fc05347d4b8e03a (diff) |
New upstream version 1.2.10~rc2
Diffstat (limited to 'tests')
-rw-r--r-- | tests/eventtest.c | 6 | ||||
-rw-r--r-- | tests/testutils.c | 12 | ||||
-rw-r--r-- | tests/virhostdevtest.c | 2 | ||||
-rw-r--r-- | tests/virportallocatortest.c | 2 | ||||
-rw-r--r-- | tests/virscsitest.c | 2 | ||||
-rw-r--r-- | tests/virstoragetest.c | 31 | ||||
-rw-r--r-- | tests/virstringtest.c | 3 | ||||
-rw-r--r-- | tests/viruritest.c | 1 |
8 files changed, 41 insertions, 18 deletions
diff --git a/tests/eventtest.c b/tests/eventtest.c index 2cfa0c61e..87b49d331 100644 --- a/tests/eventtest.c +++ b/tests/eventtest.c @@ -1,7 +1,7 @@ /* * eventtest.c: Test the libvirtd event loop impl * - * Copyright (C) 2009, 2011-2013 Red Hat, Inc. + * Copyright (C) 2009, 2011-2014 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -116,9 +116,9 @@ testTimer(int timer, void *data) static pthread_mutex_t eventThreadMutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t eventThreadRunCond = PTHREAD_COND_INITIALIZER; -static int eventThreadRunOnce = 0; +static int eventThreadRunOnce; static pthread_cond_t eventThreadJobCond = PTHREAD_COND_INITIALIZER; -static int eventThreadJobDone = 0; +static int eventThreadJobDone; ATTRIBUTE_NORETURN static void *eventThreadLoop(void *data ATTRIBUTE_UNUSED) { diff --git a/tests/testutils.c b/tests/testutils.c index dd65fe86b..9d6980f9c 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -74,20 +74,20 @@ static unsigned int testVerbose = -1; static unsigned int testExpensive = -1; #ifdef TEST_OOM -static unsigned int testOOM = 0; +static unsigned int testOOM; static unsigned int testOOMStart = -1; static unsigned int testOOMEnd = -1; -static unsigned int testOOMTrace = 0; +static unsigned int testOOMTrace; # ifdef TEST_OOM_TRACE void *testAllocStack[30]; int ntestAllocStack; # endif #endif -static bool testOOMActive = false; +static bool testOOMActive; -static size_t testCounter = 0; -static size_t testStart = 0; -static size_t testEnd = 0; +static size_t testCounter; +static size_t testStart; +static size_t testEnd; char *progname; diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index de4cdde90..1e93819ce 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -53,7 +53,7 @@ static const unsigned char *uuid = static int nhostdevs = 3; static virDomainHostdevDefPtr hostdevs[] = {NULL, NULL, NULL}; static virPCIDevicePtr dev[] = {NULL, NULL, NULL}; -static virHostdevManagerPtr mgr = NULL; +static virHostdevManagerPtr mgr; static void myCleanup(void) diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c index 96d2ade87..ef503ceeb 100644 --- a/tests/virportallocatortest.c +++ b/tests/virportallocatortest.c @@ -36,7 +36,7 @@ # include <netinet/in.h> # include <stdio.h> -static bool host_has_ipv6 = false; +static bool host_has_ipv6; static int (*realsocket)(int domain, int type, int protocol); static void init_syms(void) diff --git a/tests/virscsitest.c b/tests/virscsitest.c index b4ed5e9b0..a86ca28f4 100644 --- a/tests/virscsitest.c +++ b/tests/virscsitest.c @@ -34,7 +34,7 @@ VIR_LOG_INIT("tests.scsitest"); static const char *abs_top_srcdir; -static char *virscsi_prefix = NULL; +static char *virscsi_prefix; static int test1(const void *data ATTRIBUTE_UNUSED) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 29f5c7a61..05e48f3a5 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -835,6 +835,25 @@ mymain(void) (&qcow2, &nbd), EXP_PASS, (&qcow2, &nbd), ALLOW_PROBE | EXP_PASS); + /* Rewrite qcow2 to use an nbd: protocol as backend */ + virCommandFree(cmd); + cmd = virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2", + "-F", "raw", "-b", "nbd+tcp://example.org:6000/blah", + "qcow2", NULL); + if (virCommandRun(cmd, NULL) < 0) + ret = -1; + qcow2.expBackingStoreRaw = "nbd+tcp://example.org:6000/blah"; + + /* Qcow2 file with backing protocol instead of file */ + testFileData nbd2 = { + .path = "blah", + .type = VIR_STORAGE_TYPE_NETWORK, + .format = VIR_STORAGE_FILE_RAW, + }; + TEST_CHAIN(12, absqcow2, VIR_STORAGE_FILE_QCOW2, + (&qcow2, &nbd2), EXP_PASS, + (&qcow2, &nbd2), ALLOW_PROBE | EXP_PASS); + /* qed file */ testFileData qed = { .expBackingStoreRaw = absraw, @@ -848,7 +867,7 @@ mymain(void) .type = VIR_STORAGE_TYPE_FILE, .format = VIR_STORAGE_FILE_RAW, }; - TEST_CHAIN(12, absqed, VIR_STORAGE_FILE_AUTO, + TEST_CHAIN(13, absqed, VIR_STORAGE_FILE_AUTO, (&qed_as_raw), EXP_PASS, (&qed, &raw), ALLOW_PROBE | EXP_PASS); @@ -858,10 +877,10 @@ mymain(void) .type = VIR_STORAGE_TYPE_DIR, .format = VIR_STORAGE_FILE_DIR, }; - TEST_CHAIN(13, absdir, VIR_STORAGE_FILE_AUTO, + TEST_CHAIN(14, absdir, VIR_STORAGE_FILE_AUTO, (&dir), EXP_PASS, (&dir), ALLOW_PROBE | EXP_PASS); - TEST_CHAIN(14, absdir, VIR_STORAGE_FILE_DIR, + TEST_CHAIN(15, absdir, VIR_STORAGE_FILE_DIR, (&dir), EXP_PASS, (&dir), ALLOW_PROBE | EXP_PASS); @@ -900,7 +919,7 @@ mymain(void) raw.path = datadir "/sub/../sub/../raw"; raw.pathRel = "../raw"; - TEST_CHAIN(15, abslink2, VIR_STORAGE_FILE_QCOW2, + TEST_CHAIN(16, abslink2, VIR_STORAGE_FILE_QCOW2, (&link2, &link1, &raw), EXP_PASS, (&link2, &link1, &raw), ALLOW_PROBE | EXP_PASS); #endif @@ -914,7 +933,7 @@ mymain(void) qcow2.expBackingStoreRaw = "qcow2"; /* Behavior of an infinite loop chain */ - TEST_CHAIN(16, absqcow2, VIR_STORAGE_FILE_QCOW2, + TEST_CHAIN(17, absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2), EXP_WARN, (&qcow2), ALLOW_PROBE | EXP_WARN); @@ -933,7 +952,7 @@ mymain(void) qcow2.expBackingStoreRaw = "wrap"; /* Behavior of an infinite loop chain */ - TEST_CHAIN(17, abswrap, VIR_STORAGE_FILE_QCOW2, + TEST_CHAIN(18, abswrap, VIR_STORAGE_FILE_QCOW2, (&wrap, &qcow2), EXP_WARN, (&wrap, &qcow2), ALLOW_PROBE | EXP_WARN); diff --git a/tests/virstringtest.c b/tests/virstringtest.c index 841531f0b..a0bfd6157 100644 --- a/tests/virstringtest.c +++ b/tests/virstringtest.c @@ -597,6 +597,9 @@ mymain(void) const char *tokens7[] = { "The", "quick", "brown", "fox", "", NULL }; TEST_SPLIT("The quick brown fox ", " ", 0, tokens7); + const char *tokens8[] = { "gluster", "rdma", NULL }; + TEST_SPLIT("gluster+rdma", "+", 2, tokens8); + if (virtTestRun("strdup", testStrdup, NULL) < 0) ret = -1; diff --git a/tests/viruritest.c b/tests/viruritest.c index dbcd8770e..48b586568 100644 --- a/tests/viruritest.c +++ b/tests/viruritest.c @@ -173,6 +173,7 @@ mymain(void) TEST_PARSE("test://127.0.0.1:123/system", "test", "127.0.0.1", 123, "/system", NULL, NULL, NULL, NULL); TEST_PARSE("test://[::1]:123/system", "test", "::1", 123, "/system", NULL, NULL, NULL, NULL); TEST_PARSE("test://[2001:41c8:1:4fd4::2]:123/system", "test", "2001:41c8:1:4fd4::2", 123, "/system", NULL, NULL, NULL, NULL); + TEST_PARSE("gluster+rdma://example.com:1234/gv0/vol.img", "gluster+rdma", "example.com", 1234, "/gv0/vol.img", NULL, NULL, NULL, NULL); virURIParam params1[] = { { (char*)"foo", (char*)"one", false }, |