Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753705AbbDBTA2 (ORCPT ); Thu, 2 Apr 2015 15:00:28 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:39253 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753547AbbDBTAX (ORCPT ); Thu, 2 Apr 2015 15:00:23 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Zhang Zhen Cc: , Linux Kernel Mailing List , , References: <1427957214-40367-1-git-send-email-zhenzhang.zhang@huawei.com> <551CE72E.3050303@huawei.com> Date: Thu, 02 Apr 2015 13:56:23 -0500 In-Reply-To: <551CE72E.3050303@huawei.com> (Zhang Zhen's message of "Thu, 2 Apr 2015 14:52:30 +0800") Message-ID: <87r3s2qrzc.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-AID: U2FsdGVkX1+/NR6VYhgzyaIbVxr7T80Cc60KfTRpdsQ= X-SA-Exim-Connect-IP: 70.59.163.10 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Zhang Zhen X-Spam-Relay-Country: X-Spam-Timing: total 343 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 4.6 (1.3%), b_tie_ro: 3.1 (0.9%), parse: 0.69 (0.2%), extract_message_metadata: 14 (4.1%), get_uri_detail_list: 1.69 (0.5%), tests_pri_-1000: 7 (2.1%), tests_pri_-950: 1.38 (0.4%), tests_pri_-900: 1.18 (0.3%), tests_pri_-400: 30 (8.7%), check_bayes: 29 (8.4%), b_tokenize: 5 (1.6%), b_tok_get_all: 13 (3.8%), b_comp_prob: 1.69 (0.5%), b_tok_touch_all: 4.1 (1.2%), b_finish: 2.0 (0.6%), tests_pri_0: 277 (80.6%), tests_pri_500: 4.2 (1.2%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH] selftests/mount: output error messages when mount test fail X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2359 Lines: 57 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. > 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/