Blame SOURCES/libvirt-tests-virstorage-Add-test-data-for-json-specified-raw-image-with-offset-size.patch

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