Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753234AbbDCBSP (ORCPT ); Thu, 2 Apr 2015 21:18:15 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:19343 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751751AbbDCBSM (ORCPT ); Thu, 2 Apr 2015 21:18:12 -0400 Message-ID: <551DEA28.6040509@huawei.com> Date: Fri, 3 Apr 2015 09:17:28 +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: "Eric W. Biederman" CC: , Linux Kernel Mailing List , , 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> <87r3s2qrzc.fsf@x220.int.ebiederm.org> In-Reply-To: <87r3s2qrzc.fsf@x220.int.ebiederm.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.111.68.57] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2621 Lines: 68 On 2015/4/3 2:56, Eric W. Biederman wrote: > Zhang Zhen 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 >> --- >> 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: > > -- 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/