summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/timens/timens.c
Commit message (Collapse)AuthorAgeFilesLines
* selftests/timens: remove ARRAY_SIZE define from individual testsShuah Khan2021-12-101-2/+0
| | | | | | | | | | | | ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from timens tests and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
* selftests/timens: handle a case when alarm clocks are not supportedAndrei Vagin2020-05-221-1/+1
| | | | | | | | | | | This can happen if a testing node doesn't have RTC (real time clock) hardware or it doesn't support alarms. Fixes: 61c57676035d ("selftests/timens: Add Time Namespace test for supported clocks") Acked-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Reported-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Andrei Vagin <avagin@gmail.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
* selftests/timens: Remove duplicated include <time.h>YueHaibing2020-03-131-1/+0
| | | | | | | | Remove duplicated include. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
* selftests/timens: Add Time Namespace test for supported clocksDmitry Safonov2020-01-141-0/+190
A test to check that all supported clocks work on host and inside a new time namespace. Use both ways to get time: through VDSO and by entering the kernel with implicit syscall. Introduce a new timens directory in selftests framework for the next timens tests. Output on success: 1..10 ok 1 Passed for CLOCK_BOOTTIME (syscall) ok 2 Passed for CLOCK_BOOTTIME (vdso) ok 3 Passed for CLOCK_BOOTTIME_ALARM (syscall) ok 4 Passed for CLOCK_BOOTTIME_ALARM (vdso) ok 5 Passed for CLOCK_MONOTONIC (syscall) ok 6 Passed for CLOCK_MONOTONIC (vdso) ok 7 Passed for CLOCK_MONOTONIC_COARSE (syscall) ok 8 Passed for CLOCK_MONOTONIC_COARSE (vdso) ok 9 Passed for CLOCK_MONOTONIC_RAW (syscall) ok 10 Passed for CLOCK_MONOTONIC_RAW (vdso) # Pass 10 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0 Output with lack of permissions: 1..10 not ok 1 # SKIP need to run as root Output without support of time namespaces: 1..10 not ok 1 # SKIP Time namespaces are not supported Co-developed-by: Andrei Vagin <avagin@openvz.org> Signed-off-by: Andrei Vagin <avagin@gmail.com> Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20191112012724.250792-29-dima@arista.com