[PATCH 2/2] test: Add test to verify helpers used for backing file name parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add two test cases to verify that the helpers split and parse the
backing store components properly.
---
 tests/virstringtest.c | 3 +++
 tests/viruritest.c    | 1 +
 2 files changed, 4 insertions(+)

diff --git a/tests/virstringtest.c b/tests/virstringtest.c
index 841531f..a0bfd61 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 dbcd877..48b5865 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 },
-- 
2.1.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]