aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/257
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2019-07-29 16:35:55 -0400
committerJohn Snow <jsnow@redhat.com>2019-08-16 18:29:43 -0400
commitbd5ceebf6d77e680058e2325765bdedc9292ed76 (patch)
treeec483fb8e0b32e3a96196e3940a8d498022032f7 /tests/qemu-iotests/257
parent1a2b8b406bea1108c990b6fc932bef63211de245 (diff)
iotests/257: test traditional sync modes
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-12-jsnow@redhat.com [Edit 'Bitmap' --> 'bitmap' in 257.out --js] Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/257')
-rwxr-xr-xtests/qemu-iotests/25741
1 files changed, 39 insertions, 2 deletions
diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257
index 53ab31c92e..c2a72c577a 100755
--- a/tests/qemu-iotests/257
+++ b/tests/qemu-iotests/257
@@ -283,6 +283,12 @@ def test_bitmap_sync(bsync_mode, msync_mode='bitmap', failure=None):
Bitmaps are always synchronized, regardless of failure.
(Partial images must be kept.)
+ :param msync_mode: The mirror sync mode to use for the first backup.
+ Can be any one of:
+ - bitmap: Backups based on bitmap manifest.
+ - full: Full backups.
+ - top: Full backups of the top layer only.
+
:param failure: Is the (optional) failure mode, and can be any of:
- None: No failure. Test the normative path. Default.
- simulated: Cancel the job right before it completes.
@@ -393,7 +399,7 @@ def test_bitmap_sync(bsync_mode, msync_mode='bitmap', failure=None):
# group 1 gets cleared first, then group two gets written.
if ((bsync_mode == 'on-success' and not failure) or
(bsync_mode == 'always')):
- ebitmap.clear_group(1)
+ ebitmap.clear()
ebitmap.dirty_group(2)
vm.run_job(job, auto_dismiss=True, auto_finalize=False,
@@ -404,8 +410,19 @@ def test_bitmap_sync(bsync_mode, msync_mode='bitmap', failure=None):
log('')
if bsync_mode == 'always' and failure == 'intermediate':
+ # TOP treats anything allocated as dirty, expect to see:
+ if msync_mode == 'top':
+ ebitmap.dirty_group(0)
+
# We manage to copy one sector (one bit) before the error.
ebitmap.clear_bit(ebitmap.first_bit)
+
+ # Full returns all bits set except what was copied/skipped
+ if msync_mode == 'full':
+ fail_bit = ebitmap.first_bit
+ ebitmap.clear()
+ ebitmap.dirty_bits(range(fail_bit, SIZE // GRANULARITY))
+
ebitmap.compare(get_bitmap(bitmaps, drive0.device, 'bitmap0'))
# 2 - Writes and Reference Backup
@@ -499,10 +516,25 @@ def test_backup_api():
'bitmap404': ['on-success', 'always', 'never', None],
'bitmap0': [None],
},
+ 'full': {
+ None: ['on-success', 'always', 'never'],
+ 'bitmap404': ['on-success', 'always', 'never', None],
+ 'bitmap0': ['never', None],
+ },
+ 'top': {
+ None: ['on-success', 'always', 'never'],
+ 'bitmap404': ['on-success', 'always', 'never', None],
+ 'bitmap0': ['never', None],
+ },
+ 'none': {
+ None: ['on-success', 'always', 'never'],
+ 'bitmap404': ['on-success', 'always', 'never', None],
+ 'bitmap0': ['on-success', 'always', 'never', None],
+ }
}
# Dicts, as always, are not stably-ordered prior to 3.7, so use tuples:
- for sync_mode in ('incremental', 'bitmap'):
+ for sync_mode in ('incremental', 'bitmap', 'full', 'top', 'none'):
log("-- Sync mode {:s} tests --\n".format(sync_mode))
for bitmap in (None, 'bitmap404', 'bitmap0'):
for policy in error_cases[sync_mode][bitmap]:
@@ -517,6 +549,11 @@ def main():
for failure in ("simulated", "intermediate", None):
test_bitmap_sync(bsync_mode, "bitmap", failure)
+ for sync_mode in ('full', 'top'):
+ for bsync_mode in ('on-success', 'always'):
+ for failure in ('simulated', 'intermediate', None):
+ test_bitmap_sync(bsync_mode, sync_mode, failure)
+
test_backup_api()
if __name__ == '__main__':