From patchwork Fri Nov 30 20:37:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farhan Ali X-Patchwork-Id: 1006179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4365mp6B7Fz9s8r for ; Sat, 1 Dec 2018 07:37:45 +1100 (AEDT) Received: from localhost ([::1]:34563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSpXi-0007TA-3q for incoming@patchwork.ozlabs.org; Fri, 30 Nov 2018 15:37:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSpXN-0007Rq-Iz for qemu-devel@nongnu.org; Fri, 30 Nov 2018 15:37:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSpXK-0001IN-9W for qemu-devel@nongnu.org; Fri, 30 Nov 2018 15:37:21 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37264 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gSpXJ-0001El-Vu for qemu-devel@nongnu.org; Fri, 30 Nov 2018 15:37:18 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAUKZE66139296 for ; Fri, 30 Nov 2018 15:37:16 -0500 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0b-001b2d01.pphosted.com with ESMTP id 2p39js6xaa-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 30 Nov 2018 15:37:16 -0500 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Nov 2018 20:37:15 -0000 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 30 Nov 2018 20:37:11 -0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wAUKbABP16974068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 30 Nov 2018 20:37:10 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9D89BE051; Fri, 30 Nov 2018 20:37:10 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 14E4DBE058; Fri, 30 Nov 2018 20:37:09 +0000 (GMT) Received: from alifm-ThinkPad-T470p.pok.ibm.com (unknown [9.56.58.49]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTPS; Fri, 30 Nov 2018 20:37:09 +0000 (GMT) From: Farhan Ali To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Fri, 30 Nov 2018 15:37:09 -0500 X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-TM-AS-GCONF: 00 x-cbid: 18113020-0036-0000-0000-00000A63B1F7 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010148; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01125089; UDB=6.00584194; IPR=6.00905216; MB=3.00024400; MTD=3.00000008; XFM=3.00000015; UTC=2018-11-30 20:37:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18113020-0037-0000-0000-000049D1237C Message-Id: <3130ecca88d5f7d97860c05cf1346164938cb15d.1543610035.git.alifm@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-11-30_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=725 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811300175 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [RFC for 3.1? or 4 v3 1/1] qemu-iotests: Don't run the test when user is root X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, alifm@linux.ibm.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Eric Blake --- 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