* [Qemu-devel] [PATCH for 3.1? or 4 v4 1/1] qemu-iotests: Don't run the test when user is root
[not found] <cover.1543883650.git.alifm@linux.ibm.com>
@ 2018-12-04 0:35 ` Farhan Ali
0 siblings, 0 replies; only message in thread
From: Farhan Ali @ 2018-12-04 0:35 UTC (permalink / raw)
To: qemu-block, qemu-devel; +Cc: peter.maydell, kwolf, eblake, alifm
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 <alifm@linux.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
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 ]
+then
+ _notrun "Cannot run this test as root user"
+fi
+
run_qemu_info_block -drive driver=file,file="$TEST_IMG",if=none,read-only=on,auto-read-only=off
run_qemu_info_block -drive driver=file,file="$TEST_IMG",if=none,read-only=on,auto-read-only=on
run_qemu_info_block -drive driver=file,file="$TEST_IMG",if=none,read-only=on
--
2.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-12-04 0:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1543883650.git.alifm@linux.ibm.com>
2018-12-04 0:35 ` [Qemu-devel] [PATCH for 3.1? or 4 v4 1/1] qemu-iotests: Don't run the test when user is root Farhan Ali
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).