From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH kvm-unit-tests 5/5] x86-run: Pull extra arguments from unittests.cfg Date: Sun, 17 Mar 2013 17:25:29 +0200 Message-ID: <20130317152529.GP11223@redhat.com> References: <5281645450dd979bd892629ca148e594e90196d8.1363391818.git.crobinso@redhat.com> <6c4d82914d07c7d4203cd3bb0c0496f607758c31.1363391818.git.crobinso@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Cole Robinson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53016 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932576Ab3CQPZb (ORCPT ); Sun, 17 Mar 2013 11:25:31 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2HFPUmA012175 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 17 Mar 2013 11:25:31 -0400 Content-Disposition: inline In-Reply-To: <6c4d82914d07c7d4203cd3bb0c0496f607758c31.1363391818.git.crobinso@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Mar 15, 2013 at 08:09:09PM -0400, Cole Robinson wrote: > Some tests want extra arguments as enumerated in unittests.cfg, > use them. > > unittests.cfg also has a few sections about invoking certains tests > with different combinations of options, but x86-run doesn't do > anything with that. With this it will not be possible to use x86-run outside of autotest, no? > --- > x86-run | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/x86-run b/x86-run > index ab9eed9..7eebee2 100755 > --- a/x86-run > +++ b/x86-run > @@ -1,5 +1,6 @@ > #!/usr/bin/env python > > +import ConfigParser > import glob > import optparse > import os > @@ -36,6 +37,24 @@ def check_qemu(binpath): > > return cmd + devcmd > > +cfgfile = None > +def args_for_test(testfile): > + global cfgfile > + if not cfgfile: > + cfgfile = ConfigParser.ConfigParser() > + cfgfile.read("x86/unittests.cfg") > + > + testname = os.path.splitext(os.path.basename(testfile))[0] > + if testname not in cfgfile.sections(): > + return "" > + > + cmd = "" > + if cfgfile.has_option(testname, "extra_params"): > + cmd += cfgfile.get(testname, "extra_params") > + if cfgfile.has_option(testname, "smp"): > + cmd += " -smp %s" % int(cfgfile.get(testname, "smp")) > + return cmd > + > > def parse_args(): > parser = optparse.OptionParser( > @@ -67,6 +86,7 @@ def main(): > ret = 0 > for testfile in testfiles: > cmd = basecmd + " -kernel %s" % testfile > + cmd += " " + args_for_test(testfile) > print cmd > > cmdret = os.system(cmd) >> 8 > -- > 1.8.1.4 > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Gleb.