LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <bauerman@linux.ibm.com>
To: Breno Leitao <leitao@debian.org>
Cc: linuxppc-dev@lists.ozlabs.org,
	Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Subject: Re: [PATCH v2 3/3] selftests/powerpc: Skip test instead of failing
Date: Wed, 31 Oct 2018 12:45:27 -0300	[thread overview]
Message-ID: <87zhuup1bc.fsf@morokweng.localdomain> (raw)
In-Reply-To: <1540996702-27161-3-git-send-email-leitao@debian.org>


Breno Leitao <leitao@debian.org> writes:

> 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 <tyreld@linux.vnet.ibm.com>
> CC: Thiago Jung Bauermann <bauerman@linux.ibm.com>
> Signed-off-by: Breno Leitao <leitao@debian.org>

Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>

> ---
>  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 e23e2e199eb4..d5c64fee032d 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);


-- 
Thiago Jung Bauermann
IBM Linux Technology Center


  reply	other threads:[~2018-10-31 15:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31 14:38 [PATCH v2 1/3] selftests/powerpc: Allocate base registers Breno Leitao
2018-10-31 14:38 ` [PATCH v2 2/3] selftests/powerpc: Create a new SKIP_IF macro Breno Leitao
2018-10-31 15:44   ` Thiago Jung Bauermann
2018-10-31 14:38 ` [PATCH v2 3/3] selftests/powerpc: Skip test instead of failing Breno Leitao
2018-10-31 15:45   ` Thiago Jung Bauermann [this message]
2018-11-27  9:22 ` [v2,1/3] selftests/powerpc: Allocate base registers Michael Ellerman

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=87zhuup1bc.fsf@morokweng.localdomain \
    --to=bauerman@linux.ibm.com \
    --cc=leitao@debian.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=tyreld@linux.vnet.ibm.com \
    /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