qemu-block
[Top][All Lists]
Advanced

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

[Qemu-block] [RFC for 3.1? or 4 v2 1/1] qemu-iotests: Don't run the test


From: Farhan Ali
Subject: [Qemu-block] [RFC for 3.1? or 4 v2 1/1] qemu-iotests: Don't run the test when user is root
Date: Fri, 30 Nov 2018 11:04:15 -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>
---
 tests/qemu-iotests/232 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
index 0708b8b..05d5f2f 100755
--- a/tests/qemu-iotests/232
+++ b/tests/qemu-iotests/232
@@ -41,6 +41,14 @@ _supported_fmt generic
 _supported_proto file
 _supported_os Linux
 
+tmp='file'
+touch $tmp
+chmod a-w $tmp
+if [ -w $tmp ]
+then
+    _notrun "Cannot run this test as root user"
+fi
+
 do_run_qemu()
 {
     echo Testing: "$@"
-- 
2.7.4




reply via email to

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