[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [RFC for-3.1? v1 1/1] qemu-iotests: Don't run the test
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [RFC for-3.1? v1 1/1] qemu-iotests: Don't run the test when user is root |
Date: |
Thu, 29 Nov 2018 16:45:06 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
On 11/29/18 4:32 PM, Farhan Ali wrote:
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 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
index 0708b8b..40d6692 100755
--- a/tests/qemu-iotests/232
+++ b/tests/qemu-iotests/232
@@ -41,6 +41,11 @@ _supported_fmt generic
_supported_proto file
_supported_os Linux
+if [ "$EUID" -eq 0 ]
That's rather fragile. Can we instead do something like:
touch file
chmod a-w file
if [ -w file ]
to probe the actual problem of having sufficient privilege of being able
to write to a read-only file, without regards to which uids have which
privileges?
+then
+ _notrun "Cannot run this test as root user"
+fi
Otherwise, it makes sense to me.
If we have a reason to spin 3.1-rc4, we could include this as a
testsuite robustness fix; but it's not a reason for -rc4 on its own, and
few enough people are brave enough to run iotests as root that its not a
showstopper in my mind if this slips to 4.0.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org