* [PATCH v2] selftests/mount: output WARN messages when mount test skipped
[not found] <1428024818-28554-1-git-send-email-zhenzhang.zhang@huawei.com>
@ 2015-04-03 1:39 ` Zhang Zhen
[not found] ` <551DEF58.3090505-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Zhen @ 2015-04-03 1:39 UTC (permalink / raw)
To: linux-api,
linux-kernel@vger.kernel.org >> Linux Kernel Mailing List
Cc: Eric W. Biederman, shuahkh
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 <zhenzhang.zhang@huawei.com>
---
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
.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] selftests/mount: output WARN messages when mount test skipped
[not found] ` <551DEF58.3090505-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2015-05-06 20:15 ` Shuah Khan
0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2015-05-06 20:15 UTC (permalink / raw)
To: Zhang Zhen, linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> Linux Kernel Mailing List
Cc: Eric W. Biederman, Shuah Khan
On 04/02/2015 07:39 PM, Zhang Zhen wrote:
> 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 <zhenzhang.zhang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
Thanks for fixing this. Applied it to linux-kselftest next
for 4.2 - I ended up making changes the commit log to fix
checkpatch warnings before applying the patch.
thanks,
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org | (970) 217-8978
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-06 20:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1428024818-28554-1-git-send-email-zhenzhang.zhang@huawei.com>
2015-04-03 1:39 ` [PATCH v2] selftests/mount: output WARN messages when mount test skipped Zhang Zhen
[not found] ` <551DEF58.3090505-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-05-06 20:15 ` Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).