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

Daniel Veillard veillard at redhat.com
Thu Jun 26 14:33:59 UTC 2008

On Thu, Jun 26, 2008 at 02:59:37PM +0100, Daniel P. Berrange wrote:
> 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.

  yes, one of the small things to fix is to make sure every place where we do 
XPath queries we need to use relative queries and reset the context node


Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

More information about the libvir-list mailing list