a41c76
From 4b9cb933c1501309a858130f5465313699840ec1 Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <4b9cb933c1501309a858130f5465313699840ec1@dist-git>
a41c76
From: Peter Krempa <pkrempa@redhat.com>
a41c76
Date: Tue, 23 Jun 2020 12:23:55 +0200
a41c76
Subject: [PATCH] qemublocktest: Re-introduce testing of checkpoint deletion
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Exercise the now arguably simpler checkpoint deletion code on the
a41c76
'basic', 'snapshots', and 'synthetic' test data sets.
a41c76
a41c76
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Reviewed-by: Eric Blake <eblake@redhat.com>
a41c76
(cherry picked from commit 2c5a3da365d9a33ff23458ca2a914f9d35ebd510)
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1804593
a41c76
Message-Id: <8df51bc8ee6e86fe36d971670ecdc89ecc989532.1592906423.git.pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 tests/qemublocktest.c                         | 18 ++++++++
a41c76
 .../checkpointdelete/basic-current-out.json   |  9 ++++
a41c76
 .../basic-intermediate1-out.json              |  9 ++++
a41c76
 .../basic-intermediate2-out.json              |  9 ++++
a41c76
 .../basic-intermediate3-out.json              |  9 ++++
a41c76
 .../checkpointdelete/basic-noparent-out.json  |  9 ++++
a41c76
 .../snapshots-current-out.json                |  9 ++++
a41c76
 .../snapshots-intermediate1-out.json          | 26 ++++++++++++
a41c76
 .../snapshots-intermediate2-out.json          | 26 ++++++++++++
a41c76
 .../snapshots-intermediate3-out.json          | 18 ++++++++
a41c76
 .../snapshots-noparent-out.json               | 42 +++++++++++++++++++
a41c76
 .../synthetic-current-out.json                |  9 ++++
a41c76
 .../synthetic-intermediate1-out.json          | 11 +++++
a41c76
 .../synthetic-intermediate2-out.json          | 11 +++++
a41c76
 .../synthetic-intermediate3-out.json          | 19 +++++++++
a41c76
 .../synthetic-noparent-out.json               | 11 +++++
a41c76
 16 files changed, 245 insertions(+)
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-current-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermediate1-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermediate2-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-intermediate3-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-current-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-intermediate1-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-intermediate2-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-intermediate3-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-noparent-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/synthetic-current-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/synthetic-intermediate1-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/synthetic-intermediate2-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/synthetic-intermediate3-out.json
a41c76
 create mode 100644 tests/qemublocktestdata/checkpointdelete/synthetic-noparent-out.json
a41c76
a41c76
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
a41c76
index 0ec964c2c6..7c8f67dd6b 100644
a41c76
--- a/tests/qemublocktest.c
a41c76
+++ b/tests/qemublocktest.c
a41c76
@@ -1329,6 +1329,24 @@ mymain(void)
a41c76
 
a41c76
     TEST_CHECKPOINT_DELETE("empty", "a", "empty");
a41c76
 
a41c76
+    TEST_CHECKPOINT_DELETE("basic-noparent", "a", "basic");
a41c76
+    TEST_CHECKPOINT_DELETE("basic-intermediate1", "b", "basic");
a41c76
+    TEST_CHECKPOINT_DELETE("basic-intermediate2", "c", "basic");
a41c76
+    TEST_CHECKPOINT_DELETE("basic-intermediate3", "d", "basic");
a41c76
+    TEST_CHECKPOINT_DELETE("basic-current", "current", "basic");
a41c76
+
a41c76
+    TEST_CHECKPOINT_DELETE("snapshots-noparent", "a", "snapshots");
a41c76
+    TEST_CHECKPOINT_DELETE("snapshots-intermediate1", "b", "snapshots");
a41c76
+    TEST_CHECKPOINT_DELETE("snapshots-intermediate2", "c", "snapshots");
a41c76
+    TEST_CHECKPOINT_DELETE("snapshots-intermediate3", "d", "snapshots");
a41c76
+    TEST_CHECKPOINT_DELETE("snapshots-current", "current", "snapshots");
a41c76
+
a41c76
+    TEST_CHECKPOINT_DELETE("synthetic-noparent", "a", "synthetic");
a41c76
+    TEST_CHECKPOINT_DELETE("synthetic-intermediate1", "b", "synthetic");
a41c76
+    TEST_CHECKPOINT_DELETE("synthetic-intermediate2", "c", "synthetic");
a41c76
+    TEST_CHECKPOINT_DELETE("synthetic-intermediate3", "d", "synthetic");
a41c76
+    TEST_CHECKPOINT_DELETE("synthetic-current", "current", "synthetic");
a41c76
+
a41c76
 #define TEST_BITMAP_VALIDATE(testname, bitmap, rc) \
a41c76
     do { \
a41c76
         blockbitmapvalidatedata.name = testname; \
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/basic-current-out.json b/tests/qemublocktestdata/checkpointdelete/basic-current-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..6ed1b63b66
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/basic-current-out.json
a41c76
@@ -0,0 +1,9 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-1-format",
a41c76
+      "name": "current"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/basic-intermediate1-out.json b/tests/qemublocktestdata/checkpointdelete/basic-intermediate1-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..e1dd4920cd
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/basic-intermediate1-out.json
a41c76
@@ -0,0 +1,9 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-1-format",
a41c76
+      "name": "b"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/basic-intermediate2-out.json b/tests/qemublocktestdata/checkpointdelete/basic-intermediate2-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..5638532d35
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/basic-intermediate2-out.json
a41c76
@@ -0,0 +1,9 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-1-format",
a41c76
+      "name": "c"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/basic-intermediate3-out.json b/tests/qemublocktestdata/checkpointdelete/basic-intermediate3-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..8c56b0e689
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/basic-intermediate3-out.json
a41c76
@@ -0,0 +1,9 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-1-format",
a41c76
+      "name": "d"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json b/tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..e87382fdb4
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json
a41c76
@@ -0,0 +1,9 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-1-format",
a41c76
+      "name": "a"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-current-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-current-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..6ed1b63b66
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/snapshots-current-out.json
a41c76
@@ -0,0 +1,9 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-1-format",
a41c76
+      "name": "current"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate1-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate1-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..1cde09131e
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate1-out.json
a41c76
@@ -0,0 +1,26 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-1-format",
a41c76
+      "name": "b"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-2-format",
a41c76
+      "name": "b"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "name": "b"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
+reopen nodes:
a41c76
+libvirt-3-format
a41c76
+libvirt-2-format
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate2-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate2-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..6fcd7ee0d1
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate2-out.json
a41c76
@@ -0,0 +1,26 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-1-format",
a41c76
+      "name": "c"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-2-format",
a41c76
+      "name": "c"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "name": "c"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
+reopen nodes:
a41c76
+libvirt-3-format
a41c76
+libvirt-2-format
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate3-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate3-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..2977dc3042
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/snapshots-intermediate3-out.json
a41c76
@@ -0,0 +1,18 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-1-format",
a41c76
+      "name": "d"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-2-format",
a41c76
+      "name": "d"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
+reopen nodes:
a41c76
+libvirt-2-format
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-noparent-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-noparent-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..e4a6a413a3
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/snapshots-noparent-out.json
a41c76
@@ -0,0 +1,42 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-1-format",
a41c76
+      "name": "a"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-2-format",
a41c76
+      "name": "a"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "name": "a"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-4-format",
a41c76
+      "name": "a"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-5-format",
a41c76
+      "name": "a"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
+reopen nodes:
a41c76
+libvirt-5-format
a41c76
+libvirt-4-format
a41c76
+libvirt-3-format
a41c76
+libvirt-2-format
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/synthetic-current-out.json b/tests/qemublocktestdata/checkpointdelete/synthetic-current-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..6ed1b63b66
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/synthetic-current-out.json
a41c76
@@ -0,0 +1,9 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-1-format",
a41c76
+      "name": "current"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate1-out.json b/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate1-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..6eb9716aaa
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate1-out.json
a41c76
@@ -0,0 +1,11 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "name": "b"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
+reopen nodes:
a41c76
+libvirt-3-format
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate2-out.json b/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate2-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..92b849cfc9
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate2-out.json
a41c76
@@ -0,0 +1,11 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "name": "c"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
+reopen nodes:
a41c76
+libvirt-3-format
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate3-out.json b/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate3-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..466df52007
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/synthetic-intermediate3-out.json
a41c76
@@ -0,0 +1,19 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-2-format",
a41c76
+      "name": "d"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "name": "d"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
+reopen nodes:
a41c76
+libvirt-3-format
a41c76
+libvirt-2-format
a41c76
diff --git a/tests/qemublocktestdata/checkpointdelete/synthetic-noparent-out.json b/tests/qemublocktestdata/checkpointdelete/synthetic-noparent-out.json
a41c76
new file mode 100644
a41c76
index 0000000000..0479815f36
a41c76
--- /dev/null
a41c76
+++ b/tests/qemublocktestdata/checkpointdelete/synthetic-noparent-out.json
a41c76
@@ -0,0 +1,11 @@
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-remove",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-5-format",
a41c76
+      "name": "a"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
+reopen nodes:
a41c76
+libvirt-5-format
a41c76
-- 
a41c76
2.27.0
a41c76