virt-libvirt: Add a testcase for virsh change-media

When a guest is running, insert/update a file without
source path with "--config", then shutdown/destroy
guest, at this time, the guest cannot be started.

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
virt-libvirt: Add floppy test for virsh change-media

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
Merge pull request #788 from liyangfnst/change_media_floppy

virt-libvirt: Add floppy test for virsh change-media
tests.cfg: Display default_install variant in test name

This type of installation is commonly used, remove the '@'
before it.

Also update the comment for it.

Signed-off-by: Tom Zhou <zhouqt@gmail.com>
virttest.aexpect: Use /bin/bash instead of /bin/sh

Some particular Linux distrio, such as debian, uses a
shell program called dash. Unfortunately, the dash
program can't work with "dash -c source foobar" command.

Hence let's use '/bin/bash' explicitly, instead of the
ambiguous '/bin/sh' symbol link.

Signed-off-by: Tom Zhou <zhouqt@gmail.com>
shared: Add guest Ubuntu 13.10

Signed-off-by: Tom Zhou <zhouqt@gmail.com>
virt-libvirt: Add emulatorpin command wrapper function

Signed-off-by: Alex Jia <ajia@redhat.com>
virt-libvirt: vm_xml: Add vcpu accessors

Signed-off-by: Alex Jia <ajia@redhat.com>
virt: Add 'cpulist' standard parser to utils_test

cpulist is a list of physical CPU numbers. Its syntax is a comma
separated list and a special markup using '-' and '^' (ex. '0-4',
'0-3,^2') can also be allowed. The '-' denotes the range and the
'^' denotes exclusive.  The expression is sequentially evaluated,
so "0-15,^8" is identical to "9-14,0-7,15" but not identical to
"^8,0-15".

Signed-off-by: Alex Jia <ajia@redhat.com>
virt-libvirt: Sync new common CPUs parser function

Signed-off-by: Alex Jia <ajia@redhat.com>
virt-libvirt: Add test cases for virsh emulatorpin

Signed-off-by: Alex Jia <ajia@redhat.com>
virttest.virsh: Add secret relevant commands functions

Signed-off-by: Alex Jia <ajia@redhat.com>
virttest.libvirt_xml: Add secret XML parser module

Signed-off-by: Alex Jia <ajia@redhat.com>
libvirt.tests: Add test configuration and cases for getting and settting secret

Signed-off-by: Alex Jia <ajia@redhat.com>
virt: Add exception catching style update

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Fixup secret_set_get

* Update try...except...finally.. syntax to old-style.
* Conformed parameter keys to match rest of test
* Fix logging parameter format bug

Signed-off-by: Chris Evich <cevich@redhat.com>
run: Further restrict the default qemu set

It makes up for a quicker default run, good for presentation
purposes.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
qemu.tests.boot_from_device: Change vm.create() to preprocess_vm()

In older code we did not update params for vm before creating it.
So old VM is reused. So we will meet following error:
15:42:02 ERROR| Exception escaping from test:
Traceback (most recent call last):
  File "/usr/code/autotest/client/shared/test.py", line 426, in _exec
    _call_test_function(self.execute, *p_args, **p_dargs)
  File "/usr/code/autotest/client/shared/test.py", line 853, in _call_test_function
    raise error.UnhandledTestFail(e)
UnhandledTestFail: Unhandled VMImageMissingError: CD image file not found: '/tmp/test.iso'
[context: (run_boot_from_device) --> creating 'virt-tests-vm1']
Traceback (most recent call last):
  File "/usr/code/autotest/client/shared/test.py", line 846, in _call_test_function
    return func(*args, **dargs)
  File "/usr/code/autotest/client/shared/test.py", line 299, in execute
    postprocess_profiled_run, args, dargs)
  File "/usr/code/autotest/client/shared/test.py", line 216, in _call_run_once
    *args, **dargs)
  File "/usr/code/autotest/client/shared/test.py", line 322, in run_once_profiling
    self.run_once(*args, **dargs)
  File "/usr/code/autotest/client/tests/virt/virt.py", line 139, in run_once
    run_func(self, params, env)
  File "/usr/code/autotest/client/shared/error.py", line 138, in new_fn
    return fn(*args, **kwargs)
  File "/usr/code/autotest/client/tests/virt/qemu/tests/boot_from_device.py", line 112, in run_boot_from_device
    vm.create()
  File "/usr/code/autotest/client/shared/error.py", line 138, in new_fn
    return fn(*args, **kwargs)
  File "/usr/code/autotest/client/tests/virt/virttest/qemu_vm.py", line 1769, in create
    raise virt_vm.VMImageMissingError(iso)
VMImageMissingError: CD image file not found: '/tmp/test.iso'

This patch could fix this.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.cfg.boot_from_device: Update bootindex.

Not first index is 0, so update bootindex to 0, if we want to boot from it
firstly.

Signed-off-by: Feng Yang <fyang@redhat.com>
run: Setting --qemu_sandbox=on by default

This commit sets the Qemu sandboxing to 'on' by default. It allows the
user to run all tests using this feature to catch missing system calls
and providing more feedback to the general security of Qemu.

Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>