All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Zhen <zhenzhang.zhang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org,
	mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org
Subject: Re: [PATCH] selftests/mount: output error messages when mount test fail
Date: Fri, 3 Apr 2015 09:17:28 +0800	[thread overview]
Message-ID: <551DEA28.6040509@huawei.com> (raw)
In-Reply-To: <87r3s2qrzc.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>

On 2015/4/3 2:56, Eric W. Biederman wrote:
> Zhang Zhen <zhenzhang.zhang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> writes:
> 
>> Without this patch, if /proc/self/uid_map is not exist,
>> the mount test case will fail and no any prompting.
> 
> The intent was not to fail if /proc/self/uid_map is missing but to skip
> the test because it is not applicable.
> 
> Making this an error seems wrong.  Even if I did mess up the shell
> script error propagation and made it an error by accident.
> 
Ok, modify the output messages as follows:
WARN: No /proc/self/uid_map exist, test skipped.

Do you think this modification right?

Best regards!
>> After applied this patch, the case will prompt why it fail.
>> Just as follows:
>> root@kernel-host:/opt/kernel> make -C tools/testing/selftests TARGETS=mount run_tests
>> make: Entering directory `/opt/kernel/tools/testing/selftests'
>> for TARGET in mount; do \
>>                 make -C $TARGET; \
>>         done;
>> make[1]: Entering directory `/opt/kernel/tools/testing/selftests/mount'
>> make[1]: Nothing to be done for `all'.
>> make[1]: Leaving directory `/opt/kernel/tools/testing/selftests/mount'
>> for TARGET in mount; do \
>>                 make -C $TARGET run_tests; \
>>         done;
>> make[1]: Entering directory `/opt/kernel/tools/testing/selftests/mount'
>> ERROR: No /proc/self/uid_map exist
>> make[1]: Leaving directory `/opt/kernel/tools/testing/selftests/mount'
>> make: Leaving directory `/opt/kernel/tools/testing/selftests'
>>
>> Signed-off-by: Zhang Zhen <zhenzhang.zhang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>> ---
>>  tools/testing/selftests/mount/Makefile | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile
>> index a5b367f..b3266db 100644
>> --- a/tools/testing/selftests/mount/Makefile
>> +++ b/tools/testing/selftests/mount/Makefile
>> @@ -8,7 +8,12 @@ unprivileged-remount-test: unprivileged-remount-test.c
>>  include ../lib.mk
>>
>>  TEST_PROGS := unprivileged-remount-test
>> -override RUN_TESTS := if [ -f /proc/self/uid_map ] ; then ./unprivileged-remount-test ; fi
>> +override RUN_TESTS :=  @if [ -f /proc/self/uid_map ] ; \
>> +			then	\
>> +				./unprivileged-remount-test ; \
>> +			else	\
>> +				echo "ERROR: No /proc/self/uid_map exist" ; \
>> +			fi
>>  override EMIT_TESTS := echo "$(RUN_TESTS)"
>>
>>  clean:
> 
> 

WARNING: multiple messages have this Message-ID (diff)
From: Zhang Zhen <zhenzhang.zhang@huawei.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: <linux-api@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	<shuahkh@osg.samsung.com>, <mpe@ellerman.id.au>
Subject: Re: [PATCH] selftests/mount: output error messages when mount test fail
Date: Fri, 3 Apr 2015 09:17:28 +0800	[thread overview]
Message-ID: <551DEA28.6040509@huawei.com> (raw)
In-Reply-To: <87r3s2qrzc.fsf@x220.int.ebiederm.org>

On 2015/4/3 2:56, Eric W. Biederman wrote:
> Zhang Zhen <zhenzhang.zhang@huawei.com> writes:
> 
>> Without this patch, if /proc/self/uid_map is not exist,
>> the mount test case will fail and no any prompting.
> 
> The intent was not to fail if /proc/self/uid_map is missing but to skip
> the test because it is not applicable.
> 
> Making this an error seems wrong.  Even if I did mess up the shell
> script error propagation and made it an error by accident.
> 
Ok, modify the output messages as follows:
WARN: No /proc/self/uid_map exist, test skipped.

Do you think this modification right?

Best regards!
>> After applied this patch, the case will prompt why it fail.
>> Just as follows:
>> root@kernel-host:/opt/kernel> make -C tools/testing/selftests TARGETS=mount run_tests
>> make: Entering directory `/opt/kernel/tools/testing/selftests'
>> for TARGET in mount; do \
>>                 make -C $TARGET; \
>>         done;
>> make[1]: Entering directory `/opt/kernel/tools/testing/selftests/mount'
>> make[1]: Nothing to be done for `all'.
>> make[1]: Leaving directory `/opt/kernel/tools/testing/selftests/mount'
>> for TARGET in mount; do \
>>                 make -C $TARGET run_tests; \
>>         done;
>> make[1]: Entering directory `/opt/kernel/tools/testing/selftests/mount'
>> ERROR: No /proc/self/uid_map exist
>> make[1]: Leaving directory `/opt/kernel/tools/testing/selftests/mount'
>> make: Leaving directory `/opt/kernel/tools/testing/selftests'
>>
>> Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
>> ---
>>  tools/testing/selftests/mount/Makefile | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile
>> index a5b367f..b3266db 100644
>> --- a/tools/testing/selftests/mount/Makefile
>> +++ b/tools/testing/selftests/mount/Makefile
>> @@ -8,7 +8,12 @@ unprivileged-remount-test: unprivileged-remount-test.c
>>  include ../lib.mk
>>
>>  TEST_PROGS := unprivileged-remount-test
>> -override RUN_TESTS := if [ -f /proc/self/uid_map ] ; then ./unprivileged-remount-test ; fi
>> +override RUN_TESTS :=  @if [ -f /proc/self/uid_map ] ; \
>> +			then	\
>> +				./unprivileged-remount-test ; \
>> +			else	\
>> +				echo "ERROR: No /proc/self/uid_map exist" ; \
>> +			fi
>>  override EMIT_TESTS := echo "$(RUN_TESTS)"
>>
>>  clean:
> 
> 



  parent reply	other threads:[~2015-04-03  1:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1427957214-40367-1-git-send-email-zhenzhang.zhang@huawei.com>
     [not found] ` <1427957214-40367-1-git-send-email-zhenzhang.zhang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-04-02  6:52   ` [PATCH] selftests/mount: output error messages when mount test fail Zhang Zhen
2015-04-02  6:52     ` Zhang Zhen
2015-04-02 14:21     ` Shuah Khan
     [not found]     ` <551CE72E.3050303-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-04-02 18:03       ` Shuah Khan
2015-04-02 18:03         ` Shuah Khan
2015-04-02 18:56     ` Eric W. Biederman
2015-04-02 18:56       ` Eric W. Biederman
     [not found]       ` <87r3s2qrzc.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2015-04-03  1:17         ` Zhang Zhen [this message]
2015-04-03  1:17           ` Zhang Zhen

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=551DEA28.6040509@huawei.com \
    --to=zhenzhang.zhang-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org \
    --cc=shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.