Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751925AbbDBGxS (ORCPT ); Thu, 2 Apr 2015 02:53:18 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:49608 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350AbbDBGxQ (ORCPT ); Thu, 2 Apr 2015 02:53:16 -0400 Message-ID: <551CE72E.3050303@huawei.com> Date: Thu, 2 Apr 2015 14:52:30 +0800 From: Zhang Zhen User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: , Linux Kernel Mailing List CC: , , Subject: [PATCH] selftests/mount: output error messages when mount test fail References: <1427957214-40367-1-git-send-email-zhenzhang.zhang@huawei.com> In-Reply-To: <1427957214-40367-1-git-send-email-zhenzhang.zhang@huawei.com> X-Forwarded-Message-Id: <1427957214-40367-1-git-send-email-zhenzhang.zhang@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.68.57] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.551CE73A.0090,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d4720b1ee3b6cc8ab1498a3673941d86 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2009 Lines: 58 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: -- 1.8.5.5 . -- 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/