Add a class named RemoteFile in virttest-remote module.

A class to handle remote file.
Currently, we support three operations on remote file.
add: append lines in to file.
sub: replace string which match pattern to repl.
remove: delete lines that match pattern.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Add some unittest for RemoteFile.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Fix for RemoteFile and unittest.

(1).Change uuid to tempfile to build a unique filename.
(2).Add a __del__ method for unittest class to remove remote_file.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>

Fix indenting error in remote.py.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
tests.guest_suspend: Fix the wrong separator for cpu flags

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu: Reset image_extra_params parameter in some block tests.

These tests will create some other format of image, so the
options for qcow3 would affect them.
To make these cases still work with qcow3 format, reset the
'image_extra_params' parameter in them.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
tests.boot_savevm: Get parameters with new method in virt-test

If the parameters are missing, just skip this test.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Merge pull request #526 from yangdongsheng/remote_edit

Add remote_edit method into virttest/remote.py.
virt: repair Cart config unittest test data.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
Merge pull request #595 from jzupka/repair_cart_unit

virt: repair Cart config unittest test data.
qemu.test: make block_stream test work with qmp monitor

Fix qemu-img create snapshot file failed when image format is raw
Corrected block stream command in human monitor (block-stream ->
block_stream)

changes from v1:
    Removed configuration to set QMP as default monitor

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: move snapshot file to images dir

Signed-off-by: Xu Tian <xutian@redhat.com>
Merge pull request #592 from zhouqt/minor-fix

qemu: Minor fixes for qemu test cases
Merge pull request #588 from xutian/fix_block_stream

qemu.test: make block_stream test work with qmp monitor
Fix virsh.start to return CmdResult object

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>

Adapt all virsh.start() to new @return.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Fix the nodedev_xml.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
virttest: Fix utils_selinux module.

Fix the context_pattern in get_context_from_str method.
The old pattern will not match the '_' in context such as
'svirt_image_t'.

utils_selinux_unittest: replace assertIn with assertTrue.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
virttest.remote_unittest: Permission fix

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: Replace deprecated template with eval in cart-config.

Replace templates.subtitution by eval in Cartesian config.
It allows use basic python expression in configuration code.
Speed is almost same as with tempaltes.subtitution.

Example:
 cfg:
   mem = 1000
   real_mem = ${float(mem) * 0.7}M

 output:
    mem = 1000
    real_mem = 700M

Signed-off-by: Jiří Župka <jzupka@redhat.com>
tests/autotest_regression.py: do not depend on wget

The JeOS image itself has no wget preinstalled, and other images
that could be used with this may share the same characteristic.

So, use plain python (and ugly command line) to download the
installer script.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
qemu.tests.cfg: Give the 'usb_default' variant a meaningful name

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>