[v2] iotests: skip 232 when run tests as root
diff mbox series

Message ID 20190903135024.498239-1-vsementsov@virtuozzo.com
State New
Headers show
Series
  • [v2] iotests: skip 232 when run tests as root
Related show

Commit Message

Vladimir Sementsov-Ogievskiy Sept. 3, 2019, 1:50 p.m. UTC
chmod a-w don't help under root, so skip the test in such case.

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

v2: move new check under TEST_IMG=TEST_IMG_FILE workaround [Kevin]

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

Comments

Kevin Wolf Sept. 3, 2019, 2:16 p.m. UTC | #1
Am 03.09.2019 um 15:50 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>

Thanks, applied to the block branch.

Kevin
Eric Blake Sept. 3, 2019, 3:05 p.m. UTC | #2
On 9/3/19 8:50 AM, Vladimir Sementsov-Ogievskiy wrote:
> chmod a-w don't help under root, so skip the test in such case.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> 
> v2: move new check under TEST_IMG=TEST_IMG_FILE workaround [Kevin]
> 
>  tests/qemu-iotests/232 | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
> index 2063f78876..65b0e42063 100755
> --- a/tests/qemu-iotests/232
> +++ b/tests/qemu-iotests/232
> @@ -74,6 +74,12 @@ if [ -n "$TEST_IMG_FILE" ]; then
>      TEST_IMG=$TEST_IMG_FILE
>  fi
>  
> +chmod a-w $TEST_IMG
> +(echo test > $TEST_IMG) 2>/dev/null && \
> +    _notrun "Readonly attribute is ignored, probably you run this test as" \

s/run/ran/

> +            "root, which is unsupported."
> +chmod a+w $TEST_IMG
> +
>  echo
>  echo "=== -drive with read-write image: read-only/auto-read-only combinations ==="
>  echo
>

Patch
diff mbox series

diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
index 2063f78876..65b0e42063 100755
--- a/tests/qemu-iotests/232
+++ b/tests/qemu-iotests/232
@@ -74,6 +74,12 @@  if [ -n "$TEST_IMG_FILE" ]; then
     TEST_IMG=$TEST_IMG_FILE
 fi
 
+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
+
 echo
 echo "=== -drive with read-write image: read-only/auto-read-only combinations ==="
 echo