]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemublocktest: Add tests of broken bitmap chain handling during block-commit
authorPeter Krempa <pkrempa@redhat.com>
Wed, 4 Mar 2020 16:25:03 +0000 (17:25 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 16 Mar 2020 16:33:08 +0000 (17:33 +0100)
Use the 'snapshots-synthetic-broken' test data for block-commit.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
tests/qemublocktest.c
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2 [new file with mode: 0644]
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3 [new file with mode: 0644]
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4 [new file with mode: 0644]
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5 [new file with mode: 0644]
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3 [new file with mode: 0644]
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4 [new file with mode: 0644]
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5 [new file with mode: 0644]
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-3-4 [new file with mode: 0644]
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-3-5 [new file with mode: 0644]
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-4-5 [new file with mode: 0644]

index 5196a36d85c2982bb0feaa101170810d4fee6c79..fca8939fbb93527faaccbe211b67727cc8f5da3e 100644 (file)
@@ -1410,6 +1410,19 @@ mymain(void)
 
     TEST_BITMAP_BLOCKCOMMIT("snapshots-4-5", 4, 5, "snapshots");
 
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-1-2", 1, 2, "snapshots-synthetic-broken");
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-1-3", 1, 3, "snapshots-synthetic-broken");
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-1-4", 1, 4, "snapshots-synthetic-broken");
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-1-5", 1, 5, "snapshots-synthetic-broken");
+
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-2-3", 2, 3, "snapshots-synthetic-broken");
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-2-4", 2, 4, "snapshots-synthetic-broken");
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-2-5", 2, 5, "snapshots-synthetic-broken");
+
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-3-4", 3, 4, "snapshots-synthetic-broken");
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-3-5", 3, 5, "snapshots-synthetic-broken");
+
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-synthetic-broken-4-5", 4, 5, "snapshots-synthetic-broken");
 
  cleanup:
     qemuTestDriverFree(&driver);
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2
new file mode 100644 (file)
index 0000000..d413fbe
--- /dev/null
@@ -0,0 +1,27 @@
+pre job bitmap disable:
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-2-format",
+      "name": "current",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-2-format",
+      "target": "current",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "current"
+        }
+      ]
+    }
+  }
+]
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3
new file mode 100644 (file)
index 0000000..6eb14f9
--- /dev/null
@@ -0,0 +1,66 @@
+pre job bitmap disable:
+[
+  {
+    "type": "block-dirty-bitmap-disable",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "b"
+    }
+  }
+]
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-enable",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "b"
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "current",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "current",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "current"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "c",
+      "persistent": true,
+      "disabled": true,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "c",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "c"
+        }
+      ]
+    }
+  }
+]
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4
new file mode 100644 (file)
index 0000000..f4d9b72
--- /dev/null
@@ -0,0 +1,73 @@
+pre job bitmap disable:
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-4-format",
+      "name": "b",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-4-format",
+      "target": "b",
+      "bitmaps": [
+        {
+          "node": "libvirt-3-format",
+          "name": "b"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-4-format",
+      "name": "current",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-4-format",
+      "target": "current",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "current"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-4-format",
+      "name": "c",
+      "persistent": true,
+      "disabled": true,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-4-format",
+      "target": "c",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "c"
+        }
+      ]
+    }
+  }
+]
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5
new file mode 100644 (file)
index 0000000..a8e575c
--- /dev/null
@@ -0,0 +1,73 @@
+pre job bitmap disable:
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "b",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-5-format",
+      "target": "b",
+      "bitmaps": [
+        {
+          "node": "libvirt-3-format",
+          "name": "b"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "current",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-5-format",
+      "target": "current",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "current"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "c",
+      "persistent": true,
+      "disabled": true,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-5-format",
+      "target": "c",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "c"
+        }
+      ]
+    }
+  }
+]
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3
new file mode 100644 (file)
index 0000000..d468e2b
--- /dev/null
@@ -0,0 +1,43 @@
+pre job bitmap disable:
+[
+  {
+    "type": "block-dirty-bitmap-disable",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "b"
+    }
+  }
+]
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-enable",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "b"
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "c",
+      "persistent": true,
+      "disabled": true,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "c",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "c"
+        }
+      ]
+    }
+  }
+]
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4
new file mode 100644 (file)
index 0000000..2a9986b
--- /dev/null
@@ -0,0 +1,50 @@
+pre job bitmap disable:
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-4-format",
+      "name": "b",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-4-format",
+      "target": "b",
+      "bitmaps": [
+        {
+          "node": "libvirt-3-format",
+          "name": "b"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-4-format",
+      "name": "c",
+      "persistent": true,
+      "disabled": true,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-4-format",
+      "target": "c",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "c"
+        }
+      ]
+    }
+  }
+]
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5
new file mode 100644 (file)
index 0000000..47d9f6e
--- /dev/null
@@ -0,0 +1,50 @@
+pre job bitmap disable:
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "b",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-5-format",
+      "target": "b",
+      "bitmaps": [
+        {
+          "node": "libvirt-3-format",
+          "name": "b"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "c",
+      "persistent": true,
+      "disabled": true,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-5-format",
+      "target": "c",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "c"
+        }
+      ]
+    }
+  }
+]
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-3-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-3-4
new file mode 100644 (file)
index 0000000..367a930
--- /dev/null
@@ -0,0 +1,27 @@
+pre job bitmap disable:
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-4-format",
+      "name": "b",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-4-format",
+      "target": "b",
+      "bitmaps": [
+        {
+          "node": "libvirt-3-format",
+          "name": "b"
+        }
+      ]
+    }
+  }
+]
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-3-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-3-5
new file mode 100644 (file)
index 0000000..0062ec1
--- /dev/null
@@ -0,0 +1,27 @@
+pre job bitmap disable:
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "b",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-5-format",
+      "target": "b",
+      "bitmaps": [
+        {
+          "node": "libvirt-3-format",
+          "name": "b"
+        }
+      ]
+    }
+  }
+]
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-4-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-4-5
new file mode 100644 (file)
index 0000000..b1f10a8
--- /dev/null
@@ -0,0 +1,20 @@
+pre job bitmap disable:
+[
+  {
+    "type": "block-dirty-bitmap-disable",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "a"
+    }
+  }
+]
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-enable",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "a"
+    }
+  }
+]