]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemublocktest: Add 'empty' test case for bitmaps
authorPeter Krempa <pkrempa@redhat.com>
Thu, 28 May 2020 14:19:07 +0000 (16:19 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 22 Jun 2020 14:04:29 +0000 (16:04 +0200)
Add test data for an image without bitmaps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
tests/qemublocktest.c
tests/qemublocktestdata/bitmap/empty.json [new file with mode: 0644]
tests/qemublocktestdata/bitmap/empty.out [new file with mode: 0644]

index f00d2ff129010209b08839ea7abda2bbf04373a8..8d613d7cac9ccbd63c8c4fbfbfff8a78b27ea56f 100644 (file)
@@ -1292,6 +1292,8 @@ mymain(void)
             ret = -1; \
     } while (0)
 
+    TEST_BITMAP_DETECT("empty");
+
     TEST_BITMAP_DETECT("basic");
     TEST_BITMAP_DETECT("synthetic");
     TEST_BITMAP_DETECT("snapshots");
@@ -1360,6 +1362,8 @@ mymain(void)
             ret = -1; \
     } while (0)
 
+    TEST_BITMAP_VALIDATE("empty", "a", false);
+
     TEST_BITMAP_VALIDATE("basic", "a", true);
     TEST_BITMAP_VALIDATE("basic", "b", true);
     TEST_BITMAP_VALIDATE("basic", "c", true);
diff --git a/tests/qemublocktestdata/bitmap/empty.json b/tests/qemublocktestdata/bitmap/empty.json
new file mode 100644 (file)
index 0000000..ec43b25
--- /dev/null
@@ -0,0 +1,70 @@
+[
+    {
+        "iops_rd": 0,
+        "detect_zeroes": "off",
+        "image": {
+            "virtual-size": 10485760,
+            "filename": "/tmp/pull4.qcow2",
+            "cluster-size": 65536,
+            "format": "qcow2",
+            "actual-size": 200704,
+            "format-specific": {
+                "type": "qcow2",
+                "data": {
+                    "compat": "1.1",
+                    "lazy-refcounts": false,
+                    "refcount-bits": 16,
+                    "corrupt": false
+                }
+            },
+            "dirty-flag": false
+        },
+        "iops_wr": 0,
+        "ro": false,
+        "node-name": "libvirt-1-format",
+        "backing_file_depth": 0,
+        "drv": "qcow2",
+        "iops": 0,
+        "bps_wr": 0,
+        "write_threshold": 0,
+        "encrypted": false,
+        "bps": 0,
+        "bps_rd": 0,
+        "cache": {
+            "no-flush": false,
+            "direct": false,
+            "writeback": true
+        },
+        "file": "/tmp/pull4.qcow2",
+        "encryption_key_missing": false
+    },
+    {
+        "iops_rd": 0,
+        "detect_zeroes": "off",
+        "image": {
+            "virtual-size": 197120,
+            "filename": "/tmp/pull4.qcow2",
+            "format": "file",
+            "actual-size": 200704,
+            "dirty-flag": false
+        },
+        "iops_wr": 0,
+        "ro": false,
+        "node-name": "libvirt-1-storage",
+        "backing_file_depth": 0,
+        "drv": "file",
+        "iops": 0,
+        "bps_wr": 0,
+        "write_threshold": 0,
+        "encrypted": false,
+        "bps": 0,
+        "bps_rd": 0,
+        "cache": {
+            "no-flush": false,
+            "direct": false,
+            "writeback": true
+        },
+        "file": "/tmp/pull4.qcow2",
+        "encryption_key_missing": false
+    }
+]
diff --git a/tests/qemublocktestdata/bitmap/empty.out b/tests/qemublocktestdata/bitmap/empty.out
new file mode 100644 (file)
index 0000000..3787cbd
--- /dev/null
@@ -0,0 +1 @@
+libvirt-1-format: