new file mode 100644
@@ -0,0 +1,37 @@
+NAME = 'monotonic_time'
+AUTHOR = 'Michael Davidson <md@google.com>'
+TIME = 'MEDIUM'
+TEST_CLASS = 'Kernel'
+TEST_CATEGORY = 'Functional'
+TEST_TYPE = 'client'
+DOC = """
+monotonic_time checks various time interfaces:
+ gettimeofday()
+ clock_gettime(CLOCK_MONTONIC)
+ TSC
+for monotonicity.
+
+Based on time-warp-test.c by Ingo Molnar.
+"""
+
+#
+# Test gettimeofday(), TSC, and clock_gettime(CLOCK_MONOTONIC)
+#
+# Tests run for 'duration' seconds and check that the selected
+# time interface does not go backwards by more than 'threshold'.
+#
+# Note that the threshold value has the same resolution as the
+# clock source:
+# gettimeofday() - microseconds
+# clock_gettime(CLOCK_MONOTONIC) - nanoseconds
+# TSC - CPU clock cycles
+#
+#
+job.run_test('monotonic_time', tag='gtod', test_type='gtod',
+ duration=300, threshold=0)
+
+job.run_test('monotonic_time', tag='clock', test_type='clock',
+ duration=300, threshold=0)
+
+job.run_test('monotonic_time', tag='tsc', test_type='tsc',
+ duration=300, threshold=0)
@@ -133,6 +133,9 @@ variants:
- cpu_hotplug:
test_name = cpu_hotplug
test_control_file = cpu_hotplug.control
+ - monotonic_time:
+ test_name = monotonic_time
+ test_control_file = monotonic_time.control
- linux_s3: install setup unattended_install
type = linux_s3