Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753263AbbDBSED (ORCPT ); Thu, 2 Apr 2015 14:04:03 -0400 Received: from lists.s-osg.org ([54.187.51.154]:33750 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751593AbbDBSEA (ORCPT ); Thu, 2 Apr 2015 14:04:00 -0400 Message-ID: <551D848E.4070008@osg.samsung.com> Date: Thu, 02 Apr 2015 12:03:58 -0600 From: Shuah Khan Organization: Samsung Open Source Group User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Zhang Zhen , linux-api@vger.kernel.org, Linux Kernel Mailing List CC: mpe@ellerman.id.au, ebiederm@xmission.com, Shuah Khan Subject: Re: [PATCH] selftests/mount: output error messages when mount test fail References: <1427957214-40367-1-git-send-email-zhenzhang.zhang@huawei.com> <551CE72E.3050303@huawei.com> In-Reply-To: <551CE72E.3050303@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2824 Lines: 78 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 > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/