From patchwork Fri May 8 18:55:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Burns X-Patchwork-Id: 22649 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n48ItZBS009768 for ; Fri, 8 May 2009 18:55:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751678AbZEHSzc (ORCPT ); Fri, 8 May 2009 14:55:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754440AbZEHSzc (ORCPT ); Fri, 8 May 2009 14:55:32 -0400 Received: from mx1.redhat.com ([66.187.233.31]:41443 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbZEHSzb (ORCPT ); Fri, 8 May 2009 14:55:31 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n48ItVZ2020889 for ; Fri, 8 May 2009 14:55:31 -0400 Received: from mburns.csb (vpn-10-2.bos.redhat.com [10.16.10.2]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n48ItUhh021841; Fri, 8 May 2009 14:55:30 -0400 Received: by mburns.csb (Postfix, from userid 13432) id 41A36A849B; Fri, 8 May 2009 14:55:30 -0400 (EDT) From: Mike Burns To: kvm@vger.kernel.org Cc: ulublin@redhat.com, Michael Burns Subject: [PATCH][KVM-AUTOTEST] Add custom install option for kvm_install Date: Fri, 8 May 2009 14:55:30 -0400 Message-Id: <1241808930-20782-1-git-send-email-mburns@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Michael Burns Signed-off-by: Michael Burns --- client/tests/kvm_runtest_2/control | 14 +++++++++++++- client/tests/kvm_runtest_2/kvm_install.py | 11 +++++++++++ 2 files changed, 24 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm_runtest_2/control b/client/tests/kvm_runtest_2/control index fd68e94..c28dc67 100644 --- a/client/tests/kvm_runtest_2/control +++ b/client/tests/kvm_runtest_2/control @@ -41,6 +41,15 @@ link_if_not_exist(pwd, qemu_img, 'qemu-img') # --------------------- # Build and install kvm +# +# Details of Install options +# Mode: custom +# Description: install from custom install script +# Parameters needed: +# install_script: +# location of script relative to the +# kvm-autotest/client directory +# # --------------------- params = { "name": "kvm_install", @@ -57,7 +66,10 @@ params = { ## Install from git "git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git', - "user_git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm-userspace.git' + "user_git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm-userspace.git', + + ## Custom install + "install_script": 'tests/kvm_runtest/custom_kvm_install.sh' } # Comment the job.run_test line if you do not want to install kvm on the host. diff --git a/client/tests/kvm_runtest_2/kvm_install.py b/client/tests/kvm_runtest_2/kvm_install.py index 8be5a93..0e077ae 100755 --- a/client/tests/kvm_runtest_2/kvm_install.py +++ b/client/tests/kvm_runtest_2/kvm_install.py @@ -77,6 +77,17 @@ def run_kvm_install(test, params, env): elif install_mode == "localsrc": __install_kvm(test, srcdir) + # install from custom script + elif install_mode == "custom": + install_script = params.get("install_script") + script = os.path.join(os.environ['AUTODIR'],install_script) + if not install_script: + message = "Custom script filename not specified" + kvm_log.error(message) + raise error.TestError, message + kvm_log.info("Running " + script + " to install kvm") + os.system(script) + # invalid installation mode else: message = "Invalid installation mode: '%s'" % install_mode