[libvirt] [PATCH 19/19] tests: qemublock: Add tests for cross-snapshot incremental backups

Peter Krempa pkrempa at redhat.com
Thu Dec 12 17:18:49 UTC 2019


Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 tests/qemublocktest.c                         |  4 ++
 .../backupmerge/snapshot-deep-out.json        | 38 +++++++++++++++++++
 .../backupmerge/snapshot-flat-out.json        |  6 +++
 .../snapshot-intermediate-out.json            | 14 +++++++
 4 files changed, 62 insertions(+)
 create mode 100644 tests/qemublocktestdata/backupmerge/snapshot-deep-out.json
 create mode 100644 tests/qemublocktestdata/backupmerge/snapshot-flat-out.json
 create mode 100644 tests/qemublocktestdata/backupmerge/snapshot-intermediate-out.json

diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index 659ce327dc..905a5b6ed2 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -939,6 +939,10 @@ mymain(void)
     TEST_BACKUP_BITMAP_CALCULATE("basic-intermediate", bitmapSourceChain, "d", "basic");
     TEST_BACKUP_BITMAP_CALCULATE("basic-deep", bitmapSourceChain, "a", "basic");

+    TEST_BACKUP_BITMAP_CALCULATE("snapshot-flat", bitmapSourceChain, "current", "snapshots");
+    TEST_BACKUP_BITMAP_CALCULATE("snapshot-intermediate", bitmapSourceChain, "d", "snapshots");
+    TEST_BACKUP_BITMAP_CALCULATE("snapshot-deep", bitmapSourceChain, "a", "snapshots");
+
  cleanup:
     virHashFree(diskxmljsondata.schema);
     qemuTestDriverFree(&driver);
diff --git a/tests/qemublocktestdata/backupmerge/snapshot-deep-out.json b/tests/qemublocktestdata/backupmerge/snapshot-deep-out.json
new file mode 100644
index 0000000000..526fc8d55b
--- /dev/null
+++ b/tests/qemublocktestdata/backupmerge/snapshot-deep-out.json
@@ -0,0 +1,38 @@
+[
+  {
+    "node": "libvirt-1-format",
+    "name": "current"
+  },
+  {
+    "node": "libvirt-1-format",
+    "name": "d"
+  },
+  {
+    "node": "libvirt-2-format",
+    "name": "d"
+  },
+  {
+    "node": "libvirt-2-format",
+    "name": "c"
+  },
+  {
+    "node": "libvirt-3-format",
+    "name": "c"
+  },
+  {
+    "node": "libvirt-3-format",
+    "name": "b"
+  },
+  {
+    "node": "libvirt-3-format",
+    "name": "a"
+  },
+  {
+    "node": "libvirt-4-format",
+    "name": "a"
+  },
+  {
+    "node": "libvirt-5-format",
+    "name": "a"
+  }
+]
diff --git a/tests/qemublocktestdata/backupmerge/snapshot-flat-out.json b/tests/qemublocktestdata/backupmerge/snapshot-flat-out.json
new file mode 100644
index 0000000000..b89252e284
--- /dev/null
+++ b/tests/qemublocktestdata/backupmerge/snapshot-flat-out.json
@@ -0,0 +1,6 @@
+[
+  {
+    "node": "libvirt-1-format",
+    "name": "current"
+  }
+]
diff --git a/tests/qemublocktestdata/backupmerge/snapshot-intermediate-out.json b/tests/qemublocktestdata/backupmerge/snapshot-intermediate-out.json
new file mode 100644
index 0000000000..537d776ec6
--- /dev/null
+++ b/tests/qemublocktestdata/backupmerge/snapshot-intermediate-out.json
@@ -0,0 +1,14 @@
+[
+  {
+    "node": "libvirt-1-format",
+    "name": "current"
+  },
+  {
+    "node": "libvirt-1-format",
+    "name": "d"
+  },
+  {
+    "node": "libvirt-2-format",
+    "name": "d"
+  }
+]
-- 
2.23.0




More information about the libvir-list mailing list