render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
a41c76
From 4c5c4e4b30016175c40a1f2dac7e145042ea06ed Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <4c5c4e4b30016175c40a1f2dac7e145042ea06ed@dist-git>
a41c76
From: Peter Krempa <pkrempa@redhat.com>
a41c76
Date: Wed, 19 Feb 2020 15:10:11 +0100
a41c76
Subject: [PATCH] tests: virstorage: Add test cases for "json:" pseudo-URI
a41c76
 without 'file' wrapper
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Add few cases that prove the second format of "json:" pseudo-URIs.
a41c76
a41c76
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
(cherry picked from commit 0d0d60ddc5e58359cff5be8dfd6dd27e98da0282)
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1791788
a41c76
Message-Id: <7f9970e468fd99dfb72033f688e45ca086be56a0.1582120424.git.pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 tests/virstoragetest.c | 10 ++++++++++
a41c76
 1 file changed, 10 insertions(+)
a41c76
a41c76
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
a41c76
index 4341c04b1e..6d62aab654 100644
a41c76
--- a/tests/virstoragetest.c
a41c76
+++ b/tests/virstoragetest.c
a41c76
@@ -1315,6 +1315,10 @@ mymain(void)
a41c76
                                         "}"
a41c76
                             "}",
a41c76
                        "<source file='/path/to/file'/>\n");
a41c76
+    TEST_BACKING_PARSE("json:{\"driver\":\"file\","
a41c76
+                             "\"filename\":\"/path/to/file\""
a41c76
+                            "}",
a41c76
+                       "<source file='/path/to/file'/>\n");
a41c76
     TEST_BACKING_PARSE("json:{\"file.driver\":\"host_device\", "
a41c76
                              "\"file.filename\":\"/path/to/dev\"}",
a41c76
                        "<source dev='/path/to/dev'/>\n");
a41c76
@@ -1389,6 +1393,12 @@ mymain(void)
a41c76
                        "<source protocol='nbd'>\n"
a41c76
                        "  <host transport='unix' socket='/path/to/socket'/>\n"
a41c76
                        "</source>\n");
a41c76
+    TEST_BACKING_PARSE("json:{\"driver\":\"nbd\","
a41c76
+                             "\"path\":\"/path/to/socket\""
a41c76
+                            "}",
a41c76
+                       "<source protocol='nbd'>\n"
a41c76
+                       "  <host transport='unix' socket='/path/to/socket'/>\n"
a41c76
+                       "</source>\n");
a41c76
     TEST_BACKING_PARSE("json:{\"file.driver\":\"nbd\","
a41c76
                              "\"file.path\":\"/path/to/socket\""
a41c76
                             "}",
a41c76
-- 
a41c76
2.25.0
a41c76