linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <shuahkh@osg.samsung.com>
To: Zhang Zhen <zhenzhang.zhang@huawei.com>,
	linux-api@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: mpe@ellerman.id.au, ebiederm@xmission.com,
	Shuah Khan <shuahkh@osg.samsung.com>
Subject: Re: [PATCH] selftests/mount: output error messages when mount test fail
Date: Thu, 02 Apr 2015 12:03:58 -0600	[thread overview]
Message-ID: <551D848E.4070008@osg.samsung.com> (raw)
In-Reply-To: <551CE72E.3050303@huawei.com>

On 04/02/2015 12:52 AM, Zhang Zhen wrote:
> Without this patch, if /proc/self/uid_map is not exist,
> the mount test case will fail and no any prompting.
> 
> 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:
> 

This patch introduces syntax error:

Running tests in mount
========================================
./run_kselftest.sh: line 53: syntax error near unexpected token `then'
./run_kselftest.sh: line 53: `@if [ -f /proc/self/uid_map ] ; then
./unprivileged-remount-test ; else echo ERROR: No /proc/self/uid_map
exist ; fi'

You will see it if you run kselftest_install.sh from
tools/testing/selftests and then attempt to run the tests using the
generated
run_kselftest.sh script.

Could you please fix this and re-send the patch.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

  parent reply	other threads:[~2015-04-02 18:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1427957214-40367-1-git-send-email-zhenzhang.zhang@huawei.com>
2015-04-02  6:52 ` [PATCH] selftests/mount: output error messages when mount test fail Zhang Zhen
2015-04-02 14:21   ` Shuah Khan
2015-04-02 18:03   ` Shuah Khan [this message]
2015-04-02 18:56   ` Eric W. Biederman
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=551D848E.4070008@osg.samsung.com \
    --to=shuahkh@osg.samsung.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=zhenzhang.zhang@huawei.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;
as well as URLs for NNTP newsgroup(s).