[libvirt] PATCH: 2/2: port Test driver to new domain APIs

Daniel P. Berrange berrange at redhat.com
Thu Jun 26 13:59:37 UTC 2008


On Thu, Jun 26, 2008 at 09:57:08AM -0400, Daniel Veillard wrote:
> On Tue, Jun 24, 2008 at 05:03:16PM +0100, Daniel P. Berrange wrote:
> 
>   One thing i'm wondering is if we couldn't do single instance XML definitions
> for tests including the domains, network, etc... just reusing the new routines
> to parse up the full set. that way  a test could be defined as a single 
> standalone file, we could also easilly get testing of the full set of parsing
> code just by using the test driver pointing to xml test instances.
>   This just push the actual test configuration one step further, and 
> actually I would not be too annnoyed to break some existing support in the
> test driver to gte that more complete and convenient coverage. 

Yes, for feeding data into the test suite we could easily do that. The
master definition file normally looks like this:

<node>
<!-- This file gives an example config for the mock 'test' backend
     driver to libvirt. This is intended to allow relible unit testing
     of applications using libvirt. To use this with virsh, run something
     like:

      virsh -connect test:////path/to/this/dir/testnode.xml nodeinfo

     -->
  <domain file="testdomfv0.xml"/>
  <domain file="testdomfc4.xml"/>
  <network file="testnetpriv.xml"/>
  <network file="testnetdef.xml"/>

  <cpu>
    <mhz>6000</mhz>
    <model>i986</model>
    <active>50</active>
    <nodes>4</nodes>
    <sockets>4</sockets>
    <cores>4</cores>
    <threads>2</threads>
  </cpu>
  <memory>8192000</memory>
</node>


With the API re-factoring you suggested we could easily have the
network/domain data inline, rather than referencing an external
file - or even support both options.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list