Hi,
Thanks for the response.Also my client is not going to modified. My client is going to connect with the URI "qemu+tls://<host>/system?no_tty=1", so I can't directly use the test driver here so I need to replace the qemu driver with the test driver and give my dummy response. So I need to know how to replace the driver say qemu with test driver and generating my desired output.
Regards,
Arun V
On Wed, Sep 11, 2013 at 2:23 PM, Daniel P. Berrange <berrange@xxxxxxxxxx> wrote:
On Wed, Sep 11, 2013 at 12:50:37PM +0530, Arun Viswanath wrote:The XML file is provided via the URI. For example
> Hi Eric,
>
> Thanks for your response.
> I like to know how test driver works.
>
> In the libvirt.org for test driver it is mentioned as "It can start with a
> pre-configured default config, or be given a path to an alternate config".
> Is the config is an xml file where we mentioned some dummy data so that the
> test driver will return it as response. If yes then where can I find this
> dummy file?
>
> As mentioned earlier my intention is to mock qemu calls. so it test driver
> works then I'm planning to remove the qemu driver and register "test"
> driver as "qemu" driver and take the fake data from the config file. Please
> let me know which are the files I need to look into to register "test" as
> "qemu" and make its operations to work.
test:///default
uses a built-in config, but you can supply a real path eg
test:///home/berrange/testnode.xml
Take a look at examples/xml/test/testnode.xml in the libvirt source
tree for an example.
FYI, the test driver is used very successfully in virt-install and
virt-manager for testing their functionality in an automated way,
so I can strongly recommend its use, over trying to mock the APIs
or wire protocol yourself.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
<capabilities> <host> <cpu> <arch>i686</arch> <features> <pae/> <nonpae/> </features> </cpu> <power_management/> <topology> <cells num='2'> <cell id='0'> <cpus num='8'> <cpu id='0'/> <cpu id='2'/> <cpu id='4'/> <cpu id='6'/> <cpu id='8'/> <cpu id='10'/> <cpu id='12'/> <cpu id='14'/> </cpus> </cell> <cell id='1'> <cpus num='8'> <cpu id='1'/> <cpu id='3'/> <cpu id='5'/> <cpu id='7'/> <cpu id='9'/> <cpu id='11'/> <cpu id='13'/> <cpu id='15'/> </cpus> </cell> </cells> </topology> <secmodel> <model>testSecurity</model> <doi></doi> </secmodel> </host> <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/test-hv</emulator> <domain type='test'> </domain> </arch> <features> <pae/> <nonpae/> </features> </guest> <guest> <os_type>xen</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/test-hv</emulator> <domain type='test'> </domain> </arch> <features> <pae/> <nonpae/> </features> </guest> </capabilities>
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list