mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 12:05:17 +00:00
qemublocktest: Add 'empty' case for incremental backup test
Use the new test data when calculating incremental backup operations. As incremental backup fails with no bitmap the test code is modified to allow testing this case too. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
15ef0c1c38
commit
218d00f443
@ -793,17 +793,16 @@ testQemuBackupIncrementalBitmapCalculate(const void *opaque)
|
||||
|
||||
incremental = testQemuBackupGetIncremental(data->incremental);
|
||||
|
||||
if (!(mergebitmaps = qemuBackupDiskPrepareOneBitmapsChain(incremental,
|
||||
data->chain,
|
||||
nodedata,
|
||||
"testdisk"))) {
|
||||
VIR_TEST_VERBOSE("failed to calculate merged bitmaps");
|
||||
return -1;
|
||||
if ((mergebitmaps = qemuBackupDiskPrepareOneBitmapsChain(incremental,
|
||||
data->chain,
|
||||
nodedata,
|
||||
"testdisk"))) {
|
||||
if (!(actual = virJSONValueToString(mergebitmaps, true)))
|
||||
return -1;
|
||||
} else {
|
||||
actual = g_strdup("NULL\n");
|
||||
}
|
||||
|
||||
if (!(actual = virJSONValueToString(mergebitmaps, true)))
|
||||
return -1;
|
||||
|
||||
return virTestCompareToFile(actual, expectpath);
|
||||
}
|
||||
|
||||
@ -1312,6 +1311,8 @@ mymain(void)
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
TEST_BACKUP_BITMAP_CALCULATE("empty", bitmapSourceChain, "a", "empty");
|
||||
|
||||
TEST_BACKUP_BITMAP_CALCULATE("basic-flat", bitmapSourceChain, "current", "basic");
|
||||
TEST_BACKUP_BITMAP_CALCULATE("basic-intermediate", bitmapSourceChain, "d", "basic");
|
||||
TEST_BACKUP_BITMAP_CALCULATE("basic-deep", bitmapSourceChain, "a", "basic");
|
||||
|
1
tests/qemublocktestdata/backupmerge/empty-out.json
Normal file
1
tests/qemublocktestdata/backupmerge/empty-out.json
Normal file
@ -0,0 +1 @@
|
||||
NULL
|
Loading…
x
Reference in New Issue
Block a user