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