[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH for 3.1? or 4 v4 1/1] qemu-iotests: Don't run the te

From: Farhan Ali
Subject: [Qemu-block] [PATCH for 3.1? or 4 v4 1/1] qemu-iotests: Don't run the test when user is root
Date: Mon, 3 Dec 2018 19:35:57 -0500

Test 232 creates image files with read-only permission and
expects an error message when trying to access the image
files with read-only and auto-read-only turned off.

Don't run as root user, since root can open files with read/write
access for read-only files.

Signed-off-by: Farhan Ali <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
 tests/qemu-iotests/232 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
index 0708b8b..1d34242 100755
--- a/tests/qemu-iotests/232
+++ b/tests/qemu-iotests/232
@@ -92,6 +92,11 @@ echo
 chmod a-w $TEST_IMG
+if [ -w $TEST_IMG ]
+    _notrun "Cannot run this test as root user"
 run_qemu_info_block -drive 
 run_qemu_info_block -drive 
 run_qemu_info_block -drive driver=file,file="$TEST_IMG",if=none,read-only=on

reply via email to

[Prev in Thread] Current Thread [Next in Thread]