render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
d76c62
From 5becceb93612985adc0e358c03003b9e85f1053f Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <5becceb93612985adc0e358c03003b9e85f1053f@dist-git>
d76c62
From: Peter Krempa <pkrempa@redhat.com>
d76c62
Date: Wed, 19 Feb 2020 15:10:14 +0100
d76c62
Subject: [PATCH] tests: virstorage: Add test data for json specified raw image
d76c62
 with offset/size
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
QEMU allows specifying the offset and size into a raw file to expose a
d76c62
sub-slice of the image to the guest with the raw driver. Libvirt
d76c62
currently doesn't support it but we can add test case for future
d76c62
reference.
d76c62
d76c62
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
(cherry picked from commit 554ae62637fe4205b7f51a75e798be9223dfdc3d)
d76c62
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1791788
d76c62
Message-Id: <36808e0f9518770d82af2562d6a54e36f0cb13f5.1582120424.git.pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
---
d76c62
 tests/virstoragetest.c | 9 +++++++++
d76c62
 1 file changed, 9 insertions(+)
d76c62
d76c62
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
d76c62
index 6d62aab654..25d41f0de4 100644
d76c62
--- a/tests/virstoragetest.c
d76c62
+++ b/tests/virstoragetest.c
d76c62
@@ -1593,6 +1593,15 @@ mymain(void)
d76c62
                        "<source protocol='vxhs' name='c6718f6b-0401-441d-a8c3-1f0064d75ee0'>\n"
d76c62
                        "  <host name='example.com' port='9999'/>\n"
d76c62
                        "</source>\n");
d76c62
+    TEST_BACKING_PARSE_FULL("json:{ \"driver\": \"raw\","
d76c62
+                                    "\"offset\": 10752,"
d76c62
+                                    "\"size\": 4063232,"
d76c62
+                                    "\"file\": { \"driver\": \"file\","
d76c62
+                                                "\"filename\": \"/tmp/testfle\""
d76c62
+                                              "}"
d76c62
+                                  "}",
d76c62
+                            "<source file='/tmp/testfle'/>\n", 0);
d76c62
+
d76c62
 #endif /* WITH_YAJL */
d76c62
 
d76c62
  cleanup:
d76c62
-- 
d76c62
2.25.0
d76c62