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(a)redhat.com>
---
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(a)redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization:
qemu.org |
libvirt.org