selftests/timens: Add a test for clock_nanosleep()
authorAndrei Vagin <avagin@gmail.com>
Tue, 12 Nov 2019 01:27:19 +0000 (01:27 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 14 Jan 2020 11:21:01 +0000 (12:21 +0100)
commit46e003433f8946283c3bfec1be854ca87b5ba402
treefd4352b1c77994ca0074b1baf5d364a76107e50b
parent11873de3ce4d2fe289d51932c03b3668cf519186
selftests/timens: Add a test for clock_nanosleep()

Check that clock_nanosleep() takes into account clock offsets.

Output on success:
 1..4
 ok 1 clockid: 1 abs:0
 ok 2 clockid: 1 abs:1
 ok 3 clockid: 9 abs:0
 ok 4 clockid: 9 abs:1

Output with lack of permissions:
 1..4
 not ok 1 # SKIP need to run as root

Output without support of time namespaces:
 1..4
 not ok 1 # SKIP Time namespaces are not supported

Co-developed-by: Dmitry Safonov <dima@arista.com>
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-31-dima@arista.com
tools/testing/selftests/timens/.gitignore
tools/testing/selftests/timens/Makefile
tools/testing/selftests/timens/clock_nanosleep.c [new file with mode: 0644]