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

Peter Krempa posted 1 patch 4 years, 3 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/4a3882e52d735f778943bbd841b8f1ad19029225.1579179080.git.pkrempa@redhat.com
tests/virstoragetest.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
[PATCH] tests: virstorage: Add tests for NBD URI style syntax over UNIX
Posted by Peter Krempa 4 years, 3 months ago
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

Re: [PATCH] tests: virstorage: Add tests for NBD URI style syntax over UNIX
Posted by Eric Blake 4 years, 3 months ago
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

Re: [PATCH] tests: virstorage: Add tests for NBD URI style syntax over UNIX
Posted by Ján Tomko 4 years, 3 months ago
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