iotests: skip 232 when run tests as root
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tue, 3 Sep 2019 13:50:24 +0000 (16:50 +0300)
committerKevin Wolf <kwolf@redhat.com>
Tue, 10 Sep 2019 06:58:43 +0000 (08:58 +0200)
chmod a-w don't help under root, so skip the test in such case.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/qemu-iotests/232

index 2063f78876ed72022511371ee67ff2e8f2313081..65b0e420632bddd01a6bcdc5c503e392319af278 100755 (executable)
@@ -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