diff --git a/scripts/simplebench/bench-backup.py b/scripts/simplebench/bench-backup.py index 72eae85bb1..fbc85f266f 100755 --- a/scripts/simplebench/bench-backup.py +++ b/scripts/simplebench/bench-backup.py @@ -65,13 +65,26 @@ def bench(args): test_cases.append({'id': t, 'source': source, 'target': nbd_drv}) continue - fname = dirs[dst] + '/test-target' - if args.compressed: - fname += '.qcow2' - target = drv_file(fname) - if args.compressed: - target = drv_qcow2(target) - test_cases.append({'id': t, 'source': source, 'target': target}) + if args.target_cache == 'both': + target_caches = ['direct', 'cached'] + else: + target_caches = [args.target_cache] + + for c in target_caches: + o_direct = c == 'direct' + fname = dirs[dst] + '/test-target' + if args.compressed: + fname += '.qcow2' + target = drv_file(fname, o_direct=o_direct) + if args.compressed: + target = drv_qcow2(target) + + test_id = t + if args.target_cache == 'both': + test_id += f'({c})' + + test_cases.append({'id': test_id, 'source': source, + 'target': target}) binaries = [] # list of (