Message ID | 3130ecca88d5f7d97860c05cf1346164938cb15d.1543610035.git.alifm@linux.ibm.com |
---|---|
State | New |
Headers | show |
Series | [RFC,for,3.1?,or,4,v3,1/1] qemu-iotests: Don't run the test when user is root | expand |
On 11/30/18 2:37 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 <alifm@linux.ibm.com> > --- > tests/qemu-iotests/232 | 5 +++++ > 1 file changed, 5 insertions(+) Did you mean to keep RFC in the subject line? Will patchew even spot it without PATCH in the subject line? Reviewed-by: Eric Blake <eblake@redhat.com>
On 11/30/2018 03:52 PM, Eric Blake wrote: > On 11/30/18 2:37 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 <alifm@linux.ibm.com> >> --- >> tests/qemu-iotests/232 | 5 +++++ >> 1 file changed, 5 insertions(+) > > Did you mean to keep RFC in the subject line? Will patchew even spot it > without PATCH in the subject line? > > Reviewed-by: Eric Blake <eblake@redhat.com> > Thanks for reviewing the patch. I am not sure if patchew will pick it up; I have no problem in spinning another patch but I will wait till Monday to see if anyone else has any feedback. Thanks Farhan
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
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> --- tests/qemu-iotests/232 | 5 +++++ 1 file changed, 5 insertions(+)