software_manager: check_installed() should not raise CmdError

The check_installed() method returns True or False depending on
wether the given package is installed or not. It should shield
callers of that method from erros when dealing with the low
level package manager.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
software_manager: fix check for a package and version that is not installed

When calling check_installed() and asking for a specific version
check, the current code misleadingly returns True.

The actual cause is that the output of the rpm command ("package
foo is not installed") is simply compared with the asked for version,
and the string comparison returns True.

For now just return False if that specific output is returned. A
more complete rewrite may be needed for fail proof version comparison.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
frontend.tko.migrations: Fix auto generated migration schema

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tko/autotest-db-delete-job: Do a better job handling MySQL errors

When trying to delete a job from the db, sometimes all
conditions for it to be deleted may not be fulfilled.
This usually happens when the job that the user tried
to delete was still on the scheduler queue, see issue #656.

So handle exceptions that might happen during the operation,
and try to make an educated guess about what happened
and how the user can work around the problem.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
contrib/install-autotest-server.sh: add steps for installing git

So that the autotest source code tree can be fetched and the other
packages installed via `autotest-install-packages-deps`.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
contrib/install-autotest-server.sh: use autotest-install-packages-deps

Revert back to the previous way of installing server package deps.
With the separate step that installs git this now works when the
user has the install script only, and not a checked out tree.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
contrib/install-autotest-server.sh: use `ip` instead of `ifconfig`

When attempting to detect the IP address that the Autotest server
will be listening on.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
frontend/pkgdeps.py: remove non-existing ubuntu package

Signed-off-by: Cleber Rosa <crosa@redhat.com>
client.shared.test: Add call trace back to log.

When debug qmp_basic_rehl6.py, got following output:
11:54:18 INFO | Running function: qmp_basic_rhel6.run_qmp_basic_rhel6()
11:54:18 ERROR| Test failed: TestFail: 'qemu' key is not of type '<type 'unicode'>', it's '<type 'dict'>'
11:54:18 ERROR| /usr/code/autotest/client/tests/virt/virttest/video_maker.py:195: DeprecationWarning: gst.Bin.add_many() is deprecated, use gst.Bin.add()
11:54:18 ERROR|   pipeline.add_many(source, decoder, encoder, container, output)

11:55:08 ERROR| child process failed
11:55:10 INFO | 		FAIL	virt.qemu.Host_RHEL.6.2.repeat1.qcow2.virtio_blk.smp2.virtio_net.RHEL.6.4.x86_64.qmp_basic_rhel6	virt.qemu.Host_RHEL.6.2.repeat1.qcow2.virtio_blk.smp2.virtio_net.RHEL.6.4.x86_64.qmp_basic_rhel6	timestamp=1370663710	localtime=Jun 08 11:55:10	'qemu' key is not of type '<type 'unicode'>', it's '<type 'dict'>'
11:55:10 INFO | 	END FAIL	virt.qemu.Host_RHEL.6.2.repeat1.qcow2.virtio_blk.smp2.virtio_net.RHEL.6.4.x86_64.qmp_basic_rhel6	virt.qemu.Host_RHEL.6.2.repeat1.qcow2.virtio_blk.smp2.virtio_net.RHEL.6.4.x86_64.qmp_basic_rhel6	timestamp=1370663710	localtime=Jun 08 11:55:10
11:55:10 INFO | END GOOD	----	----	timestamp=1370663710	localtime=Jun 08 11:55:1

It is difficult for us to debug the fail.

Signed-off-by: Feng Yang <fyang@redhat.com>
client.setup_module: Add function import_system_module().

Autotest will add its pathes to sys.path when testcase is running.
Then we can not import system module if it has same name with
an autotest module.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>