Delete RUN_TESTS and EMIT_TESTS overrides and use common defines in
lib.mk. Common defines work just fine and there is no need to define
custom overrides.
Signed-off-by: Shuah Khan (Samsung OSG) <shuah(a)kernel.org>
---
tools/testing/selftests/android/Makefile | 8 --------
1 file changed, 8 deletions(-)
diff --git a/tools/testing/selftests/android/Makefile b/tools/testing/selftests/android/Makefile
index f6304d2be90c..72c25a3cb658 100644
--- a/tools/testing/selftests/android/Makefile
+++ b/tools/testing/selftests/android/Makefile
@@ -18,10 +18,6 @@ all:
fi \
done
-override define RUN_TESTS
- @cd $(OUTPUT); ./run.sh
-endef
-
override define INSTALL_RULE
mkdir -p $(INSTALL_PATH)
install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
@@ -33,10 +29,6 @@ override define INSTALL_RULE
done;
endef
-override define EMIT_TESTS
- echo "./run.sh"
-endef
-
override define CLEAN
@for DIR in $(SUBDIRS); do \
BUILD_TARGET=$(OUTPUT)/$$DIR; \
--
2.14.1
--
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
Split normal memfd and hugetlbfs tests to improve the test reporting.
Remove run_fuse_test.sh and memfd_test from run_tests.sh and add them
to the Makefile.
Add memfd_test to TEST_GEN_PROGS to be run separately.
Rename run_tests.sh to run_hugetlbfs_test.sh
Add run_fuse_test.sh and run_hugetlbfs_test.sh to TEST_PROGS
The report for non-root run wth this change is:
TAP version 13
selftests: memfd: memfd_test
========================================
memfd: CREATE
memfd: BASIC
memfd: SEAL-WRITE
memfd: SEAL-SHRINK
memfd: SEAL-GROW
memfd: SEAL-RESIZE
memfd: SHARE-DUP
memfd: SHARE-MMAP
memfd: SHARE-OPEN
memfd: SHARE-FORK
memfd: SHARE-DUP (shared file-table)
memfd: SHARE-MMAP (shared file-table)
memfd: SHARE-OPEN (shared file-table)
memfd: SHARE-FORK (shared file-table)
memfd: DONE
ok 1..1 selftests: memfd: memfd_test [PASS]
selftests: memfd: run_fuse_test.sh
========================================
opening: ./mnt/memfd
fuse: DONE
ok 1..2 selftests: memfd: run_fuse_test.sh [PASS]
selftests: memfd: run_hugetlbfs_test.sh
========================================
Please run memfd with hugetlbfs test as root
not ok 1..3 selftests: memfd: run_hugetlbfs_test.sh [SKIP]
Signed-off-by: Shuah Khan (Samsung OSG) <shuah(a)kernel.org>
---
tools/testing/selftests/memfd/Makefile | 6 +++---
.../testing/selftests/memfd/{run_tests.sh => run_hugetlbfs_test.sh} | 6 ------
2 files changed, 3 insertions(+), 9 deletions(-)
rename tools/testing/selftests/memfd/{run_tests.sh => run_hugetlbfs_test.sh} (95%)
diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
index 0862e6f47a38..53a848109f7b 100644
--- a/tools/testing/selftests/memfd/Makefile
+++ b/tools/testing/selftests/memfd/Makefile
@@ -4,9 +4,9 @@ CFLAGS += -I../../../../include/uapi/
CFLAGS += -I../../../../include/
CFLAGS += -I../../../../usr/include/
-TEST_PROGS := run_tests.sh
-TEST_FILES := run_fuse_test.sh
-TEST_GEN_FILES := memfd_test fuse_mnt fuse_test
+TEST_GEN_PROGS := memfd_test
+TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh
+TEST_GEN_FILES := fuse_mnt fuse_test
fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
diff --git a/tools/testing/selftests/memfd/run_tests.sh b/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
similarity index 95%
rename from tools/testing/selftests/memfd/run_tests.sh
rename to tools/testing/selftests/memfd/run_hugetlbfs_test.sh
index 2013f195e623..fb633eeb0290 100755
--- a/tools/testing/selftests/memfd/run_tests.sh
+++ b/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
@@ -4,12 +4,6 @@
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
-#
-# Normal tests requiring no special resources
-#
-./run_fuse_test.sh
-./memfd_test
-
#
# To test memfd_create with hugetlbfs, there needs to be hpages_test
# huge pages free. Attempt to allocate enough pages to test.
--
2.14.1
--
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
I have two questions,
1.
selftests: kvm tests failed.
Seems like missing pre-requirement of Kconfigs.
Please add required configs in a "config" file in the path.
The kernel build will merge those configs at the time of building.
Example: selftests/net/config
2.
Do you have a plan to make it work for arm /arm64 ?
Test log,
Running tests in kvm
========================================
selftests: kvm: set_sregs_test
==== Test Assertion Failure ====
lib/kvm_util.c:95: kvm_fd >= 0
pid=5611 tid=5611 - No such file or directory
1 0x0000000000401e8e: ?? ??:0
2 0x00000000004064b9: ?? ??:0
3 0x0000000000400f51: ?? ??:0
4 0x00007f74923d1290: ?? ??:0
5 0x0000000000401039: ?? ??:0
open /dev/kvm failed, rc: -1 errno: 2
not ok 1..1 selftests: kvm: set_sregs_test [FAIL]
se[ 201.324786] kselftest: Running tests in membarrier
lftests: kvm: sync_regs_test
==== Test Assertion Failure ====
lib/kvm_util.c:54: kvm_fd >= 0
pid=5617 tid=5617 - No such file or directory
1 0x0000000000401deb: ?? ??:0
2 0x0000000000400f52: ?? ??:0
[ 201.350386] kselftest: Running tests in memfd
3 0x00007f9f2c5eb290: ?? ??:0
4 0x00000000004014e9: ?? ??:0
open /dev/kvm failed, rc: -1 errno: 2
not ok 1..2 selftests: kvm: sync_regs_test [FAIL]
selftests: kvm: vmx_tsc_adjust_test
==== Test Assertion Failure ====
lib/kvm_util.c:422: kvm_fd >= 0
pid=5623 tid=5623 - No such file or directory
1 0x00000000004018fa: ?? ??:0
2 0x0000000000401d02: ?? ??:0
3 0x0000000000400ef8: ?? ??:0
4 0x00007f3e65a59290: ?? ??:0
5 0x0000000000401119: ?? ??:0
open /dev/kvm failed, rc: -1 errno: 2
not ok 1..3 selftests: kvm: vmx_tsc_adjust_test [FAIL]
Ref bugs:
LKFT: next: arm32 and arm64: kselftest kvm test case build failed
https://bugs.linaro.org/show_bug.cgi?id=3826
LKFT: linux-next: kvm vmx_tsc_adjust_test failed on all devices
https://bugs.linaro.org/show_bug.cgi?id=3780
Best regards
Naresh Kamboju
--
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
When ion test is skipped because of unmet dependencies and/or unsupported
configuration, it returns 0 which is treated as a pass by the Kselftest
framework. This leads to false positive result even when the test could
not be run.
Change it to return kselftest skip code when a test gets skipped to
clearly report that the test could not be run.
Kselftest framework SKIP code is 4 and the framework prints appropriate
messages to indicate that the test is skipped.
Signed-off-by: Shuah Khan (Samsung OSG) <shuah(a)kernel.org>
---
tools/testing/selftests/android/ion/ion_test.sh | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/android/ion/ion_test.sh b/tools/testing/selftests/android/ion/ion_test.sh
index a1aff506f5e6..69e676cfc94e 100755
--- a/tools/testing/selftests/android/ion/ion_test.sh
+++ b/tools/testing/selftests/android/ion/ion_test.sh
@@ -4,6 +4,9 @@ heapsize=4096
TCID="ion_test.sh"
errcode=0
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
run_test()
{
heaptype=$1
@@ -25,7 +28,7 @@ check_root()
uid=$(id -u)
if [ $uid -ne 0 ]; then
echo $TCID: must be run as root >&2
- exit 0
+ exit $ksft_skip
fi
}
@@ -35,7 +38,7 @@ check_device()
if [ ! -e $DEVICE ]; then
echo $TCID: No $DEVICE device found >&2
echo $TCID: May be CONFIG_ION is not set >&2
- exit 0
+ 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(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Colin Ian King <colin.king(a)canonical.com>
Trivial fix to spelling mistake in message text
Signed-off-by: Colin Ian King <colin.king(a)canonical.com>
---
tools/testing/selftests/filesystems/devpts_pts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/filesystems/devpts_pts.c b/tools/testing/selftests/filesystems/devpts_pts.c
index b9055e974289..ea5de8271521 100644
--- a/tools/testing/selftests/filesystems/devpts_pts.c
+++ b/tools/testing/selftests/filesystems/devpts_pts.c
@@ -279,7 +279,7 @@ int main(int argc, char *argv[])
int ret;
if (!isatty(STDIN_FILENO)) {
- fprintf(stderr, "Standard input file desciptor is not attached "
+ fprintf(stderr, "Standard input file descriptor is not attached "
"to a terminal. Skipping test\n");
exit(EXIT_FAILURE);
}
--
2.17.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
From: Colin Ian King <colin.king(a)canonical.com>
Trivial fix to spelling mistake in message text
Signed-off-by: Colin Ian King <colin.king(a)canonical.com>
---
tools/testing/selftests/media_tests/media_device_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/media_tests/media_device_test.c b/tools/testing/selftests/media_tests/media_device_test.c
index 421a367e4bb3..d8bb1e15d1d9 100644
--- a/tools/testing/selftests/media_tests/media_device_test.c
+++ b/tools/testing/selftests/media_tests/media_device_test.c
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
"other Oops in the dmesg. Enable KaSan kernel\n"
"config option for use-after-free error detection.\n\n");
- printf("Running test for %d iternations\n", count);
+ printf("Running test for %d iterations\n", count);
while (count > 0) {
ret = ioctl(fd, MEDIA_IOC_DEVICE_INFO, &mdi);
--
2.17.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
Fixes: d5edb7f8e7ab ("kvm: selftests: add vmx_tsc_adjust_test")
Signed-off-by: Anders Roxell <anders.roxell(a)linaro.org>
---
tools/testing/selftests/kvm/.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/kvm/.gitignore b/tools/testing/selftests/kvm/.gitignore
index a546e052d19a..63fc1ab9248f 100644
--- a/tools/testing/selftests/kvm/.gitignore
+++ b/tools/testing/selftests/kvm/.gitignore
@@ -1,2 +1,3 @@
set_sregs_test
sync_regs_test
+vmx_tsc_adjust_test
--
2.17.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
Signed-off-by: Anders Roxell <anders.roxell(a)linaro.org>
---
tools/testing/selftests/kvm/.gitignore | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 tools/testing/selftests/kvm/.gitignore
diff --git a/tools/testing/selftests/kvm/.gitignore b/tools/testing/selftests/kvm/.gitignore
new file mode 100644
index 000000000000..a546e052d19a
--- /dev/null
+++ b/tools/testing/selftests/kvm/.gitignore
@@ -0,0 +1,2 @@
+set_sregs_test
+sync_regs_test
--
2.16.3
--
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