[PATCH] tests: virstorage: Add tests for NBD URI style syntax over UNIX

Add few test cases for nbd+unix style URIs with few corner cases.t Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/virstoragetest.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 370e19252b..4341c04b1e 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -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" -- 2.24.1

On 1/16/20 6:51 AM, Peter Krempa wrote:
Add few test cases for nbd+unix style URIs with few corner cases.t
s/t$//
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/virstoragetest.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
Might want to mention https://github.com/NetworkBlockDevice/nbd/blob/master/doc/uri.md in the commit message. Reviewed-by: Eric Blake <eblake@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

On Thu, Jan 16, 2020 at 01:51:20PM +0100, Peter Krempa wrote:
Add few test cases for nbd+unix style URIs with few corner cases.t
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/virstoragetest.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano.t
participants (3)
-
Eric Blake
-
Ján Tomko
-
Peter Krempa