KVM test: unittest: Fix the broken smp params
PATCH 1/2 KVM test: unittest: Fix the broken smp params
Make smp param in unittests.cfg works again.
--- client/tests/kvm/tests/unittest.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
client/tests/kvm/tests/unittest.py +1 -0
@@ -73,6 +73,7 @@ def run_unittest(test, params, env): smp = None if parser.has_option(t, 'smp'): smp = int(parser.get(t, 'smp')) + params['smp'] = smp extra_params = None if parser.has_option(t, 'extra_params'):
PATCH 2/2 KVM test: unittest: Build unittests from new repo
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.
--- client/tests/kvm/tests/build.py | 16 ++++++++++++++-- client/tests/kvm/unittests.cfg.sample | 1 + 2 files changed, 15 insertions(+), 2 deletions(-)
client/tests/kvm/tests/build.py +14 -2
@@ -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):
client/tests/kvm/unittests.cfg.sample +1 -0
@@ -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
Re: [Autotest] [PATCH 2/2] KVM test: unittest: Build unittests from new repo
Quoted 2 lines · Jason Wang
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.
Looks good for me.
Quoted 69 lines
Signed-off-by Jason Wang <[email protected]>--- client/tests/kvm/tests/build.py | 16 ++++++++++++++-- client/tests/kvm/unittests.cfg.sample | 1 + 2 files changed, 15 insertions(+), 2 deletions(-)client/tests/kvm/tests/build.py +14
-2@@ -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):client/tests/kvm/unittests.cfg.sample +1
-0@@ -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_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
Quoted 1 line · Jason Wang
Make smp param in unittests.cfg works again.
The entire patchset was applied. Thank you very much for the fixes and the support for the new unittests repo, Jason!
Lucas
Quoted 22 lines
Signed-off-by Jason Wang <[email protected]>--- client/tests/kvm/tests/unittest.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)client/tests/kvm/tests/unittest.py +1
-1@@ -73,6 +73,7 @@ def run_unittest(test, params, env): smp = None if parser.has_option(t, 'smp'): smp = int(parser.get(t, 'smp')) + params['smp'] = smp extra_params = None if parser.has_option(t, 'extra_params'): --To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html