[PATCH 06/15] tests: virstorage: Add test cases for "json:" pseudo-URI without 'file' wrapper

Peter Krempa posted 15 patches 6 years ago
There is a newer version of this series
[PATCH 06/15] tests: virstorage: Add test cases for "json:" pseudo-URI without 'file' wrapper
Posted by Peter Krempa 6 years ago
Add few cases that prove the second format of "json:" pseudo-URIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 tests/virstoragetest.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index 4341c04b1e..6d62aab654 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -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\""
                             "}",
-- 
2.24.1

Re: [PATCH 06/15] tests: virstorage: Add test cases for "json:" pseudo-URI without 'file' wrapper
Posted by Ján Tomko 6 years ago
On Thu, Feb 06, 2020 at 08:51:58AM +0100, Peter Krempa wrote:
>Add few cases that prove the second format of "json:" pseudo-URIs.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> tests/virstoragetest.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano