From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Habkost Subject: Re: [PATCH][KVM-AUTOTEST] Add custom install option for kvm_install Date: Mon, 11 May 2009 10:49:16 -0300 Message-ID: <1242048676-sup-9983@blackpad> References: <1241808930-20782-1-git-send-email-mburns@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Cc: "kvm@vger.kernel.org" , Uri Lublin To: Michael Burns Return-path: Received: from mx2.redhat.com ([66.187.237.31]:39658 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751018AbZEKNtU (ORCPT ); Mon, 11 May 2009 09:49:20 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4BDnL3a008287 for ; Mon, 11 May 2009 09:49:21 -0400 In-Reply-To: <1241808930-20782-1-git-send-email-mburns@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Hi, Excerpts from Michael Burns's message of Fri May 08 15:55:30 -0300 2009: > --- 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) What if we had some way to pass the other parameters from 'params' to the custom script? Maybe something like (untested): for k in params.keys(): os.putenv("KVM_INSTALL_%s" % (k), params[k]) Are all values on 'params' guaranteed to be strings, or they can be set to any python value? In the latter case, we could use str(params[k]), or export only the string parameters. -- Eduardo