From 081af2b88972972f000593d10629f0f269a7ad41 Mon Sep 17 00:00:00 2001 Message-Id: <081af2b88972972f000593d10629f0f269a7ad41@dist-git> From: Peter Krempa Date: Tue, 23 Jun 2020 12:23:41 +0200 Subject: [PATCH] qemublocktest: Add 'empty' case for checkpoint deletion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the new test data for checkpoint deletion testing. This test also requires modification of the internals to allow checking for test failure. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake (cherry picked from commit 88f175d88718114c032107df102d7c8071f0a38e) https://bugzilla.redhat.com/show_bug.cgi?id=1804593 Message-Id: <957325a358cad71b3002dd03c3ec656ee4f225a9.1592906423.git.pkrempa@redhat.com> Reviewed-by: Ján Tomko --- tests/qemublocktest.c | 13 +++++++------ .../checkpointdelete/empty-out.json | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 tests/qemublocktestdata/checkpointdelete/empty-out.json diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 3ef6ccec9b..5f1c68f6de 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -851,14 +851,13 @@ testQemuCheckpointDeleteMerge(const void *opaque) data->parentbitmap, actions, "testdisk", - &reopenimages) < 0) { - VIR_TEST_VERBOSE("failed to generate checkpoint delete transaction\n"); - return -1; + &reopenimages) >= 0) { + if (virJSONValueToBuffer(actions, &buf, true) < 0) + return -1; + } else { + virBufferAddLit(&buf, "NULL\n"); } - if (virJSONValueToBuffer(actions, &buf, true) < 0) - return -1; - if (reopenimages) { virBufferAddLit(&buf, "reopen nodes:\n"); @@ -1332,6 +1331,8 @@ mymain(void) ret = -1; \ } while (0) + TEST_CHECKPOINT_DELETE_MERGE("empty", "a", NULL, "empty"); + TEST_CHECKPOINT_DELETE_MERGE("basic-noparent", "a", NULL, "basic"); TEST_CHECKPOINT_DELETE_MERGE("basic-intermediate1", "b", "a", "basic"); TEST_CHECKPOINT_DELETE_MERGE("basic-intermediate2", "c", "b", "basic"); diff --git a/tests/qemublocktestdata/checkpointdelete/empty-out.json b/tests/qemublocktestdata/checkpointdelete/empty-out.json new file mode 100644 index 0000000000..7951defec1 --- /dev/null +++ b/tests/qemublocktestdata/checkpointdelete/empty-out.json @@ -0,0 +1 @@ +NULL -- 2.27.0