Re: [RFC PATCH 10/16] tests: qemublock: Add test for checkpoint deletion bitmap merge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/9/20 12:21 PM, Peter Krempa wrote:
Add test infrastructure and a basic test for bitmap deletion.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
  tests/qemublocktest.c                         | 59 +++++++++++++++++++
  .../checkpointdelete/basic-noparent-out.json  |  9 +++
  2 files changed, 68 insertions(+)
  create mode 100644 tests/qemublocktestdata/checkpointdelete/basic-noparent-out.json


+static int
+testQemuCheckpointDeleteMerge(const void *opaque)
+{
+    const struct testQemuCheckpointDeleteMergeData *data = opaque;
+    g_autofree char *actual = NULL;
+    g_autofree char *expectpath = NULL;
+    g_autoptr(virJSONValue) actions = NULL;
+    bool currentcheckpoint;
+
+    expectpath = g_strdup_printf("%s/%s%s-out.json", abs_srcdir,
+                                 checkpointDeletePrefix, data->name);
+
+    if (!(actions = virJSONValueNewArray()))
+        return -1;
+
+    /* hack to get the 'current' state until the function stops accepting it */
+    currentcheckpoint = STREQ("current", data->deletebitmap);
+
+    if (qemuCheckpointDiscardDiskBitmaps(data->chain,
+                                         data->deletebitmap,
+                                         data->parentbitmap,
+                                         currentcheckpoint,
+                                         actions) < 0) {

Are there patches planned later on to change this? Or is this comment going to be an instance of technical debt for an unknown length of time?

At any rate, the test looks sane enough;
Reviewed-by: Eric Blake <eblake@xxxxxxxxxx>


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux