You need to sign in or sign up before continuing.
提交 0d0d60dd 编写于 作者: P Peter Krempa

tests: virstorage: Add test cases for "json:" pseudo-URI without 'file' wrapper

Add few cases that prove the second format of "json:" pseudo-URIs.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 fd70f1b4
...@@ -1315,6 +1315,10 @@ mymain(void) ...@@ -1315,6 +1315,10 @@ mymain(void)
"}" "}"
"}", "}",
"<source file='/path/to/file'/>\n"); "<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\", " TEST_BACKING_PARSE("json:{\"file.driver\":\"host_device\", "
"\"file.filename\":\"/path/to/dev\"}", "\"file.filename\":\"/path/to/dev\"}",
"<source dev='/path/to/dev'/>\n"); "<source dev='/path/to/dev'/>\n");
...@@ -1389,6 +1393,12 @@ mymain(void) ...@@ -1389,6 +1393,12 @@ mymain(void)
"<source protocol='nbd'>\n" "<source protocol='nbd'>\n"
" <host transport='unix' socket='/path/to/socket'/>\n" " <host transport='unix' socket='/path/to/socket'/>\n"
"</source>\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\"," TEST_BACKING_PARSE("json:{\"file.driver\":\"nbd\","
"\"file.path\":\"/path/to/socket\"" "\"file.path\":\"/path/to/socket\""
"}", "}",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册