KVM Archive on lore.kernel.org
 help / color / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: lmr@redhat.com, autotest@test.kernel.org
Cc: kvm@vger.kernel.org
Subject: [PATCH 2/2] KVM test: unittest: Build unittests from new repo
Date: Mon, 06 Sep 2010 17:33:11 +0800
Message-ID: <20100906093311.7075.6537.stgit@FreeLancer> (raw)
In-Reply-To: <20100906093303.7075.52993.stgit@FreeLancer>

Kvm-unit-tests have moved to a repo out of qemu-kvm. This patch let
the unittest could build the tests from specified git repo.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 client/tests/kvm/tests/build.py       |   16 ++++++++++++++--
 client/tests/kvm/unittests.cfg.sample |    1 +
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/client/tests/kvm/tests/build.py b/client/tests/kvm/tests/build.py
index 5a8f3b0..f39371a 100644
--- a/client/tests/kvm/tests/build.py
+++ b/client/tests/kvm/tests/build.py
@@ -495,18 +495,22 @@ class GitInstaller(SourceDirInstaller):
         kernel_repo = params.get("git_repo")
         user_repo = params.get("user_git_repo")
         kmod_repo = params.get("kmod_repo")
+        test_repo = params.get("test_git_repo")
 
         kernel_branch = params.get("kernel_branch", "master")
         user_branch = params.get("user_branch", "master")
         kmod_branch = params.get("kmod_branch", "master")
+        test_branch = params.get("test_branch", "master")
 
         kernel_lbranch = params.get("kernel_lbranch", "master")
         user_lbranch = params.get("user_lbranch", "master")
         kmod_lbranch = params.get("kmod_lbranch", "master")
+        test_lbranch = params.get("test_lbranch", "master")
 
         kernel_commit = params.get("kernel_commit", None)
         user_commit = params.get("user_commit", None)
         kmod_commit = params.get("kmod_commit", None)
+        test_commit = params.get("test_commit", None)
 
         kernel_patches = eval(params.get("kernel_patches", "[]"))
         user_patches = eval(params.get("user_patches", "[]"))
@@ -529,8 +533,16 @@ class GitInstaller(SourceDirInstaller):
                                                    os.path.basename(patch)))
                 utils.system('patch -p1 %s' % os.path.basename(patch))
 
-        unittest_cfg = os.path.join(userspace_srcdir, 'kvm', 'test', 'x86',
-                                    'unittests.cfg')
+        if test_repo:
+            test_srcdir = os.path.join(self.srcdir, "kvm-unit-tests")
+            kvm_utils.get_git_branch(test_repo, test_branch, test_srcdir,
+                                     test_commit, test_lbranch)
+            unittest_cfg = os.path.join(test_srcdir, 'x86',
+                                        'unittests.cfg')
+            self.test_srcdir = test_srcdir
+        else:
+            unittest_cfg = os.path.join(userspace_srcdir, 'kvm', 'test', 'x86',
+                                        'unittests.cfg')
 
         self.unittest_cfg = None
         if os.path.isfile(unittest_cfg):
diff --git a/client/tests/kvm/unittests.cfg.sample b/client/tests/kvm/unittests.cfg.sample
index 7ea0674..3d32cb2 100644
--- a/client/tests/kvm/unittests.cfg.sample
+++ b/client/tests/kvm/unittests.cfg.sample
@@ -58,6 +58,7 @@ variants:
                 user_git_repo = git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git
                 user_branch = next
                 user_lbranch = next
+                test_git_repo = git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git
 
     - unittest:
         type = unittest

  reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-06  9:33 [PATCH 1/2] KVM test: unittest: Fix the broken smp params Jason Wang
2010-09-06  9:33 ` Jason Wang [this message]
2010-09-07 22:12   ` [Autotest] [PATCH 2/2] KVM test: unittest: Build unittests from new repo Amos Kong
2010-09-07 17:17 ` [PATCH 1/2] KVM test: unittest: Fix the broken smp params Lucas Meneghel Rodrigues

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=20100906093311.7075.6537.stgit@FreeLancer \
    --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

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
		kvm@vger.kernel.org
	public-inbox-index kvm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kvm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git