aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/lib/assert.c
AgeCommit message (Collapse)AuthorFilesLines
2021-04-20KVM: selftests: Print the errno besides error-string in TEST_ASSERTYanan Wang1-2/+2
Print the errno besides error-string in TEST_ASSERT in the format of "errno=%d - %s" will explicitly indicate that the string is an error information. Besides, the errno is easier to be used for debugging than the error-string. Suggested-by: Andrew Jones <[email protected]> Signed-off-by: Yanan Wang <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2020-03-16KVM: selftests: Use consistent message for test skippingAndrew Jones1-2/+4
Signed-off-by: Andrew Jones <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2019-11-13selftests: kvm: fix build with glibc >= 2.30Vitaly Kuznetsov1-2/+2
Glibc-2.30 gained gettid() wrapper, selftests fail to compile: lib/assert.c:58:14: error: static declaration of ‘gettid’ follows non-static declaration 58 | static pid_t gettid(void) | ^~~~~~ In file included from /usr/include/unistd.h:1170, from include/test_util.h:18, from lib/assert.c:10: /usr/include/bits/unistd_ext.h:34:16: note: previous declaration of ‘gettid’ was here 34 | extern __pid_t gettid (void) __THROW; | ^~~~~~ Signed-off-by: Vitaly Kuznetsov <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482Thomas Gleixner1-2/+1
Based on 1 normalized pattern(s): this work is licensed under the terms of the gnu gpl version 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 48 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Enrico Weigelt <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-10-17kvm: selftests: move arch-specific files to arch-specific locationsAndrew Jones1-1/+1
Signed-off-by: Andrew Jones <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2018-05-30selftests: kvm: return Kselftest Skip code for skipped testsShuah Khan (Samsung OSG)1-2/+7
When kvm test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative 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. Change it to use ksft_exit_skip() when the test is skipped. In addition, refine test_assert() message to include strerror() string and add explicit check for EACCES to cleary identify when test doesn't run when access is denied to resources required e.g: open /dev/kvm failed, rc: -1 errno: 13 Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]> Acked-by: Paolo Bonzini <[email protected]> Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
2018-04-04kvm: selftests: add API testing infrastructurePaolo Bonzini1-0/+87
Testsuite contributed by Google and cleaned up by myself for inclusion in Linux. Signed-off-by: Ken Hofsass <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>