autotest/tp-libvirt — pull request #47 by jferlan (2014-02-20 11:33:58+00:00)
Title: vol_create_from: Fix some errors and assumptions

The test assumed that the iscsi tools tgtadm and iscsiadm were present
on the host which caused all sorts of errors and failures. So before
running any test that would need to do use login_iscsi(), make sure
the tools exist.

The test would blindly clear and set selinux enforcing mode. Instead
of doing that - check for the current mode and if enforcing, then
switch to Permissive while setting up the iscsi environment. Once complete
if we had to set to Permissive, then reset to the former Enforcing level

The output of a 'virsh vol-list' changed such that there's a space prior to
the volume name. This resulted in lists of ' src_vol' which would then fail
the ensuing checks. Added the "\W?" to avoid that whitespace

If cleanup_pool was presented with a pool that didn't exist, then it would
fail. This can now happen due to a change in the main loop which expanded
the try/finally coverage.

In the main loop, expand the try: to cover the creation of the pool and
volumes since the finally code would perform the cleanup. Without doing
this failure to add volumes would leave random pools around which caused
failures when running the test a second time.