On 05/14/2018 04:01 PM, Jeffrin Jose T wrote:
> Fix for aperf.c to produce the path of the file which is in mention
> during error report.CONFIG_X86_MSR=m support requirement is also mentioned.
>
> Signed-off-by: Jeffrin Jose T <jeffrin(a)rajagiritech.edu.in>
> ---
> tools/testing/selftests/intel_pstate/aperf.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/intel_pstate/aperf.c b/tools/testing/selftests/intel_pstate/aperf.c
> index d21edea9c560..da98c1673f08 100644
> --- a/tools/testing/selftests/intel_pstate/aperf.c
> +++ b/tools/testing/selftests/intel_pstate/aperf.c
> @@ -41,7 +41,9 @@ int main(int argc, char **argv) {
> fd = open(msr_file_name, O_RDONLY);
>
> if (fd == -1) {
> - perror("Failed to open")> + printf("Failed to open /dev/cpu/%d/msr:", cpu);
Why are you deleting perror() and add a printf() for the error message perror()
printf()?
Why not collapse these messages into one and use strerror() to include the
error string?
> + printf(" No such file or directory:")
Not necessarily. open(0 could fail due to insufficient permissions. That is why
using strerror() or perror() is the correct way so the real error message gets
printed.
> + printf(" Make sure CONFIG_X86_MSR=m support is Enabled\n");
Might not be the real reason why the opeN() failed.
> return 1;
> }
The return should be KSFT_SKIP instead of 1
>
>
thanks,
-- Shuah
--
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
A new patchwork project is created to track kselftest patches. Update
the kselftest entry in the MAINTAINERS file adding Q: entry:
https://patchwork.kernel.org/project/linux-kselftest/list/
Signed-off-by: Shuah Khan (Samsung OSG) <shuah(a)kernel.org>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 58b9861ccf99..ab577593d80a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7698,6 +7698,7 @@ KERNEL SELFTEST FRAMEWORK
M: Shuah Khan <shuah(a)kernel.org>
L: linux-kselftest(a)vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git
+Q: https://patchwork.kernel.org/project/linux-kselftest/list/
S: Maintained
F: tools/testing/selftests/
F: Documentation/dev-tools/kselftest*
--
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
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