Hello,
This version of the series is unchanged from v2 except for the last patch
which is completely new, and is provided by Mike Rapoport.
Original series description:
> A tester ran the upstream selftest on a distro kernel and sounded the
> alarm when it reported failures for features which aren't included in
> that kernel.
>
> This patch set improves the test behavior in that scenario.
Changes since v2:
- Added Mike Rapoport's Reviewed-by's and Acked-by's to patches 1-3.
- Replaced patch 4/4 by the one provided by Mike Rapoport.
Changes since v1:
- Patch "userfaultfd: selftest: Skip test if userfaultfd() syscall
not supported"
- New patch, suggested by Mike Rapoport.
- Patch "userfaultfd: selftest: Skip test if a feature isn't supported"
- Try running other tests even if one (or more) of them returns KSFT_SKIP.
- Patch "userfaultfd: selftest: Cope if shmem doesn't support zeropage"
- Ignore lack of UFFDIO_ZEROPAGE in userfaultfd_events_test() and
userfaultfd_stress().
- Make userfaultfd_zeropage_test() return KSFT_SKIP if UFFDIO_ZEROPAGE
isn't supported.
Mike Rapoport (1):
userfaultfd: selftest: make supported range ioctl verification more
robust
Thiago Jung Bauermann (3):
userfaultfd: selftest: Fix checking of userfaultfd_open() result
userfaultfd: selftest: Skip test if userfaultfd() syscall not
supported
userfaultfd: selftest: Skip test if a feature isn't supported
tools/testing/selftests/vm/userfaultfd.c | 113 +++++++++++++++++++------------
1 file changed, 69 insertions(+), 44 deletions(-)
Hello,
A tester ran the upstream selftest on a distro kernel and sounded the alarm when
it reported failures for features which aren't included in that kernel.
This patch set improves the test behavior in that scenario.
Changes since v1:
- Patch "userfaultfd: selftest: Skip test if userfaultfd() syscall
not supported"
- New patch, suggested by Mke Rapoport.
- Patch "userfaultfd: selftest: Skip test if a feature isn't supported"
- Try running other tests even if one (or more) of them returns KSFT_SKIP.
- Patch "userfaultfd: selftest: Cope if shmem doesn't support zeropage"
- Ignore lack of UFFDIO_ZEROPAGE in userfaultfd_events_test() and
userfaultfd_stress().
- Make userfaultfd_zeropage_test() return KSFT_SKIP if UFFDIO_ZEROPAGE
isn't supported.
Thiago Jung Bauermann (4):
userfaultfd: selftest: Fix checking of userfaultfd_open() result
userfaultfd: selftest: Skip test if userfaultfd() syscall not
supported
userfaultfd: selftest: Skip test if a feature isn't supported
userfaultfd: selftest: Cope if shmem doesn't support zeropage
tools/testing/selftests/vm/userfaultfd.c | 86 ++++++++++++++++++++++++--------
1 file changed, 66 insertions(+), 20 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Makes membarrier_test compatible with older kernels (LTS) by checking if
the membarrier features exist before running the tests.
Link: https://bugs.linaro.org/show_bug.cgi?id=3771
Signed-off-by: Rafael David Tinoco <rafael.tinoco(a)linaro.org>
Cc: <stable(a)vger.kernel.org> #v4.17
---
.../selftests/membarrier/membarrier_test.c | 69 +++++++++++--------
1 file changed, 41 insertions(+), 28 deletions(-)
diff --git a/tools/testing/selftests/membarrier/membarrier_test.c b/tools/testing/selftests/membarrier/membarrier_test.c
index 6793f8ecc8e7..b96caa096e2f 100644
--- a/tools/testing/selftests/membarrier/membarrier_test.c
+++ b/tools/testing/selftests/membarrier/membarrier_test.c
@@ -225,7 +225,14 @@ static int test_membarrier_global_expedited_success(void)
static int test_membarrier(void)
{
- int status;
+ int supported, status;
+
+ supported = sys_membarrier(MEMBARRIER_CMD_QUERY, 0);
+ if (supported < 0) {
+ ksft_test_result_fail(
+ "sys_membarrier() failed to query supported cmds\n");
+ return supported;
+ }
status = test_membarrier_cmd_fail();
if (status)
@@ -236,21 +243,22 @@ static int test_membarrier(void)
status = test_membarrier_global_success();
if (status)
return status;
- status = test_membarrier_private_expedited_fail();
- if (status)
- return status;
- status = test_membarrier_register_private_expedited_success();
- if (status)
- return status;
- status = test_membarrier_private_expedited_success();
- if (status)
- return status;
- status = sys_membarrier(MEMBARRIER_CMD_QUERY, 0);
- if (status < 0) {
- ksft_test_result_fail("sys_membarrier() failed\n");
- return status;
+
+ /* commit 22e4ebb975822833b083533035233d128b30e98f added this feature */
+ if (supported & MEMBARRIER_CMD_PRIVATE_EXPEDITED) {
+ status = test_membarrier_private_expedited_fail();
+ if (status)
+ return status;
+ status = test_membarrier_register_private_expedited_success();
+ if (status)
+ return status;
+ status = test_membarrier_private_expedited_success();
+ if (status)
+ return status;
}
- if (status & MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE) {
+
+ /* commit 70216e18e519a54a2f13569e8caff99a092a92d6 added this feature */
+ if (supported & MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE) {
status = test_membarrier_private_expedited_sync_core_fail();
if (status)
return status;
@@ -261,19 +269,24 @@ static int test_membarrier(void)
if (status)
return status;
}
- /*
- * It is valid to send a global membarrier from a non-registered
- * process.
- */
- status = test_membarrier_global_expedited_success();
- if (status)
- return status;
- status = test_membarrier_register_global_expedited_success();
- if (status)
- return status;
- status = test_membarrier_global_expedited_success();
- if (status)
- return status;
+
+ /* commit c5f58bd58f432be5d92df33c5458e0bcbee3aadf added this feature */
+ if (supported & MEMBARRIER_CMD_GLOBAL_EXPEDITED) {
+ /*
+ * It is valid to send a global membarrier from a non-registered
+ * process.
+ */
+ status = test_membarrier_global_expedited_success();
+ if (status)
+ return status;
+ status = test_membarrier_register_global_expedited_success();
+ if (status)
+ return status;
+ status = test_membarrier_global_expedited_success();
+ if (status)
+ return status;
+ }
+
return 0;
}
--
2.18.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Commit 3c07aaef6598 ("selftests: kselftest: change KSFT_SKIP=4 instead of
KSFT_PASS") reverted commit 11867a77eb85 ("selftests: kselftest framework:
change skip exit code to 0") but missed removing the comment which that
commit added, so do that now.
Signed-off-by: Thiago Jung Bauermann <bauerman(a)linux.ibm.com>
---
tools/testing/selftests/kselftest.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index 15e6b75fc3a5..a3edb2c8e43d 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -19,7 +19,6 @@
#define KSFT_FAIL 1
#define KSFT_XFAIL 2
#define KSFT_XPASS 3
-/* Treat skip as pass */
#define KSFT_SKIP 4
/* counters */
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
'make kselftest-merge' assumes that the config files for the tests are
located under the 'main' test dir, like tools/testing/selftests/android/
and not in a subdir to android.
Signed-off-by: Anders Roxell <anders.roxell(a)linaro.org>
---
tools/testing/selftests/android/{ion => }/config | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename tools/testing/selftests/android/{ion => }/config (100%)
diff --git a/tools/testing/selftests/android/ion/config b/tools/testing/selftests/android/config
similarity index 100%
rename from tools/testing/selftests/android/ion/config
rename to tools/testing/selftests/android/config
--
2.11.0
'make kselftest-merge' assumes that the config files for the tests are
located under the 'main' test dir, like tools/testing/selftests/android/
and not in a subdir to android.
Signed-off-by: Anders Roxell <anders.roxell(a)linaro.org>
---
Documentation/dev-tools/kselftest.rst | 2 +-
tools/testing/selftests/android/{ion => }/config | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename tools/testing/selftests/android/{ion => }/config (100%)
diff --git a/Documentation/dev-tools/kselftest.rst b/Documentation/dev-tools/kselftest.rst
index 6f653acea248..dad1bb8711e2 100644
--- a/Documentation/dev-tools/kselftest.rst
+++ b/Documentation/dev-tools/kselftest.rst
@@ -159,7 +159,7 @@ Contributing new tests (details)
* If a test needs specific kernel config options enabled, add a config file in
the test directory to enable them.
- e.g: tools/testing/selftests/android/ion/config
+ e.g: tools/testing/selftests/android/config
Test Harness
============
diff --git a/tools/testing/selftests/android/ion/config b/tools/testing/selftests/android/config
similarity index 100%
rename from tools/testing/selftests/android/ion/config
rename to tools/testing/selftests/android/config
--
2.18.0