All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh@us.ibm.com>
To: Michael Goldish <mgoldish@redhat.com>
Cc: Lucas Meneghel Rodrigues <lmr@redhat.com>,
	KVM mailing list <kvm@vger.kernel.org>,
	David Huff <dhuff@redhat.com>, Mike Burns <mburns@redhat.com>,
	Autotest mailing list <autotest@test.kernel.org>
Subject: Re: [RFC] KVM test: Refactoring the kvm control file and the config file
Date: Tue, 21 Jul 2009 09:05:22 -0500	[thread overview]
Message-ID: <20090721140522.GA21912@us.ibm.com> (raw)
In-Reply-To: <1764649183.757941248179624717.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>

* Michael Goldish <mgoldish@redhat.com> [2009-07-21 07:38]:
> 
> ----- "Lucas Meneghel Rodrigues" <lmr@redhat.com> wrote:
> 
> > Currently we have our kvm test control file and configuration file,
> > having them split like this makes it harder for users to edit it,
> > let's
> > say, using the web frontend.
> > 
> > So it might be good to merge the control file and the config file,
> > and
> > make a refactor on the control file code. Do you think this would be
> > a valid approach? Any comments are welcome.
> > 
> > Lucas
> 
> What exactly do you mean by merge? Embed the entire config file in
> the control file as a python string?
> 
> A few comments:
> 
> 1. The bulk of the config file usually doesn't need to be modified
> from the web frontend, IMO. It actually doesn't need to be modified
> very often -- once everything is defined, only minor changes are
> required.

Agreed.  In fact, I have a kvm_tests.common file that has all of the
guest and parameter definitions, and then I have separate "test" files
that are appended to the common file to create a kvm_tests.cfg for the
specific tests I want to run.

> 
> 2. Changes to the config can be made in the control file rather easily
> using kvm_config methods that are implemented but not currently used.
> Instead of the short form:
> 
> list = kvm_config.config(filename).get_list()
> 
> we can use:
> 
> cfg = kvm_config.config(filename)
> 
> # parse any one-liner like this:
> cfg.parse_string("only nightly")
> 
> # parse anything the parser understands like this:
> cfg.parse_string("""
> install:
>     steps = blah
>     foo = bar
> only qcow2.*Windows
> """)
> 
> # we can parse several times and the effect is cumulative
> cfg.parse_string("""
> variants:
>     - foo:
>         only scsi
>     - bar:
>         only WinVista.32
>         variants:
>             - 1:
>             - 2:
> """)
> 
> # we can also parse additional files:
> cfg.parse_file("windows_cdkeys.cfg")
> 
> # finally, get the resulting list
> list = cfg.get_list()
> 
> 3. We may want to consider something in between having the control and
> config completely separated (what we have today), and having them both
> in the same file. For example, we can define the test sets (nightly,
> weekly, fc8_quick, custom) in the config file, and select the test set
> (e.g. "only nightly") in the control file by convention. Alternatively
> we can omit the test sets from the config file, and just define a single
> test set (the one we'll be using) in the control file, or define several
> test sets in the control file, and select one of them.

Yeah, this models what I'm doing today; common config file, and then a
separate test selector mechanism.  I'd actually prefer to not have to
touch the control file at all since it already has a bunch of logic and
other info in it; and just be able to specify my test selector file.  

I think your above examples imply we can do this with the code today:

cfg = kvm_config.config(kvm_tests_common)
 
# parse any one-liner like this:
cfg.parse_string("only nightly")

> We can actually do both things at the same time, by defining the test
> sets in the config file, and defining a "full" test set among them (I
> think it's already there), which doesn't modify anything. If we want to
> use a standard test set from the config file, we can do "only nightly"
> in the control, and if we want to use a custom test set, we can do:
> cfg.parse_string("""
> only full
> # define the test set below (no need for variants)
> only RHEL
> only qcow2
> only autotest.dbench
> """)

Yep.

> 
> 4. It could be a good idea to make a "windows_cdkeys.cfg" file, that
> contains mainly single-line exceptions, such as:
> WinXP.32: cdkey = REPLACE_ME
> WinXP.64: cdkey = REPLACE_ME
> Win2003.32: cdkey = REPLACE_ME
> ...
> The real cdkeys should be entered by the user. Then the file will be
> parsed after kvm_tests.cfg, using the parse_file() method (in the
> control). This way the user won't have to enter the cdkeys into the
> long config file every time it gets replaced by a newer version. The
> cdkeys file won't be replaced because it's specific to the test
> environment (we'll only supply a sample like we do with kvm_tests.cfg).

Yep, I like that as well.

> 
> Maybe we can generalize this idea and call the file local_prefs.cfg,
> and decide that the file should contain any environment-specific
> changes that the user wants to make to the config. The file will
> contain mainly exceptions (single or multi-line). But I'm not sure
> there are many environment specific things other than cdkeys, so maybe
> this isn't necessary.
> 
> 
> Let me know what you think.

I think have a common kvm_tests.cfg file that is automatically loaded
along with the additional one-liner/custom test selector mechanism go a
long way to providing what Lucas was asking for.


-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com

  reply	other threads:[~2009-07-21 14:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1858948435.756611248178170717.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-07-21 12:33 ` [RFC] KVM test: Refactoring the kvm control file and the config file Michael Goldish
2009-07-21 14:05   ` Ryan Harper [this message]
2009-07-23 12:16     ` [Autotest] " Lucas Meneghel Rodrigues
2009-07-21 14:37   ` David Huff
2009-07-23 12:35     ` [Autotest] " Lucas Meneghel Rodrigues
     [not found] <1101191314.774351248188660794.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-07-21 15:19 ` Michael Goldish
2009-07-21 16:46   ` David Huff
     [not found] <401664338.769081248186226103.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-07-21 14:28 ` Michael Goldish
2009-07-21 11:34 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=20090721140522.GA21912@us.ibm.com \
    --to=ryanh@us.ibm.com \
    --cc=autotest@test.kernel.org \
    --cc=dhuff@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=lmr@redhat.com \
    --cc=mburns@redhat.com \
    --cc=mgoldish@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.