1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-02-02 13:47:13 +03:00

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.md

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2020-01-16 13:49:37 +01:00
parent 5f2fa393f7
commit 2775aada16

View File

@ -1274,6 +1274,26 @@ mymain(void)
"<source protocol='nbd' name='exportname'>\n"
" <host name='example.org' port='1234'/>\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",
"<source protocol='iscsi' name='exportname'>\n"
" <host name='example.org' port='1234'/>\n"