[Qemu-devel] [PATCH] iotests: skip 232 when run tests as root

Vladimir Sementsov-Ogievskiy posted 1 patch 6 years, 2 months ago
Test docker-clang@ubuntu passed
Test FreeBSD passed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190903132110.380933-1-vsementsov@virtuozzo.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
There is a newer version of this series
tests/qemu-iotests/232 | 6 ++++++
1 file changed, 6 insertions(+)
[Qemu-devel] [PATCH] iotests: skip 232 when run tests as root
Posted by Vladimir Sementsov-Ogievskiy 6 years, 2 months ago
chmod a-w don't help under root, so skip the test in such case.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---

 tests/qemu-iotests/232 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
index 2063f78876..da35a63d85 100755
--- a/tests/qemu-iotests/232
+++ b/tests/qemu-iotests/232
@@ -70,6 +70,12 @@ size=128M
 
 _make_test_img $size
 
+chmod a-w $TEST_IMG
+(echo test > $TEST_IMG) 2>/dev/null && \
+    _notrun "Readonly attribute is ignored, probably you run this test as" \
+            "root, which is unsupported."
+chmod a+w $TEST_IMG
+
 if [ -n "$TEST_IMG_FILE" ]; then
     TEST_IMG=$TEST_IMG_FILE
 fi
-- 
2.18.0


Re: [Qemu-devel] [PATCH] iotests: skip 232 when run tests as root
Posted by Kevin Wolf 6 years, 2 months ago
Am 03.09.2019 um 15:21 hat Vladimir Sementsov-Ogievskiy geschrieben:
> chmod a-w don't help under root, so skip the test in such case.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> 
>  tests/qemu-iotests/232 | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
> index 2063f78876..da35a63d85 100755
> --- a/tests/qemu-iotests/232
> +++ b/tests/qemu-iotests/232
> @@ -70,6 +70,12 @@ size=128M
>  
>  _make_test_img $size
>  
> +chmod a-w $TEST_IMG
> +(echo test > $TEST_IMG) 2>/dev/null && \
> +    _notrun "Readonly attribute is ignored, probably you run this test as" \
> +            "root, which is unsupported."
> +chmod a+w $TEST_IMG
> +
>  if [ -n "$TEST_IMG_FILE" ]; then
>      TEST_IMG=$TEST_IMG_FILE
>  fi

I think you need to move the new check below this so that $TEST_IMG_FILE
is considered because otherwise the test will fail for luks:

+chmod: cannot access 'driver=luks,key-secret=keysec0,file.filename=/home/kwolf/source/qemu/tests/qemu-iotests/scratch/t.luks': No such file or directory
+chmod: cannot access 'driver=luks,key-secret=keysec0,file.filename=/home/kwolf/source/qemu/tests/qemu-iotests/scratch/t.luks': No such file or directory

Kevin

Re: [Qemu-devel] [PATCH] iotests: skip 232 when run tests as root
Posted by Vladimir Sementsov-Ogievskiy 6 years, 2 months ago
03.09.2019 16:38, Kevin Wolf wrote:
> Am 03.09.2019 um 15:21 hat Vladimir Sementsov-Ogievskiy geschrieben:
>> chmod a-w don't help under root, so skip the test in such case.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> ---
>>
>>   tests/qemu-iotests/232 | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
>> index 2063f78876..da35a63d85 100755
>> --- a/tests/qemu-iotests/232
>> +++ b/tests/qemu-iotests/232
>> @@ -70,6 +70,12 @@ size=128M
>>   
>>   _make_test_img $size
>>   
>> +chmod a-w $TEST_IMG
>> +(echo test > $TEST_IMG) 2>/dev/null && \
>> +    _notrun "Readonly attribute is ignored, probably you run this test as" \
>> +            "root, which is unsupported."
>> +chmod a+w $TEST_IMG
>> +
>>   if [ -n "$TEST_IMG_FILE" ]; then
>>       TEST_IMG=$TEST_IMG_FILE
>>   fi
> 
> I think you need to move the new check below this so that $TEST_IMG_FILE
> is considered because otherwise the test will fail for luks:
> 
> +chmod: cannot access 'driver=luks,key-secret=keysec0,file.filename=/home/kwolf/source/qemu/tests/qemu-iotests/scratch/t.luks': No such file or directory
> +chmod: cannot access 'driver=luks,key-secret=keysec0,file.filename=/home/kwolf/source/qemu/tests/qemu-iotests/scratch/t.luks': No such file or directory
> 

Thanks, will resend


-- 
Best regards,
Vladimir