public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux•vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman•id.au>, linuxppc-dev@ozlabs•org
Subject: Re: [PATCH] selftests/powerpc: Fix subpage_prot test to return !0 on failure
Date: Tue, 03 May 2016 11:26:37 +0530	[thread overview]
Message-ID: <8760uvznu2.fsf@skywalker.in.ibm.com> (raw)
In-Reply-To: <87bn4ozp2i.fsf@skywalker.in.ibm.com>

"Aneesh Kumar K.V" <aneesh.kumar@linux•vnet.ibm.com> writes:

> Michael Ellerman <mpe@ellerman•id.au> writes:
>
>> It's helpful for automated testing if the test returns error codes back
>> to the calling program.
>>
>> Signed-off-by: Michael Ellerman <mpe@ellerman•id.au>
>
>
> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux•vnet.ibm.com>
>
>> ---
>>  tools/testing/selftests/powerpc/mm/subpage_prot.c | 10 ++++++----
>>  1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/tools/testing/selftests/powerpc/mm/subpage_prot.c b/tools/testing/selftests/powerpc/mm/subpage_prot.c
>> index 440180ff8089..7ccdc96b977d 100644
>> --- a/tools/testing/selftests/powerpc/mm/subpage_prot.c
>> +++ b/tools/testing/selftests/powerpc/mm/subpage_prot.c
>> @@ -207,14 +207,16 @@ int test_file(void)
>>
>>  int main(int argc, char *argv[])
>>  {
>> -	test_harness(test_anon, "subpage_prot_anon");
>> +	int rc;
>> +
>> +	rc = test_harness(test_anon, "subpage_prot_anon");
>> +	if (rc)
>> +		return rc;
>>
>>  	if (argc > 1)
>>  		file_name = argv[1];
>>  	else
>>  		file_name = "tempfile";
>>
>> -	test_harness(test_file, "subpage_prot_file");
>> -
>> -	return 0;
>> +	return test_harness(test_file, "subpage_prot_file");
>>  }
>> -- 
>> 2.5.0

While doing this fix the error print ?

520175565: (4520111850): Failed at 0x0x3fffad4b0000 (p=13,sp=0,w=0), want=fault, got=pass !

diff --git a/tools/testing/selftests/powerpc/mm/subpage_prot.c b/tools/testing/selftests/powerpc/mm/subpage_prot.c
index 440180ff8089..5929866aa444 100644
--- a/tools/testing/selftests/powerpc/mm/subpage_prot.c
+++ b/tools/testing/selftests/powerpc/mm/subpage_prot.c
@@ -73,7 +73,7 @@ static inline void check_faulted(void *addr, long page, long subpage, int write)
 		want_fault |= (subpage == ((page + 1) % 16));
 
 	if (faulted != want_fault) {
-		printf("Failed at 0x%p (p=%ld,sp=%ld,w=%d), want=%s, got=%s !\n",
+		printf("Failed at %p (p=%ld,sp=%ld,w=%d), want=%s, got=%s !\n",
 		       addr, page, subpage, write,
 		       want_fault ? "fault" : "pass",
 		       faulted ? "fault" : "pass");

  reply	other threads:[~2016-05-03  5:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02  4:54 [PATCH] selftests/powerpc: Fix subpage_prot test to return !0 on failure Michael Ellerman
2016-05-02 11:17 ` Aneesh Kumar K.V
2016-05-03  5:56   ` Aneesh Kumar K.V [this message]
2016-05-04 22:40 ` 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=8760uvznu2.fsf@skywalker.in.ibm.com \
    --to=aneesh.kumar@linux$(echo .)vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=mpe@ellerman$(echo .)id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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