diff options
author | Nir Soffer <nirsof@gmail.com> | 2020-08-29 02:21:50 +0300 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2020-09-15 11:05:12 +0200 |
commit | a242b19e80faa95fd5856fca2d4115e853d465b1 (patch) | |
tree | ed2f7f4a0535e15efd84b1aae5c99177e605d6b8 /tests/qemu-iotests/257 | |
parent | f765af87c203723f77da37716a74f0eca99f192c (diff) | |
download | qemu-a242b19e80faa95fd5856fca2d4115e853d465b1.zip qemu-a242b19e80faa95fd5856fca2d4115e853d465b1.tar.gz qemu-a242b19e80faa95fd5856fca2d4115e853d465b1.tar.bz2 |
qemu-iotests: Support varargs syntax in FilePaths
Accept variable number of names instead of a sequence:
with FilePaths("a", "b", "c") as (a, b, c):
The disadvantage is that base_dir must be used as kwarg:
with FilePaths("a", "b", base_dir=soc_dir) as (sock1, sock2):
But this is more clear and calling optional argument as positional
arguments is bad idea anyway.
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200828232152.205833-4-nsoffer@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/257')
-rwxr-xr-x | tests/qemu-iotests/257 | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index e1e6077..a9aa65b 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -275,10 +275,9 @@ def test_bitmap_sync(bsync_mode, msync_mode='bitmap', failure=None): an incomplete backup. Testing limitations prevent testing competing writes. """ - with iotests.FilePaths(['img', 'bsync1', 'bsync2', - 'fbackup0', 'fbackup1', 'fbackup2']) as \ - (img_path, bsync1, bsync2, - fbackup0, fbackup1, fbackup2), \ + with iotests.FilePaths( + 'img', 'bsync1', 'bsync2', 'fbackup0', 'fbackup1', 'fbackup2') as \ + (img_path, bsync1, bsync2, fbackup0, fbackup1, fbackup2), \ iotests.VM() as vm: mode = "Mode {:s}; Bitmap Sync {:s}".format(msync_mode, bsync_mode) @@ -441,8 +440,7 @@ def test_backup_api(): """ Test malformed and prohibited invocations of the backup API. """ - with iotests.FilePaths(['img', 'bsync1']) as \ - (img_path, backup_path), \ + with iotests.FilePaths('img', 'bsync1') as (img_path, backup_path), \ iotests.VM() as vm: log("\n=== API failure tests ===\n") |