From: anders.roxell at linaro.org (Anders Roxell)
Subject: [PATCH] selftests: mount: delete RUN_TESTS and EMIT_TESTS overrides
Date: Wed, 9 May 2018 11:49:00 +0200 [thread overview]
Message-ID: <20180509094900.GC10043@localhost.localdomain> (raw)
In-Reply-To: <20180502211848.22404-4-shuah@kernel.org>
On 2018-05-02 15:18, Shuah Khan (Samsung OSG) wrote:
> Delete RUN_TESTS and EMIT_TESTS overrides and use common defines in
> lib.mk. Add new run_tests.sh to do the dependency checks the custom
> RUN_TESTS did. Common defines work with the run_tests.sh set as the
> TEST_PROGS and defining unprivileged-remount-test in TEST_GEN_FILES.
>
> Kselftest framework builds and installs TEST_GEN_FILES and doesn't run
> them via RUN_TESTS and include it in EMIT_TESTS. With this change the
> new run_tests.sh runs the test after checking dependencies.
>
> This change also adds Skip handling to return kselftest skip code when
> test is skipped to clearly identify when the test is skipped instead of
> reporting it as failed.
>
> Output with this change:
>
> TAP version 13
> selftests: mount: run_tests.sh
> ========================================
> WARN: No /proc/self/uid_map exist, test skipped.
> not ok 1..1 selftests: mount: run_tests.sh [SKIP]
>
> Signed-off-by: Shuah Khan (Samsung OSG) <shuah at kernel.org>
Reviewed-by: Anders Roxell <anders.roxell at linaro.org>
> ---
> tools/testing/selftests/mount/Makefile | 12 ++----------
> tools/testing/selftests/mount/run_tests.sh | 12 ++++++++++++
> 2 files changed, 14 insertions(+), 10 deletions(-)
> create mode 100755 tools/testing/selftests/mount/run_tests.sh
>
> diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile
> index e094f71c6dbc..026890744215 100644
> --- a/tools/testing/selftests/mount/Makefile
> +++ b/tools/testing/selftests/mount/Makefile
> @@ -3,15 +3,7 @@
> CFLAGS = -Wall \
> -O2
>
> -TEST_GEN_PROGS := unprivileged-remount-test
> +TEST_PROGS := run_tests.sh
> +TEST_GEN_FILES := unprivileged-remount-test
>
> include ../lib.mk
> -
> -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)"
> -
> diff --git a/tools/testing/selftests/mount/run_tests.sh b/tools/testing/selftests/mount/run_tests.sh
> new file mode 100755
> index 000000000000..4ab8f507dcba
> --- /dev/null
> +++ b/tools/testing/selftests/mount/run_tests.sh
> @@ -0,0 +1,12 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Kselftest framework requirement - SKIP code is 4.
> +ksft_skip=4
> +
> +# Run mount selftests
> +if [ -f /proc/self/uid_map ] ; then
> + ./unprivileged-remount-test ;
> +else
> + echo "WARN: No /proc/self/uid_map exist, test skipped." ;
> + exit $ksft_skip
> +fi
> --
> 2.14.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: anders.roxell@linaro.org (Anders Roxell)
Subject: [PATCH] selftests: mount: delete RUN_TESTS and EMIT_TESTS overrides
Date: Wed, 9 May 2018 11:49:00 +0200 [thread overview]
Message-ID: <20180509094900.GC10043@localhost.localdomain> (raw)
Message-ID: <20180509094900.Ly-xahqGgnX9JPWAqxGuzWGG8MWipohR3u6NfFloV64@z> (raw)
In-Reply-To: <20180502211848.22404-4-shuah@kernel.org>
On 2018-05-02 15:18, Shuah Khan (Samsung OSG) wrote:
> Delete RUN_TESTS and EMIT_TESTS overrides and use common defines in
> lib.mk. Add new run_tests.sh to do the dependency checks the custom
> RUN_TESTS did. Common defines work with the run_tests.sh set as the
> TEST_PROGS and defining unprivileged-remount-test in TEST_GEN_FILES.
>
> Kselftest framework builds and installs TEST_GEN_FILES and doesn't run
> them via RUN_TESTS and include it in EMIT_TESTS. With this change the
> new run_tests.sh runs the test after checking dependencies.
>
> This change also adds Skip handling to return kselftest skip code when
> test is skipped to clearly identify when the test is skipped instead of
> reporting it as failed.
>
> Output with this change:
>
> TAP version 13
> selftests: mount: run_tests.sh
> ========================================
> WARN: No /proc/self/uid_map exist, test skipped.
> not ok 1..1 selftests: mount: run_tests.sh [SKIP]
>
> Signed-off-by: Shuah Khan (Samsung OSG) <shuah at kernel.org>
Reviewed-by: Anders Roxell <anders.roxell at linaro.org>
> ---
> tools/testing/selftests/mount/Makefile | 12 ++----------
> tools/testing/selftests/mount/run_tests.sh | 12 ++++++++++++
> 2 files changed, 14 insertions(+), 10 deletions(-)
> create mode 100755 tools/testing/selftests/mount/run_tests.sh
>
> diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile
> index e094f71c6dbc..026890744215 100644
> --- a/tools/testing/selftests/mount/Makefile
> +++ b/tools/testing/selftests/mount/Makefile
> @@ -3,15 +3,7 @@
> CFLAGS = -Wall \
> -O2
>
> -TEST_GEN_PROGS := unprivileged-remount-test
> +TEST_PROGS := run_tests.sh
> +TEST_GEN_FILES := unprivileged-remount-test
>
> include ../lib.mk
> -
> -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)"
> -
> diff --git a/tools/testing/selftests/mount/run_tests.sh b/tools/testing/selftests/mount/run_tests.sh
> new file mode 100755
> index 000000000000..4ab8f507dcba
> --- /dev/null
> +++ b/tools/testing/selftests/mount/run_tests.sh
> @@ -0,0 +1,12 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Kselftest framework requirement - SKIP code is 4.
> +ksft_skip=4
> +
> +# Run mount selftests
> +if [ -f /proc/self/uid_map ] ; then
> + ./unprivileged-remount-test ;
> +else
> + echo "WARN: No /proc/self/uid_map exist, test skipped." ;
> + exit $ksft_skip
> +fi
> --
> 2.14.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Anders Roxell <anders.roxell@linaro.org>
To: "Shuah Khan (Samsung OSG)" <shuah@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH] selftests: mount: delete RUN_TESTS and EMIT_TESTS overrides
Date: Wed, 9 May 2018 11:49:00 +0200 [thread overview]
Message-ID: <20180509094900.GC10043@localhost.localdomain> (raw)
In-Reply-To: <20180502211848.22404-4-shuah@kernel.org>
On 2018-05-02 15:18, Shuah Khan (Samsung OSG) wrote:
> Delete RUN_TESTS and EMIT_TESTS overrides and use common defines in
> lib.mk. Add new run_tests.sh to do the dependency checks the custom
> RUN_TESTS did. Common defines work with the run_tests.sh set as the
> TEST_PROGS and defining unprivileged-remount-test in TEST_GEN_FILES.
>
> Kselftest framework builds and installs TEST_GEN_FILES and doesn't run
> them via RUN_TESTS and include it in EMIT_TESTS. With this change the
> new run_tests.sh runs the test after checking dependencies.
>
> This change also adds Skip handling to return kselftest skip code when
> test is skipped to clearly identify when the test is skipped instead of
> reporting it as failed.
>
> Output with this change:
>
> TAP version 13
> selftests: mount: run_tests.sh
> ========================================
> WARN: No /proc/self/uid_map exist, test skipped.
> not ok 1..1 selftests: mount: run_tests.sh [SKIP]
>
> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Reviewed-by: Anders Roxell <anders.roxell@linaro.org>
> ---
> tools/testing/selftests/mount/Makefile | 12 ++----------
> tools/testing/selftests/mount/run_tests.sh | 12 ++++++++++++
> 2 files changed, 14 insertions(+), 10 deletions(-)
> create mode 100755 tools/testing/selftests/mount/run_tests.sh
>
> diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile
> index e094f71c6dbc..026890744215 100644
> --- a/tools/testing/selftests/mount/Makefile
> +++ b/tools/testing/selftests/mount/Makefile
> @@ -3,15 +3,7 @@
> CFLAGS = -Wall \
> -O2
>
> -TEST_GEN_PROGS := unprivileged-remount-test
> +TEST_PROGS := run_tests.sh
> +TEST_GEN_FILES := unprivileged-remount-test
>
> include ../lib.mk
> -
> -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)"
> -
> diff --git a/tools/testing/selftests/mount/run_tests.sh b/tools/testing/selftests/mount/run_tests.sh
> new file mode 100755
> index 000000000000..4ab8f507dcba
> --- /dev/null
> +++ b/tools/testing/selftests/mount/run_tests.sh
> @@ -0,0 +1,12 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Kselftest framework requirement - SKIP code is 4.
> +ksft_skip=4
> +
> +# Run mount selftests
> +if [ -f /proc/self/uid_map ] ; then
> + ./unprivileged-remount-test ;
> +else
> + echo "WARN: No /proc/self/uid_map exist, test skipped." ;
> + exit $ksft_skip
> +fi
> --
> 2.14.1
>
next prev parent reply other threads:[~2018-05-09 9:49 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 21:18 [PATCH] selftests: android: delete RUN_TESTS and EMIT_TESTS overrides shuah
2018-05-02 21:18 ` Shuah Khan (Samsung OSG)
2018-05-02 21:18 ` Shuah Khan (Samsung OSG)
2018-05-02 21:18 ` [PATCH] selftests: futex: " shuah
2018-05-02 21:18 ` Shuah Khan (Samsung OSG)
2018-05-02 21:18 ` Shuah Khan (Samsung OSG)
2018-05-09 9:46 ` anders.roxell
2018-05-09 9:46 ` Anders Roxell
2018-05-09 9:46 ` Anders Roxell
2018-05-11 15:13 ` dvhart
2018-05-11 15:13 ` Darren Hart
2018-05-11 15:13 ` Darren Hart
2018-05-11 15:25 ` shuah
2018-05-11 15:25 ` Shuah Khan
2018-05-11 15:25 ` Shuah Khan
2018-05-02 21:18 ` [PATCH] selftests: memory-hotplug: " shuah
2018-05-02 21:18 ` Shuah Khan (Samsung OSG)
2018-05-02 21:18 ` Shuah Khan (Samsung OSG)
2018-05-09 9:46 ` anders.roxell
2018-05-09 9:46 ` Anders Roxell
2018-05-09 9:46 ` Anders Roxell
2018-05-09 11:39 ` lei.yang
2018-05-09 11:39 ` lei yang
2018-05-09 11:39 ` lei yang
2018-05-02 21:18 ` [PATCH] selftests: mount: " shuah
2018-05-02 21:18 ` Shuah Khan (Samsung OSG)
2018-05-02 21:18 ` Shuah Khan (Samsung OSG)
2018-05-09 9:49 ` anders.roxell [this message]
2018-05-09 9:49 ` Anders Roxell
2018-05-09 9:49 ` Anders Roxell
2018-05-02 21:18 ` [PATCH] selftests: mqueue: " shuah
2018-05-02 21:18 ` Shuah Khan (Samsung OSG)
2018-05-02 21:18 ` Shuah Khan (Samsung OSG)
2018-05-09 9:49 ` anders.roxell
2018-05-09 9:49 ` Anders Roxell
2018-05-09 9:49 ` Anders Roxell
2018-05-12 16:12 ` [PATCH] selftests: android: " pintu.ping
2018-05-12 16:12 ` Pintu Kumar
2018-05-12 16:12 ` Pintu Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180509094900.GC10043@localhost.localdomain \
--to=unknown@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.