qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Farhan Ali <alifm@linux.ibm.com>
To: qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, kwolf@redhat.com, eblake@redhat.com,
	alifm@linux.ibm.com
Subject: [Qemu-devel] [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	[thread overview]
Message-ID: <390c0b08c7beb83da3a8ef5b880db223a096d525.1543883650.git.alifm@linux.ibm.com> (raw)
In-Reply-To: <cover.1543883650.git.alifm@linux.ibm.com>

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

           reply	other threads:[~2018-12-04  0:36 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <cover.1543883650.git.alifm@linux.ibm.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=390c0b08c7beb83da3a8ef5b880db223a096d525.1543883650.git.alifm@linux.ibm.com \
    --to=alifm@linux.ibm.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).