[libvirt] adding tests....

Daniel P. Berrange berrange at redhat.com
Mon Jan 12 12:46:00 UTC 2009


On Mon, Jan 12, 2009 at 01:28:41PM +0100, Jim Meyering wrote:
> "Daniel P. Berrange" <berrange at redhat.com> wrote:
> >> +    if (remote_config_file == NULL) {
> >> +	static const char *default_config_file
> >> +	  = SYSCONF_DIR "/libvirt/libvirtd.conf";
> >> +	remote_config_file =
> >> +	  (access(default_config_file, X_OK) == 0
> >> +	   ? default_config_file
> >> +	   : "/dev/null");
> >> +    }
> >
> > Indentation looks off-by-2 there.
> 
> Good catch.  I had TABs there.
> Fixed.
> 
> >> +virsh --connect qemu:///session \
> >> +    pool-define-as P dir src-host /src/path /src/dev S /target-path > out 2>&1 \
> >> +  || fail=1
> >> +virsh --connect qemu:///session pool-dumpxml P >> out 2>&1 || fail=1
> >
> > Using qemu:///session here is fragile because it'll see
> > all existing user defined vms/network/storage/etc. Use
> > the test:///default  driver instead (or test:///path/to/custom/config.xml)
> 
> I wanted to exercise a "real" drivers, not always test://.
> How about using an unlikely pool name instead, i.e.,
> via this incremental:

That's only one issue. When you start up libvirtd it is going to run
autostart on all configured vms/networks/pools. We really don't want
to be booting configured VMs, and then tearing them down after a few
seconds. The unit tests should restrict themselves to testing things
which won't have any impact on the host system. Anything else needs
to be part of a functional/integration test suite, which is better as
a standalone test suite you can run on any OS with libvirt - not just
a development tree, so you can test the complete system is functional

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