|
|
fbe740 |
From 686c7592b99c1e2c4831f14c4e101a4ab039c45e Mon Sep 17 00:00:00 2001
|
|
|
fbe740 |
Message-Id: <686c7592b99c1e2c4831f14c4e101a4ab039c45e@dist-git>
|
|
|
fbe740 |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
fbe740 |
Date: Tue, 4 Feb 2020 15:08:14 +0100
|
|
|
fbe740 |
Subject: [PATCH] tests: qemublock: Add checkpoint deletion tests for some
|
|
|
fbe740 |
special cases
|
|
|
fbe740 |
MIME-Version: 1.0
|
|
|
fbe740 |
Content-Type: text/plain; charset=UTF-8
|
|
|
fbe740 |
Content-Transfer-Encoding: 8bit
|
|
|
fbe740 |
|
|
|
fbe740 |
Use the synthetic test data to verify that the algorithm correctly picks
|
|
|
fbe740 |
bitmaps to merge when the bitmap is changed along with the image itself.
|
|
|
fbe740 |
|
|
|
fbe740 |
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
fbe740 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
fbe740 |
(cherry picked from commit 065e548ebf0e39c8f9d30d0637ecfa84803d8f98)
|
|
|
fbe740 |
|
|
|
fbe740 |
https://bugzilla.redhat.com/show_bug.cgi?id=1207659
|
|
|
fbe740 |
Message-Id: <c34b7a28b9943b6cf7546eb2ac4d4bf95a164f11.1580824112.git.pkrempa@redhat.com>
|
|
|
fbe740 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
fbe740 |
---
|
|
|
fbe740 |
tests/qemublocktest.c | 7 +++
|
|
|
fbe740 |
...hots-synthetic-checkpoint-current-out.json | 29 +++++++++
|
|
|
fbe740 |
...ynthetic-checkpoint-intermediate1-out.json | 29 +++++++++
|
|
|
fbe740 |
...ynthetic-checkpoint-intermediate2-out.json | 32 ++++++++++
|
|
|
fbe740 |
...ynthetic-checkpoint-intermediate3-out.json | 59 +++++++++++++++++++
|
|
|
fbe740 |
...ots-synthetic-checkpoint-noparent-out.json | 23 ++++++++
|
|
|
fbe740 |
6 files changed, 179 insertions(+)
|
|
|
fbe740 |
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-current-out.json
|
|
|
fbe740 |
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate1-out.json
|
|
|
fbe740 |
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate2-out.json
|
|
|
fbe740 |
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate3-out.json
|
|
|
fbe740 |
create mode 100644 tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-noparent-out.json
|
|
|
fbe740 |
|
|
|
fbe740 |
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
|
|
|
fbe740 |
index 897b86f970..2e5927f3c1 100644
|
|
|
fbe740 |
--- a/tests/qemublocktest.c
|
|
|
fbe740 |
+++ b/tests/qemublocktest.c
|
|
|
fbe740 |
@@ -1021,6 +1021,13 @@ mymain(void)
|
|
|
fbe740 |
TEST_CHECKPOINT_DELETE_MERGE("snapshots-intermediate3", "d", "c", "snapshots");
|
|
|
fbe740 |
TEST_CHECKPOINT_DELETE_MERGE("snapshots-current", "current", "d", "snapshots");
|
|
|
fbe740 |
|
|
|
fbe740 |
+ TEST_CHECKPOINT_DELETE_MERGE("snapshots-synthetic-checkpoint-noparent", "a", NULL, "snapshots-synthetic-checkpoint");
|
|
|
fbe740 |
+ TEST_CHECKPOINT_DELETE_MERGE("snapshots-synthetic-checkpoint-intermediate1", "b", "a", "snapshots-synthetic-checkpoint");
|
|
|
fbe740 |
+ TEST_CHECKPOINT_DELETE_MERGE("snapshots-synthetic-checkpoint-intermediate2", "c", "b", "snapshots-synthetic-checkpoint");
|
|
|
fbe740 |
+ TEST_CHECKPOINT_DELETE_MERGE("snapshots-synthetic-checkpoint-intermediate3", "d", "c", "snapshots-synthetic-checkpoint");
|
|
|
fbe740 |
+ TEST_CHECKPOINT_DELETE_MERGE("snapshots-synthetic-checkpoint-current", "current", "d", "snapshots-synthetic-checkpoint");
|
|
|
fbe740 |
+
|
|
|
fbe740 |
+
|
|
|
fbe740 |
cleanup:
|
|
|
fbe740 |
virHashFree(diskxmljsondata.schema);
|
|
|
fbe740 |
qemuTestDriverFree(&driver);
|
|
|
fbe740 |
diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-current-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-current-out.json
|
|
|
fbe740 |
new file mode 100644
|
|
|
fbe740 |
index 0000000000..1b607567e8
|
|
|
fbe740 |
--- /dev/null
|
|
|
fbe740 |
+++ b/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-current-out.json
|
|
|
fbe740 |
@@ -0,0 +1,29 @@
|
|
|
fbe740 |
+[
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-enable",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-1-format",
|
|
|
fbe740 |
+ "name": "d"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-merge",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-1-format",
|
|
|
fbe740 |
+ "target": "d",
|
|
|
fbe740 |
+ "bitmaps": [
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "node": "libvirt-1-format",
|
|
|
fbe740 |
+ "name": "current"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ ]
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-remove",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-1-format",
|
|
|
fbe740 |
+ "name": "current"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+]
|
|
|
fbe740 |
diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate1-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate1-out.json
|
|
|
fbe740 |
new file mode 100644
|
|
|
fbe740 |
index 0000000000..e979691e6f
|
|
|
fbe740 |
--- /dev/null
|
|
|
fbe740 |
+++ b/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate1-out.json
|
|
|
fbe740 |
@@ -0,0 +1,29 @@
|
|
|
fbe740 |
+[
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-enable",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-3-format",
|
|
|
fbe740 |
+ "name": "a"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-merge",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-3-format",
|
|
|
fbe740 |
+ "target": "a",
|
|
|
fbe740 |
+ "bitmaps": [
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "node": "libvirt-3-format",
|
|
|
fbe740 |
+ "name": "b"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ ]
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-remove",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-3-format",
|
|
|
fbe740 |
+ "name": "b"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+]
|
|
|
fbe740 |
diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate2-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate2-out.json
|
|
|
fbe740 |
new file mode 100644
|
|
|
fbe740 |
index 0000000000..e82098918a
|
|
|
fbe740 |
--- /dev/null
|
|
|
fbe740 |
+++ b/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate2-out.json
|
|
|
fbe740 |
@@ -0,0 +1,32 @@
|
|
|
fbe740 |
+[
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-add",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-2-format",
|
|
|
fbe740 |
+ "name": "b",
|
|
|
fbe740 |
+ "persistent": true,
|
|
|
fbe740 |
+ "disabled": true,
|
|
|
fbe740 |
+ "granularity": 65536
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-merge",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-2-format",
|
|
|
fbe740 |
+ "target": "b",
|
|
|
fbe740 |
+ "bitmaps": [
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "node": "libvirt-2-format",
|
|
|
fbe740 |
+ "name": "c"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ ]
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-remove",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-2-format",
|
|
|
fbe740 |
+ "name": "c"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+]
|
|
|
fbe740 |
diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate3-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate3-out.json
|
|
|
fbe740 |
new file mode 100644
|
|
|
fbe740 |
index 0000000000..dc87dd60b8
|
|
|
fbe740 |
--- /dev/null
|
|
|
fbe740 |
+++ b/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-intermediate3-out.json
|
|
|
fbe740 |
@@ -0,0 +1,59 @@
|
|
|
fbe740 |
+[
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-add",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-1-format",
|
|
|
fbe740 |
+ "name": "c",
|
|
|
fbe740 |
+ "persistent": true,
|
|
|
fbe740 |
+ "disabled": true,
|
|
|
fbe740 |
+ "granularity": 65536
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-merge",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-1-format",
|
|
|
fbe740 |
+ "target": "c",
|
|
|
fbe740 |
+ "bitmaps": [
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "node": "libvirt-1-format",
|
|
|
fbe740 |
+ "name": "d"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ ]
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-remove",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-1-format",
|
|
|
fbe740 |
+ "name": "d"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-enable",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-2-format",
|
|
|
fbe740 |
+ "name": "c"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-merge",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-2-format",
|
|
|
fbe740 |
+ "target": "c",
|
|
|
fbe740 |
+ "bitmaps": [
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "node": "libvirt-2-format",
|
|
|
fbe740 |
+ "name": "d"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ ]
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-remove",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-2-format",
|
|
|
fbe740 |
+ "name": "d"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+]
|
|
|
fbe740 |
diff --git a/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-noparent-out.json b/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-noparent-out.json
|
|
|
fbe740 |
new file mode 100644
|
|
|
fbe740 |
index 0000000000..45a84b47c2
|
|
|
fbe740 |
--- /dev/null
|
|
|
fbe740 |
+++ b/tests/qemublocktestdata/checkpointdelete/snapshots-synthetic-checkpoint-noparent-out.json
|
|
|
fbe740 |
@@ -0,0 +1,23 @@
|
|
|
fbe740 |
+[
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-remove",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-3-format",
|
|
|
fbe740 |
+ "name": "a"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-remove",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-4-format",
|
|
|
fbe740 |
+ "name": "a"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ },
|
|
|
fbe740 |
+ {
|
|
|
fbe740 |
+ "type": "block-dirty-bitmap-remove",
|
|
|
fbe740 |
+ "data": {
|
|
|
fbe740 |
+ "node": "libvirt-5-format",
|
|
|
fbe740 |
+ "name": "a"
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
+]
|
|
|
fbe740 |
--
|
|
|
fbe740 |
2.25.0
|
|
|
fbe740 |
|