diff mbox

[2/1] qemu-iotests: Test backing_fmt with backing node reference

Message ID 20171017151149.28062-1-kwolf@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kevin Wolf Oct. 17, 2017, 3:11 p.m. UTC
This changes test case 191 to include a backing image that has
backing_fmt set in the image file, but is referenced by node name in the
qemu command line.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/191     | 5 +++--
 tests/qemu-iotests/191.out | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Kevin Wolf Oct. 17, 2017, 3:16 p.m. UTC | #1
Am 17.10.2017 um 17:11 hat Kevin Wolf geschrieben:
> This changes test case 191 to include a backing image that has
> backing_fmt set in the image file, but is referenced by node name in the
> qemu command line.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  tests/qemu-iotests/191     | 5 +++--
>  tests/qemu-iotests/191.out | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191
> index ac2b88fd78..00202efd47 100755
> --- a/tests/qemu-iotests/191
> +++ b/tests/qemu-iotests/191
> @@ -56,9 +56,10 @@ echo === Preparing and starting VM ===
>  echo
>  
>  TEST_IMG="${TEST_IMG}.base" _make_test_img $size
> -TEST_IMG="${TEST_IMG}.mid" _make_test_img -b "${TEST_IMG}.base"
> +IMGOPTS=$(_optstr_add "$IMGOPTS" "backing_fmt=$IMGFMT") \
> +    TEST_IMG="${TEST_IMG}.mid" _make_test_img -b "${TEST_IMG}.base" $size
>  _make_test_img -b "${TEST_IMG}.mid"
> -TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid"
> +TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid" $size

Please pretend you don't see the addition of " $size" here, it's
unnecessary and I'll remove it again.

Kevin
Eric Blake Oct. 17, 2017, 9:44 p.m. UTC | #2
On 10/17/2017 10:16 AM, Kevin Wolf wrote:
> Am 17.10.2017 um 17:11 hat Kevin Wolf geschrieben:
>> This changes test case 191 to include a backing image that has
>> backing_fmt set in the image file, but is referenced by node name in the
>> qemu command line.
>>
>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>> ---
>>  tests/qemu-iotests/191     | 5 +++--
>>  tests/qemu-iotests/191.out | 2 +-
>>  2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191
>> index ac2b88fd78..00202efd47 100755
>> --- a/tests/qemu-iotests/191
>> +++ b/tests/qemu-iotests/191
>> @@ -56,9 +56,10 @@ echo === Preparing and starting VM ===
>>  echo
>>  
>>  TEST_IMG="${TEST_IMG}.base" _make_test_img $size
>> -TEST_IMG="${TEST_IMG}.mid" _make_test_img -b "${TEST_IMG}.base"
>> +IMGOPTS=$(_optstr_add "$IMGOPTS" "backing_fmt=$IMGFMT") \
>> +    TEST_IMG="${TEST_IMG}.mid" _make_test_img -b "${TEST_IMG}.base" $size
>>  _make_test_img -b "${TEST_IMG}.mid"
>> -TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid"
>> +TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid" $size
> 
> Please pretend you don't see the addition of " $size" here, it's
> unnecessary and I'll remove it again.

As tweaked,
Reviewed-by: Eric Blake <eblake@redhat.com>
diff mbox

Patch

diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191
index ac2b88fd78..00202efd47 100755
--- a/tests/qemu-iotests/191
+++ b/tests/qemu-iotests/191
@@ -56,9 +56,10 @@  echo === Preparing and starting VM ===
 echo
 
 TEST_IMG="${TEST_IMG}.base" _make_test_img $size
-TEST_IMG="${TEST_IMG}.mid" _make_test_img -b "${TEST_IMG}.base"
+IMGOPTS=$(_optstr_add "$IMGOPTS" "backing_fmt=$IMGFMT") \
+    TEST_IMG="${TEST_IMG}.mid" _make_test_img -b "${TEST_IMG}.base" $size
 _make_test_img -b "${TEST_IMG}.mid"
-TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid"
+TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid" $size
 
 $QEMU_IO -c 'write -P 0x55 1M 64k' "${TEST_IMG}.mid" | _filter_qemu_io
 
diff --git a/tests/qemu-iotests/191.out b/tests/qemu-iotests/191.out
index 7bfcd2d5d8..6157fa520f 100644
--- a/tests/qemu-iotests/191.out
+++ b/tests/qemu-iotests/191.out
@@ -3,7 +3,7 @@  QA output created by 191
 === Preparing and starting VM ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
 Formatting 'TEST_DIR/t.IMGFMT.ovl2', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
 wrote 65536/65536 bytes at offset 1048576