Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp775896ybl; Wed, 11 Dec 2019 07:20:56 -0800 (PST) X-Google-Smtp-Source: APXvYqzjnb5eaeWnTbRgbCdnf/blArjn5vjES2cT2QyIoX6Kt87uOc5eaGB8iJlDqSJ0DVeZVi9c X-Received: by 2002:a9d:7757:: with SMTP id t23mr2770358otl.315.1576077656899; Wed, 11 Dec 2019 07:20:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077656; cv=none; d=google.com; s=arc-20160816; b=g+vIAH386JR3lHMkIgFyct2JkS2Bz8/S+m5bdQwRLQAK8V0TPIK2EYWTKXQpNV70WC 1J5Yhkg0GFZ1yJisIMisPwqrT20ugnOFBNlKS12dUZA4fW1DnqbALrV7WTZQujoG5rex Lq+cTTOYoWtumBsPIuTUf+Xtj4CYO5Cs2dZ/N7WR9vwWlQ1qnPwySjTz9yhgBDSp5Ie8 f9DuHrNfshQdXkU5RtMkF4DNdVXoX9IGS8jeJ3WW8zhu5AJ4szMU0y1miSYwcu7i711C 23WUWXXTWYAyEupFEMNkjFBUPjZuBE+bs6Hom/O2y8gOvtHCcqQ+TTVGCPbSl0fk0fK1 e6Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=txOxjfnfoGB+p3rzagqvdH9R/gmbxgAHCGzDZDXrZqQ=; b=iMgIAQcq9TRahrKsT5Vro2rn+98YvuC79F5mzIe032w2QDneoQS653qAv8B946fvja GPGIUlM2UERTVyzd+geQQ5IETK2gwZRHBq7bEFcCV5BPsNJGeoV2DHiq3aLv4/Pst/6D rWzuejyH5gDK4mHt13GREq/DjM05jwnbKWkMXJUQ+CUe5juPjCTz5eIwERnG/uvn9SAi sxNEO0+b2sBDcletl9Yp923rTHVx6kPg3Xm3a4nJqRdMx+4i/THl35W1bZWPOZMtqfdJ FerUQF7qtB2AE18kZCmdHS6RnlGVjHMNqMDQJHpqMkMUTBLNklSYFkIcpfmhVyh+l+ja I/oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=poHivdjG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si1229874oig.91.2019.12.11.07.20.43; Wed, 11 Dec 2019 07:20:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=poHivdjG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732028AbfLKPUH (ORCPT + 99 others); Wed, 11 Dec 2019 10:20:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:48970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732149AbfLKPT7 (ORCPT ); Wed, 11 Dec 2019 10:19:59 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4844224658; Wed, 11 Dec 2019 15:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077598; bh=V3+W7ZWCbX77NaZBAeU295+GDlSRMBaIq1zVLZZiujw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=poHivdjGMroeZXwEfls2jXF5YcLXikHd5x2JEK7BG9vaQqAI1ujXtieLR8LXyXTkY ogwnAJGJFhZ1YNHWRPQ9yQbZ9G2kR1cCq4fetkY3FNDnhVfOZoJPQxL8LaTfd7NI35 laEoVMmuVjhMovQ8uhsSJp6K11F9r7qpzSPLcP3I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tyrel Datwyler , Thiago Jung Bauermann , Breno Leitao , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 098/243] selftests/powerpc: Skip test instead of failing Date: Wed, 11 Dec 2019 16:04:20 +0100 Message-Id: <20191211150345.730535239@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Breno Leitao [ Upstream commit eafcd8e3fbad4f426a40ed2b6a8c697c3a4ef36a ] Current core-pkey selftest fails if the test runs without privileges to write into the core pattern file (/proc/sys/kernel/core_pattern). This causes the test to fail and give the impression that the subsystem being tested is broken, when, in fact, the test is being executed without the proper privileges. This is the current error: test: core_pkey tags: git_version:v4.19-3-g9e3363be9bce-dirty Error writing to core_pattern file: Permission denied failure: core_pkey This patch simply skips this test if it runs without the proper privileges, avoiding this undesired failure. CC: Tyrel Datwyler CC: Thiago Jung Bauermann Signed-off-by: Breno Leitao Reviewed-by: Thiago Jung Bauermann Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- tools/testing/selftests/powerpc/ptrace/core-pkey.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/core-pkey.c b/tools/testing/selftests/powerpc/ptrace/core-pkey.c index e23e2e199eb4e..d5c64fee032dc 100644 --- a/tools/testing/selftests/powerpc/ptrace/core-pkey.c +++ b/tools/testing/selftests/powerpc/ptrace/core-pkey.c @@ -352,10 +352,7 @@ static int write_core_pattern(const char *core_pattern) FILE *f; f = fopen(core_pattern_file, "w"); - if (!f) { - perror("Error writing to core_pattern file"); - return TEST_FAIL; - } + SKIP_IF_MSG(!f, "Try with root privileges"); ret = fwrite(core_pattern, 1, len, f); fclose(f); -- 2.20.1