]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: virstorage: Add test cases for "json:" pseudo-URI without 'file' wrapper
authorPeter Krempa <pkrempa@redhat.com>
Mon, 3 Feb 2020 15:40:16 +0000 (16:40 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 10 Feb 2020 16:26:27 +0000 (17:26 +0100)
Add few cases that prove the second format of "json:" pseudo-URIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/virstoragetest.c

index 4341c04b1eaa24ddffd0162c5d26728a27d70fa2..6d62aab6544465e9fb8935011bdedc121c7d450b 100644 (file)
@@ -1315,6 +1315,10 @@ mymain(void)
                                         "}"
                             "}",
                        "<source file='/path/to/file'/>\n");
+    TEST_BACKING_PARSE("json:{\"driver\":\"file\","
+                             "\"filename\":\"/path/to/file\""
+                            "}",
+                       "<source file='/path/to/file'/>\n");
     TEST_BACKING_PARSE("json:{\"file.driver\":\"host_device\", "
                              "\"file.filename\":\"/path/to/dev\"}",
                        "<source dev='/path/to/dev'/>\n");
@@ -1389,6 +1393,12 @@ mymain(void)
                        "<source protocol='nbd'>\n"
                        "  <host transport='unix' socket='/path/to/socket'/>\n"
                        "</source>\n");
+    TEST_BACKING_PARSE("json:{\"driver\":\"nbd\","
+                             "\"path\":\"/path/to/socket\""
+                            "}",
+                       "<source protocol='nbd'>\n"
+                       "  <host transport='unix' socket='/path/to/socket'/>\n"
+                       "</source>\n");
     TEST_BACKING_PARSE("json:{\"file.driver\":\"nbd\","
                              "\"file.path\":\"/path/to/socket\""
                             "}",