Always keep screendumps

screendumps are important, the current
policy of saving it when case error only is
not enough, if a VM network works fine and
case pass, but VM vga malfunction, deleted
them would potential miss bugs

Signed-off-by: Xiaoqing Wei <xwei@redhat.com>
Couple of miscellaneous fixes

utils_misc: Need to add parameter for a %s directive in message
            for get_qemu_binary method

utils_test/libvirt: Use 'permissive' not 'Permissive' since the set_status
                    expects the lower case

virsh: Simple typo in comment for net_state_dict() which was copied from
       a similar pool function, but the comment change was missed
virttest.env_process: Record qemu pid in screendump folder name.

Sometimes, Two qemu may share same vm.name. So add qemu pid to
screendump folder name.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.qemu_vm: Update clone VM to env in vm.migrate().

Now we do not record cloned VM to env. So we only can catch screendump
for source VM.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.env_process: Encode screendump image to video in postprocess()

Now we Encode screendump image to video in postprocess_vm(), but it could only
encode source VM's image to video in migration.
So move the function to postprocess()

Signed-off-by: Feng Yang <fyang@redhat.com>
Add acpiphp for hotplug tests for suse products

Signed-off-by: Lin Ma <lma@suse.com>
virt: Override update() method of PropCanBase.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_xml: Change wrong parameter 'pathname' to 'path'.

The pathname is not defined here, then we will get an UnboundLocalError
when use it.

	# python virttest/libvirt_xml_unittest.p
	Eg:
	.........................E.....................
	======================================================================
	ERROR: test_no_module (__main__.testLibrarian)
	----------------------------------------------------------------------
	Traceback (most recent call last):
	  File "virttest/libvirt_xml_unittest.py", line 669, in test_no_module
	    badname)
	  File "/usr/lib64/python2.6/unittest.py", line 335, in failUnlessRaises
	    callableObj(*args, **kwargs)
	  File "/add_storage/yds/autotest/client/tests/virt/virttest/libvirt_xml/devices/librarian.py", line 24, in get
	    handler_cl = base.load_xml_module(mod_path, name, DEVICE_TYPES)
	  File "/add_storage/yds/autotest/client/tests/virt/virttest/libvirt_xml/base.py", line 228, in load_xml_module
	    % (name, pathname, str(detail)))
	UnboundLocalError: local variable 'pathname' referenced before assignment

	----------------------------------------------------------------------
	Ran 47 tests in 3.034s

	FAILED (errors=1)

This patch change the pathname to correct 'path';

After this patch applied:

	# python virttest/libvirt_xml_unittest.p
	...............................................
	----------------------------------------------------------------------
	Ran 47 tests in 0.409s

	OK

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virt: Adapt the utils_misc_unittest to new utils_misc.

Commit f9ec296d (Update utils to support pin multiple threads to one node)
changed the utils_misc.NumaNode, then the unittest of it got a fail:

	# python virttest/utils_misc_unittest.py
	.F.F......WARNING:root:Git repo foo tag is not signed
	WARNING:root:This means we will not verify if the key was made by whomever claims to have made it (dangerous)
	...
	======================================================================
	FAIL: test_free_cpu (__main__.TestNumaNode)
	----------------------------------------------------------------------
	Traceback (most recent call last):
	  File "virttest/utils_misc_unittest.py", line 177, in test_free_cpu
	    self.assertEqual(self.numa_node.dict["0"], "1230")
	AssertionError: ['1230'] != '1230'

	======================================================================
	FAIL: test_pin_cpu (__main__.TestNumaNode)
	----------------------------------------------------------------------
	Traceback (most recent call last):
	  File "virttest/utils_misc_unittest.py", line 150, in test_pin_cpu
	    self.assertEqual(self.numa_node.dict["0"], "1230")
	AssertionError: ['1230'] != '1230'

	----------------------------------------------------------------------
	Ran 13 tests in 0.003s

	FAILED (failures=2)

This patch adapt the unittest to the new data type.

	# python virttest/utils_misc_unittest.py
	..........WARNING:root:Git repo foo tag is not signed
	WARNING:root:This means we will not verify if the key was made by whomever claims to have made it (dangerous)
	...
	----------------------------------------------------------------------
	Ran 13 tests in 0.002s

	OK

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Merge pull request #1504 from jferlan/misc_fix

Couple of miscellaneous fixes
Merge pull request #1514 from yangdongsheng/unittest

Unittest
Merge pull request #1497 from xiaoqing-wei/always_screendump

Always keep screendumps
Merge pull request #1491 from FengYang/screendump

save screendump per VM pid rather then name
virttest.env_process: PEP8 fixes

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #1513 from yangdongsheng/update

virt: Override update() method of PropCanBase.
Merge pull request #1511 from morecache/add-acpiphp-for-hotplug-tests

Add acpiphp for hotplug tests for suse products
virttest.iscsi: Fix a regex and log level

As the newly updated of iscsi related packages, the output of iscsi
session is different from the past, so update the regex when
searching iscsi device name to adapt the update.

If no iscsi device, it should report error instead of debug msg.

Signed-off-by: Yanbing Du <ydu@redhat.com>
setup_or_cleanup_iscsi: Robust assumptions and pep8 fix

When reviewing jferlan's PR(tp-libvirt#47) to fix vol_create_from case,
i found the problems also exist in setup_or_cleanup_iscsi(), so pick up
the fixes:

When setup iscsi env, the function assumed that the iscsi tools
'tgtadm' and 'iscsiadm' were present on the host which may cause
all sorts of errors and failures. So before running these commands,
make sure the tools exist.

Additionally within iscsi_login, extended testing found that the SCSI
/dev/sdxx device didn't instantaneously appear. Sometimes it took an
extra second or two to appear, so added a loop for get_device_name().

Meanwhile, a pep8 fix to make sure no more combined module imports.

Signed-off-by: Yanbing Du <ydu@redhat.com>