From patchwork Mon Apr 19 11:10:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 93476 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 o3JBAjX0005988 for ; Mon, 19 Apr 2010 11:10:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754420Ab0DSLKn (ORCPT ); Mon, 19 Apr 2010 07:10:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43542 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754410Ab0DSLKm (ORCPT ); Mon, 19 Apr 2010 07:10:42 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3JBAemf008321 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 Apr 2010 07:10:40 -0400 Received: from localhost.localdomain (vpn-8-225.rdu.redhat.com [10.11.8.225]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3JBAcB9006511; Mon, 19 Apr 2010 07:10:39 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, sshang Subject: [PATCH] KVM Test: Add KVM unit test (kvmctl) v2 Date: Mon, 19 Apr 2010 08:10:36 -0300 Message-Id: <1271675436-4954-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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, 19 Apr 2010 11:10:45 +0000 (UTC) diff --git a/client/tests/kvm/tests/unit_test_kvmctl.py b/client/tests/kvm/tests/unit_test_kvmctl.py new file mode 100644 index 0000000..a5b88b6 --- /dev/null +++ b/client/tests/kvm/tests/unit_test_kvmctl.py @@ -0,0 +1,28 @@ +import os +from autotest_lib.client.bin import utils +from autotest_lib.client.common_lib import error + + +def run_unit_test_kvmctl(test, params, env): + """ + This is kvm userspace unit test, use kvm test harness kvmctl load binary + test case file to test various functions of the kvm kernel module. + The output of all unit tests can be found in the test result dir. + + @param test: KVM test object. + @param params: Dictionary with the test parameters. + @param env: Dictionary with test environment. + """ + case = params.get("case") + srcdir = params.get("srcdir", test.srcdir) + unit_dir = os.path.join(srcdir, "kvm_userspace", "kvm", "user") + os.chdir(unit_dir) + + cmd = "./kvmctl test/x86/bootstrap test/x86/%s.flat" % case + try: + results = utils.system_output(cmd) + except error.CmdError, e: + raise error.TestFail("Unit test %s failed" % case) + + result_file = os.path.join(test.resultsdir, case) + utils.open_write_close(result_file, results) diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample index e73ba44..9f82ffb 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -306,6 +306,38 @@ variants: - ksm_parallel: ksm_mode = "parallel" + # This unit test module is for older branches of KVM that use the + # kvmctl test harness (such as the code shipped with RHEL 5.x) + - unit_test_kvmctl: + type = unit_test + vms = '' + profilers = '' + variants: + - access: + case = access + - apic: + case = apic + - emulator: + case = emulator + - hypercall: + case = hypercall + - msr: + case = msr + - port80: + case = port80 + - realmode: + case = realmode + - sieve: + case = sieve + - smptest: + case = smptest + - tsc: + case = tsc + - stringio: + case = stringio + - vmexit: + case = vmexit + - qemu_img: type = qemu_img vms = ''