unattended_install: Shutdown guest on import

Autotest wait for guest shutdown at the end of unattended install. However,
when image is imported, guest is just setup to use existing image and booted.
There's no invocation of shutdown.

This patch add call for vm.shutdown in case of import method.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
virt-libvirt: Add virsh functions for snapshot handling

This patch adds following functions used for handling guest snapshots:

snapshot_create
snapshot_current
snapshot_list
snapshot_info
snapshot_revert
snapshot_delete

These functions require guest name and (if applicable) snapshot name.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
libvirt: Add virsh_snapshot test

Testing snapshot handling procedure:

- create snapshots
- getting snapshot's information
- switching snapshots
- removing snapshots

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
libvirt: Add subtest.cfg record for virsh_snapshot

Adding variants for invoking virsh_snapshot test.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
bootstrap: Add ip and arping to the list of needed commands

If one wants to use bridge, those really have to be present.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils_net: Get rid of arp dependency

The same information can be obtained by directly reading
the arp cache file /proc/net/arp. The regexp used to
do the match should work even with no translation of
flags and addresses.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt-libvirt: XML cleanup/bugfix

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: libvirt_xml: Add hypervisor_type property

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: libvirt_xml: Allow creation of new VMXML XML

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: libvirt_xml: Add property documentation

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Add basic libvirt_xml unittests

Signed-off-by: Chris Evich <cevich@redhat.com>
xml_utils_unittest: Fix little problem with ElementTree

The ElementTree installed in the system will take precedence
over the virttests version. So explicitly tell the virttest
version is the one to be used.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt-libvirt: virsh module bugfix & cleanup

* VirshPersistent.close_session() was not removing the session_id
  after successfully closing or encountering a closed/non-responsive
  session.
* Fixed some 'no space after comma' pylint complaints
* Added required '**dargs' parameter to snapshot_* functions
  so they will work with Virsh and VirshPersistant class
* Fixed snapshot_* functions return variable name to keep pylint happy.
* Updated docstrings for snapshot_* functions

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: fix typo&enhancements of libvirt test modules.

*Fix parameters' typo for libvirt test modules.
 (Make paramemters unique in configuration)
*Use complete_uri to combinate a complete uri for virsh list test.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
subtests.cfg: Remove blocks at the end of the file

So it's easier to separate the configs for each subtest.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
kvm_vm: get_block - remove debugging line

It is not necessary, considering that the qemu monitor
code already records and debug prints monitor inputs
and outputs.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
kvm: cdrom - Fix media paths

Use data_dir.get_data_dir() to get the actual path of
the cdrom file, instead of test.tmpdir.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
JeOS: Install eject

So the cdrom test can actually work under JeOS.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
kvm: floppy - make the test work on JeOS without extra deps

The floppy test, in order to work among Windows and Linux,
was using a diff command to determine whether a file copied
to the floppy had its integrity preserved. The diff command
was not present on JeOS, but fortunately it is not necessary,
since we can simply evaluate the md5sum of the files.

Also, fix the relative positioning of the floppy files, using
the data_dir API.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: remove deprecated nic_mode parameter

Signed-off-by: Chris Evich <cevich@redhat.com>