Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753301AbbDCBj4 (ORCPT ); Thu, 2 Apr 2015 21:39:56 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:4126 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753047AbbDCBjv (ORCPT ); Thu, 2 Apr 2015 21:39:51 -0400 Message-ID: <551DEF58.3090505@huawei.com> Date: Fri, 3 Apr 2015 09:39:36 +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@vger.kernel.org >> Linux Kernel Mailing List" CC: "Eric W. Biederman" , Subject: [PATCH v2] selftests/mount: output WARN messages when mount test skipped References: <1428024818-28554-1-git-send-email-zhenzhang.zhang@huawei.com> In-Reply-To: <1428024818-28554-1-git-send-email-zhenzhang.zhang@huawei.com> X-Forwarded-Message-Id: <1428024818-28554-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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2255 Lines: 62 Without this patch, if /proc/self/uid_map is not exist, the mount test case will skipped and no any prompting. After applied this patch, the case will prompt why it skipped. 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' if [ -f /proc/self/uid_map ] ; then ./unprivileged-remount-test ; else echo "WARN: No /proc/self/uid_map exist, test skipped." ; fi WARN: No /proc/self/uid_map exist, test skipped. make[1]: Leaving directory `/opt/kernel/tools/testing/selftests/mount' make: Leaving directory `/opt/kernel/tools/testing/selftests' Change v1 -> v2: - fix syntax error when run kselftest_install.sh 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..038c777 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 "WARN: No /proc/self/uid_map exist, test skipped." ; \ + 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/