libvirt: Add virsh_blockcommit test

Test virsh command blockcommit:

    1) Prepare test environment.
    2) Commit changes from a snapshot down to its backing image.
    3) Recover test environment.
    4) Check result.

Signed-off-by: Guannan Ren <gren@redhat.com>
virsh.capabilities: fix bug for SMP machines

For machines that have more than one processor we must count all cores
for each processor to get the correct number of cpus.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
libvirt: Add virsh blockpull commandline testcase

Test virsh command blockpull:
    1) Prepare test environment.
    2) Populate a disk from its backing image.
    3) Recover test environment.
    4) Check result.

Signed-off-by: Guannan Ren <gren@redhat.com>
Merge pull request #11 from Antique/virsh-capabilities

virsh.capabilities: fix bug for SMP machines
tp-libvirt: Add provider libs

The module virsh is heavily modified by libvirt tests,
yet it is used by core virt-test functionality, although
a limited subset of APIs.

From now on, new virsh additions should be done in
the virsh provider lib, and tests themselves should
use provider.virsh instead of virttest.virsh.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tp-libvirt: Reorganize imports

Reorganize imports for all libvirt tests, and make use of the
new provider.virsh library.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #12 from autotest/provider-libs

Provider libs
change_media: Check for mkisofs

Since this test uses 'mkisofs' as the basis for it's work, we need to
ensure that the tool is available on the host and SKIP if not; otherwise,
the test will fail with ERROR's
sendkey: Check for and install required guest utility

The test assumed that 'rsyslog' was installed on the guest as a
way to log whether the running of command resulted in output going
to /var/log/messages.

Since other tests install guest utilities, have this code follow that
same patter to check and install the rsyslog package.  Along the way
fix a couple of other issues...

- The log file checked is /var/log/messages not /var/log/message
- We need to ensure that rsyslog is actually running before using
  NOTE: Using the service command is more "modern" - this test could
        still fail on older OS's that don't use systemd.  I'm not quite
        sure what check would be made there, but this at least works
        for the more modern ones.
- No need to send an "rm -rf None" if "create_file" is None
- Output to /var/log/messages is actually done to a system buffer first,
  then to /var/log/messages.  This can result in test failure if the
  expected text wasn't yet present.  Follow the other example in the
  code and try for 60 seconds before giving up.  I did try to add code
  that would modify the rsyslog config files to change some configuration
  value to require immediate writes, but that got messy - this was just
  simpler.
- Remove 'sendkey_params' / params_test as it really wasn't necessary
  as either this test uses sysrq or not.  Besides the only time the
  create_file_name is used is for the params_test - so use that.
pool_edit: Fix typo

Change opiton to option
Fix the description of LVSB sub testset.

It seems a error from copy-paste, the description of LVSB sub tests
is "Libvirt subtests".

This patch change it to "LVSB subtests".

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libguestfs.tests: Add test module for partition operations.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libguestfs.tests: Add test module for volume operations.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libguestfs.tests: Add test module for virt_inspect_operations.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
Add test for virt-win-reg.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Revert "Merge pull request #12 from autotest/provider-libs"

This reverts commit c6c5aa5719c1afd7d788b45b542c009cfb2c9590, reversing
changes made to 9ca076451044351e8c255465d33d0345f145993c.
libvirt.tests: Add virsh sysinfo test case

Add virsh sysinfo case and cfg file.

As sysinfo output varies on different platform (ARMv7, s390x, PowerPC,
!WIN32 && x86), only check processor part which each platform sysinfo
output contain, and compare cpu version from processor node xml in
sysinfo with dmidecode output, skip check if dmidecode command fail.

Signed-off-by: Wayne Sun <gsun@redhat.com>
Add new testcase virsh_save_image_define

The testcase virsh_save_image_define make a test for
virsh subcommand: save-image-dumpxml save-image-define

Signed-off-by: Guannan Ren <gren@redhat.com>
attach_detach_interface: Check for required utility

When running the 'bridge' tests, the code needs to check for the used
'brctl' utility before using it; otherwise, the tests will FAIL.
iface_trans: Need to check for required utility

The test uses the 'locate' utility to find the network-scripts, but
does not first determine if it's installed resulting in FAILures rather
than SKIP's.