render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
fbe740
From 0dc8024eae1f56e02228171feb824becf21ee697 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <0dc8024eae1f56e02228171feb824becf21ee697@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Tue, 17 Mar 2020 17:12:46 +0100
fbe740
Subject: [PATCH] qemublocktest: Add tests for re-enabling of bitmaps after
fbe740
 commit
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
Some branches were not covered and thus we didn't catch that the bitmaps
fbe740
are not re-enabled if nothing is merged into them. Two bitmaps are
fbe740
necessary to reliably test the case due to hash table ordering.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
fbe740
Tested-by: Daniel P. Berrangé <berrange@redhat.com>
fbe740
(cherry picked from commit cab3622119a73a54e62e5f2d7b4257da00bd4ac8)
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1799013
fbe740
Message-Id: <fc3f48f6a5233fce3148fc21a63c4e0255b2e466.1584461519.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 .../bitmap/snapshots-synthetic-broken.json    | 18 ++++++++
fbe740
 .../bitmap/snapshots-synthetic-broken.out     |  2 +
fbe740
 .../snapshots-synthetic-broken-1-2            | 30 ++++++++++++
fbe740
 .../snapshots-synthetic-broken-1-3            | 46 +++++++++++++++++++
fbe740
 .../snapshots-synthetic-broken-1-4            | 46 +++++++++++++++++++
fbe740
 .../snapshots-synthetic-broken-1-5            | 46 +++++++++++++++++++
fbe740
 .../snapshots-synthetic-broken-2-3            | 46 +++++++++++++++++++
fbe740
 .../snapshots-synthetic-broken-2-4            | 46 +++++++++++++++++++
fbe740
 .../snapshots-synthetic-broken-2-5            | 46 +++++++++++++++++++
fbe740
 9 files changed, 326 insertions(+)
fbe740
fbe740
diff --git a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
fbe740
index bf4963494f..8cf14d4baa 100644
fbe740
--- a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
fbe740
+++ b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
fbe740
@@ -398,6 +398,24 @@
fbe740
                 "granularity": 65536,
fbe740
                 "count": 0
fbe740
             },
fbe740
+            {
fbe740
+                "name": "oa",
fbe740
+                "recording": true,
fbe740
+                "persistent": true,
fbe740
+                "busy": false,
fbe740
+                "status": "active",
fbe740
+                "granularity": 65536,
fbe740
+                "count": 0
fbe740
+            },
fbe740
+            {
fbe740
+                "name": "ob",
fbe740
+                "recording": true,
fbe740
+                "persistent": true,
fbe740
+                "busy": false,
fbe740
+                "status": "active",
fbe740
+                "granularity": 65536,
fbe740
+                "count": 0
fbe740
+            },
fbe740
             {
fbe740
                 "name": "d",
fbe740
                 "recording": true,
fbe740
diff --git a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
fbe740
index 022630bd76..ad24a580f1 100644
fbe740
--- a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
fbe740
+++ b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
fbe740
@@ -3,6 +3,8 @@ libvirt-1-format:
fbe740
   current: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
fbe740
 libvirt-2-format:
fbe740
         c: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
fbe740
+       oa: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
fbe740
+       ob: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
fbe740
         d: record:1 busy:0 persist:1 inconsist:1 gran:65536 dirty:0
fbe740
 libvirt-3-format:
fbe740
         a: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
fbe740
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2
fbe740
index d413fbe723..463120d442 100644
fbe740
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2
fbe740
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2
fbe740
@@ -1,4 +1,20 @@
fbe740
 pre job bitmap disable:
fbe740
+[
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-disable",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-2-format",
fbe740
+      "name": "oa"
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-disable",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-2-format",
fbe740
+      "name": "ob"
fbe740
+    }
fbe740
+  }
fbe740
+]
fbe740
 merge bitmpas:
fbe740
 [
fbe740
   {
fbe740
@@ -23,5 +39,19 @@ merge bitmpas:
fbe740
         }
fbe740
       ]
fbe740
     }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-enable",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-2-format",
fbe740
+      "name": "oa"
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-enable",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-2-format",
fbe740
+      "name": "ob"
fbe740
+    }
fbe740
   }
fbe740
 ]
fbe740
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3
fbe740
index 6eb14f927a..fec6f95dd1 100644
fbe740
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3
fbe740
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3
fbe740
@@ -62,5 +62,51 @@ merge bitmpas:
fbe740
         }
fbe740
       ]
fbe740
     }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-3-format",
fbe740
+      "name": "oa",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-3-format",
fbe740
+      "target": "oa",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "oa"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-3-format",
fbe740
+      "name": "ob",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-3-format",
fbe740
+      "target": "ob",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "ob"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
   }
fbe740
 ]
fbe740
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4
fbe740
index f4d9b72576..697230f67b 100644
fbe740
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4
fbe740
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4
fbe740
@@ -69,5 +69,51 @@ merge bitmpas:
fbe740
         }
fbe740
       ]
fbe740
     }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-4-format",
fbe740
+      "name": "oa",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-4-format",
fbe740
+      "target": "oa",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "oa"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-4-format",
fbe740
+      "name": "ob",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-4-format",
fbe740
+      "target": "ob",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "ob"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
   }
fbe740
 ]
fbe740
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5
fbe740
index a8e575c2d9..6bf1f0da64 100644
fbe740
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5
fbe740
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5
fbe740
@@ -69,5 +69,51 @@ merge bitmpas:
fbe740
         }
fbe740
       ]
fbe740
     }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-5-format",
fbe740
+      "name": "oa",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-5-format",
fbe740
+      "target": "oa",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "oa"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-5-format",
fbe740
+      "name": "ob",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-5-format",
fbe740
+      "target": "ob",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "ob"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
   }
fbe740
 ]
fbe740
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3
fbe740
index d468e2b9d8..f202bb94b1 100644
fbe740
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3
fbe740
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3
fbe740
@@ -39,5 +39,51 @@ merge bitmpas:
fbe740
         }
fbe740
       ]
fbe740
     }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-3-format",
fbe740
+      "name": "oa",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-3-format",
fbe740
+      "target": "oa",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "oa"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-3-format",
fbe740
+      "name": "ob",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-3-format",
fbe740
+      "target": "ob",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "ob"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
   }
fbe740
 ]
fbe740
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4
fbe740
index 2a9986bac6..864cc9041b 100644
fbe740
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4
fbe740
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4
fbe740
@@ -46,5 +46,51 @@ merge bitmpas:
fbe740
         }
fbe740
       ]
fbe740
     }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-4-format",
fbe740
+      "name": "oa",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-4-format",
fbe740
+      "target": "oa",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "oa"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-4-format",
fbe740
+      "name": "ob",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-4-format",
fbe740
+      "target": "ob",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "ob"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
   }
fbe740
 ]
fbe740
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5
fbe740
index 47d9f6e17a..4c5d8dbe80 100644
fbe740
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5
fbe740
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5
fbe740
@@ -46,5 +46,51 @@ merge bitmpas:
fbe740
         }
fbe740
       ]
fbe740
     }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-5-format",
fbe740
+      "name": "oa",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-5-format",
fbe740
+      "target": "oa",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "oa"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-add",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-5-format",
fbe740
+      "name": "ob",
fbe740
+      "persistent": true,
fbe740
+      "disabled": false,
fbe740
+      "granularity": 65536
fbe740
+    }
fbe740
+  },
fbe740
+  {
fbe740
+    "type": "block-dirty-bitmap-merge",
fbe740
+    "data": {
fbe740
+      "node": "libvirt-5-format",
fbe740
+      "target": "ob",
fbe740
+      "bitmaps": [
fbe740
+        {
fbe740
+          "node": "libvirt-2-format",
fbe740
+          "name": "ob"
fbe740
+        }
fbe740
+      ]
fbe740
+    }
fbe740
   }
fbe740
 ]
fbe740
-- 
fbe740
2.25.1
fbe740