提交 2775aada 编写于 作者: P Peter Krempa

tests: virstorage: Add tests for NBD URI style syntax over UNIX

Add few test cases for nbd+unix style URIs with few corner cases.

The NBD URI syntax is documented at
https://github.com/NetworkBlockDevice/nbd/blob/master/doc/uri.mdSigned-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 5f2fa393
...@@ -1274,6 +1274,26 @@ mymain(void) ...@@ -1274,6 +1274,26 @@ mymain(void)
"<source protocol='nbd' name='exportname'>\n" "<source protocol='nbd' name='exportname'>\n"
" <host name='example.org' port='1234'/>\n" " <host name='example.org' port='1234'/>\n"
"</source>\n"); "</source>\n");
TEST_BACKING_PARSE("nbd+unix://?socket=/tmp/sock",
"<source protocol='nbd'>\n"
" <host transport='unix' socket='/tmp/sock'/>\n"
"</source>\n");
TEST_BACKING_PARSE("nbd+unix:///?socket=/tmp/sock",
"<source protocol='nbd'>\n"
" <host transport='unix' socket='/tmp/sock'/>\n"
"</source>\n");
TEST_BACKING_PARSE("nbd+unix:////?socket=/tmp/sock",
"<source protocol='nbd' name='/'>\n"
" <host transport='unix' socket='/tmp/sock'/>\n"
"</source>\n");
TEST_BACKING_PARSE("nbd+unix:///exp?socket=/tmp/sock",
"<source protocol='nbd' name='exp'>\n"
" <host transport='unix' socket='/tmp/sock'/>\n"
"</source>\n");
TEST_BACKING_PARSE("nbd+unix:////exp?socket=/tmp/sock",
"<source protocol='nbd' name='/exp'>\n"
" <host transport='unix' socket='/tmp/sock'/>\n"
"</source>\n");
TEST_BACKING_PARSE_FULL("iscsi://testuser:testpass@example.org:1234/exportname", TEST_BACKING_PARSE_FULL("iscsi://testuser:testpass@example.org:1234/exportname",
"<source protocol='iscsi' name='exportname'>\n" "<source protocol='iscsi' name='exportname'>\n"
" <host name='example.org' port='1234'/>\n" " <host name='example.org' port='1234'/>\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册