render / rpms / libvirt

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