public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: autotest@test.kernel.org, lmr@redhat.com, kvm@vger.kernel.org
Subject: [PATCH 1/4] KVM test: Add monotonic_time into the guest test
Date: Mon, 22 Mar 2010 15:44:52 +0800	[thread overview]
Message-ID: <20100322074452.16119.22820.stgit@localhost.localdomain> (raw)

Monotonic_time is used to test gettimeofday(), TSC and
clock_gettime(CLOCK_MONOTONIC) which is useful to test the virutal
timer device.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 .../kvm/autotest_control/monotonic_time.control    |   37 ++++++++++++++++++++
 client/tests/kvm/tests_base.cfg.sample             |    3 ++
 2 files changed, 40 insertions(+), 0 deletions(-)
 create mode 100644 client/tests/kvm/autotest_control/monotonic_time.control

diff --git a/client/tests/kvm/autotest_control/monotonic_time.control b/client/tests/kvm/autotest_control/monotonic_time.control
new file mode 100644
index 0000000..4dbfec4
--- /dev/null
+++ b/client/tests/kvm/autotest_control/monotonic_time.control
@@ -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)
diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample
index 9963a44..2af6a05 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -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


             reply	other threads:[~2010-03-22  7:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22  7:44 Jason Wang [this message]
2010-03-22  7:45 ` [PATCH 2/4] KVM test: Add TSC into guest test Jason Wang
2010-03-24  5:37   ` [Autotest] " Lucas Meneghel Rodrigues
2010-03-24  5:59     ` Jason Wang
2010-03-24 14:43       ` Lucas Meneghel Rodrigues
2010-03-26  2:51         ` Jason Wang
2010-03-22  7:45 ` [PATCH 3/4] KVM test: Add scrashme " Jason Wang
2010-03-25  1:29   ` Lucas Meneghel Rodrigues
2010-03-22  7:45 ` [PATCH 4/4] KVM test: Enable timedrift for Linux guests Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100322074452.16119.22820.stgit@localhost.localdomain \
    --to=jasowang@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=lmr@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox