Skip to contentSkip to conversation

iotests: skip 232 when run tests as root

PATCH Superseded Vladimir Sementsov-Ogievskiy 2 participants 3 messages Sep 3, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iotests: skip 232 when run tests as root

chmod a-w don't help under root, so skip the test in such case.

---

 tests/qemu-iotests/232 | 6 ++++++
 1 file changed, 6 insertions(+)
tests/qemu-iotests/232 +6 -0
index 2063f78876..da35a63d85 100755
@@ -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
Signature · 1 line
2.18.0
#1 lore raw

Am 03.09.2019 um 15:21 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 15 lines

chmod a-w don't help under root, so skip the test in such case.

---

 tests/qemu-iotests/232 | 6 ++++++
 1 file changed, 6 insertions(+)
tests/qemu-iotests/232 +0 -0
index 2063f78876..da35a63d85 100755
@@ -70,6 +70,12 @@ size=128M
 
 _make_test_img $size

tests/qemu-iotests/232 size=128M · line 81

Quoted 10 lines
tests/qemu-iotests/232 +6 -0
 
+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

#2 lore raw
Quoted 31 lines · Kevin Wolf

Am 03.09.2019 um 15:21 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 15 lines

chmod a-w don't help under root, so skip the test in such case.

---

  tests/qemu-iotests/232 | 6 ++++++
  1 file changed, 6 insertions(+)
tests/qemu-iotests/232 +0 -0
index 2063f78876..da35a63d85 100755
@@ -70,6 +70,12 @@ size=128M
 
  _make_test_img $size

tests/qemu-iotests/232 size=128M · line 81

Quoted 10 lines
tests/qemu-iotests/232 +6 -0
 
+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:

Review

Quoted 2 lines
(quoted diff) +2 -0
+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

Signature · 2 lines
Best regards,
Vladimir