diff options
| author | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-06-22 13:43:23 -0400 |
|---|---|---|
| committer | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-07-11 12:14:26 -0400 |
| commit | d2d49495b5c0dffee5c4da5ea12ac0da6679bd08 (patch) | |
| tree | ee94f503cfa518085ecdc9fefeb47e2894c25f87 /tools/testing | |
| parent | 29ee92397f2c83c489b72a1ba72ec97484a18a67 (diff) | |
selftests: vDSO - fix to return KSFT_SKIP when test couldn't be run
Fix to return KSFT_SKIP when test couldn't be run because AT_SYSINFO_EHDR
isn't found and gettimeofday isn't defined.
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools/testing')
| -rw-r--r-- | tools/testing/selftests/vDSO/vdso_test.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/testing/selftests/vDSO/vdso_test.c b/tools/testing/selftests/vDSO/vdso_test.c index 2df26bd0099c..eda53f833d8e 100644 --- a/tools/testing/selftests/vDSO/vdso_test.c +++ b/tools/testing/selftests/vDSO/vdso_test.c | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | #include <sys/auxv.h> | 15 | #include <sys/auxv.h> |
| 16 | #include <sys/time.h> | 16 | #include <sys/time.h> |
| 17 | 17 | ||
| 18 | #include "../kselftest.h" | ||
| 19 | |||
| 18 | extern void *vdso_sym(const char *version, const char *name); | 20 | extern void *vdso_sym(const char *version, const char *name); |
| 19 | extern void vdso_init_from_sysinfo_ehdr(uintptr_t base); | 21 | extern void vdso_init_from_sysinfo_ehdr(uintptr_t base); |
| 20 | extern void vdso_init_from_auxv(void *auxv); | 22 | extern void vdso_init_from_auxv(void *auxv); |
| @@ -37,7 +39,7 @@ int main(int argc, char **argv) | |||
| 37 | unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR); | 39 | unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR); |
| 38 | if (!sysinfo_ehdr) { | 40 | if (!sysinfo_ehdr) { |
| 39 | printf("AT_SYSINFO_EHDR is not present!\n"); | 41 | printf("AT_SYSINFO_EHDR is not present!\n"); |
| 40 | return 0; | 42 | return KSFT_SKIP; |
| 41 | } | 43 | } |
| 42 | 44 | ||
| 43 | vdso_init_from_sysinfo_ehdr(getauxval(AT_SYSINFO_EHDR)); | 45 | vdso_init_from_sysinfo_ehdr(getauxval(AT_SYSINFO_EHDR)); |
| @@ -48,7 +50,7 @@ int main(int argc, char **argv) | |||
| 48 | 50 | ||
| 49 | if (!gtod) { | 51 | if (!gtod) { |
| 50 | printf("Could not find %s\n", name); | 52 | printf("Could not find %s\n", name); |
| 51 | return 1; | 53 | return KSFT_SKIP; |
| 52 | } | 54 | } |
| 53 | 55 | ||
| 54 | struct timeval tv; | 56 | struct timeval tv; |
| @@ -59,6 +61,7 @@ int main(int argc, char **argv) | |||
| 59 | (long long)tv.tv_sec, (long long)tv.tv_usec); | 61 | (long long)tv.tv_sec, (long long)tv.tv_usec); |
| 60 | } else { | 62 | } else { |
| 61 | printf("%s failed\n", name); | 63 | printf("%s failed\n", name); |
| 64 | return KSFT_FAIL; | ||
| 62 | } | 65 | } |
| 63 | 66 | ||
| 64 | return 0; | 67 | return 0; |
