From patchwork Mon Mar 22 07:44:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 87366 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2M7eV6n029440 for ; Mon, 22 Mar 2010 07:40:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753321Ab0CVHk3 (ORCPT ); Mon, 22 Mar 2010 03:40:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13034 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750889Ab0CVHk3 (ORCPT ); Mon, 22 Mar 2010 03:40:29 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2M7eS1F003151 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 22 Mar 2010 03:40:28 -0400 Received: from localhost.localdomain ([10.66.91.25]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2M7ePfh029629; Mon, 22 Mar 2010 03:40:26 -0400 Subject: [PATCH 1/4] KVM test: Add monotonic_time into the guest test To: autotest@test.kernel.org, lmr@redhat.com, kvm@vger.kernel.org From: Jason Wang Date: Mon, 22 Mar 2010 15:44:52 +0800 Message-ID: <20100322074452.16119.22820.stgit@localhost.localdomain> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 22 Mar 2010 07:40:32 +0000 (UTC) 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 ' +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