render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
a41c76
From 07e5713853789cc0b216c7d3731cbda68f905eac Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <07e5713853789cc0b216c7d3731cbda68f905eac@dist-git>
a41c76
From: Peter Krempa <pkrempa@redhat.com>
a41c76
Date: Tue, 23 Jun 2020 12:23:39 +0200
a41c76
Subject: [PATCH] qemublocktest: Add 'empty' test case for bitmaps
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Add test data for an image without bitmaps.
a41c76
a41c76
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Reviewed-by: Eric Blake <eblake@redhat.com>
a41c76
(cherry picked from commit 15ef0c1c3891feaa949e082d922c54ebe6563e40)
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1804593
a41c76
Message-Id: <2e329c1ef636060b4c094cac8c0d3558994986ce.1592906423.git.pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 tests/qemublocktest.c                     |  4 ++
a41c76
 tests/qemublocktestdata/bitmap/empty.json | 70 +++++++++++++++++++++++
a41c76
 tests/qemublocktestdata/bitmap/empty.out  |  1 +
a41c76
 3 files changed, 75 insertions(+)
a41c76
 create mode 100644 tests/qemublocktestdata/bitmap/empty.json
a41c76
 create mode 100644 tests/qemublocktestdata/bitmap/empty.out
a41c76
a41c76
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
a41c76
index d15965d9eb..2063ca0be7 100644
a41c76
--- a/tests/qemublocktest.c
a41c76
+++ b/tests/qemublocktest.c
a41c76
@@ -1291,6 +1291,8 @@ mymain(void)
a41c76
             ret = -1; \
a41c76
     } while (0)
a41c76
 
a41c76
+    TEST_BITMAP_DETECT("empty");
a41c76
+
a41c76
     TEST_BITMAP_DETECT("basic");
a41c76
     TEST_BITMAP_DETECT("synthetic");
a41c76
     TEST_BITMAP_DETECT("snapshots");
a41c76
@@ -1359,6 +1361,8 @@ mymain(void)
a41c76
             ret = -1; \
a41c76
     } while (0)
a41c76
 
a41c76
+    TEST_BITMAP_VALIDATE("empty", "a", false);
a41c76
+
a41c76
     TEST_BITMAP_VALIDATE("basic", "a", true);
a41c76
     TEST_BITMAP_VALIDATE("basic", "b", true);
a41c76
     TEST_BITMAP_VALIDATE("basic", "c", true);
a41c76
diff --git a/tests/qemublocktestdata/bitmap/empty.json b/tests/qemublocktestdata/bitmap/empty.json
a41c76
new file mode 100644
a41c76
index 0000000000..ec43b25f0d
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/bitmap/empty.json
a41c76
@@ -0,0 +1,70 @@
a41c76
+[
a41c76
+    {
a41c76
+        "iops_rd": 0,
a41c76
+        "detect_zeroes": "off",
a41c76
+        "image": {
a41c76
+            "virtual-size": 10485760,
a41c76
+            "filename": "/tmp/pull4.qcow2",
a41c76
+            "cluster-size": 65536,
a41c76
+            "format": "qcow2",
a41c76
+            "actual-size": 200704,
a41c76
+            "format-specific": {
a41c76
+                "type": "qcow2",
a41c76
+                "data": {
a41c76
+                    "compat": "1.1",
a41c76
+                    "lazy-refcounts": false,
a41c76
+                    "refcount-bits": 16,
a41c76
+                    "corrupt": false
a41c76
+                }
a41c76
+            },
a41c76
+            "dirty-flag": false
a41c76
+        },
a41c76
+        "iops_wr": 0,
a41c76
+        "ro": false,
a41c76
+        "node-name": "libvirt-1-format",
a41c76
+        "backing_file_depth": 0,
a41c76
+        "drv": "qcow2",
a41c76
+        "iops": 0,
a41c76
+        "bps_wr": 0,
a41c76
+        "write_threshold": 0,
a41c76
+        "encrypted": false,
a41c76
+        "bps": 0,
a41c76
+        "bps_rd": 0,
a41c76
+        "cache": {
a41c76
+            "no-flush": false,
a41c76
+            "direct": false,
a41c76
+            "writeback": true
a41c76
+        },
a41c76
+        "file": "/tmp/pull4.qcow2",
a41c76
+        "encryption_key_missing": false
a41c76
+    },
a41c76
+    {
a41c76
+        "iops_rd": 0,
a41c76
+        "detect_zeroes": "off",
a41c76
+        "image": {
a41c76
+            "virtual-size": 197120,
a41c76
+            "filename": "/tmp/pull4.qcow2",
a41c76
+            "format": "file",
a41c76
+            "actual-size": 200704,
a41c76
+            "dirty-flag": false
a41c76
+        },
a41c76
+        "iops_wr": 0,
a41c76
+        "ro": false,
a41c76
+        "node-name": "libvirt-1-storage",
a41c76
+        "backing_file_depth": 0,
a41c76
+        "drv": "file",
a41c76
+        "iops": 0,
a41c76
+        "bps_wr": 0,
a41c76
+        "write_threshold": 0,
a41c76
+        "encrypted": false,
a41c76
+        "bps": 0,
a41c76
+        "bps_rd": 0,
a41c76
+        "cache": {
a41c76
+            "no-flush": false,
a41c76
+            "direct": false,
a41c76
+            "writeback": true
a41c76
+        },
a41c76
+        "file": "/tmp/pull4.qcow2",
a41c76
+        "encryption_key_missing": false
a41c76
+    }
a41c76
+]
a41c76
diff --git a/tests/qemublocktestdata/bitmap/empty.out b/tests/qemublocktestdata/bitmap/empty.out
a41c76
new file mode 100644
a41c76
index 0000000000..3787cbd354
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/bitmap/empty.out
a41c76
@@ -0,0 +1 @@
a41c76
+libvirt-1-format:
a41c76
-- 
a41c76
2.27.0
a41c76