virt.kvm_monitor: Rename command to cmd in hmp.cmd method

To keep the arguments same as qmp's interface, rename hmp's
'command' argument to 'cmd'.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.kvm_monitor: Fallback to hmp when cmd isn't existed in qmp

Since some query commands are only existed in hmp,
fallback to hmp for these cmd when using qmp monitor.

Signed-off-by: Feng Yang <fyang@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.kvm_monitor: Get supported monitor cmd list when monitor initiation

Also add a method "_has_command" to check if human/qmp
monitor support a cmd.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.kvm_monitor: Add debug/fd argument for human_monitor_cmd interface

Also set 'cmd' argument's default value to "",
because qmp monitor can't accept 'None' string
as a command line option.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.kvm_monitor: Update monitor log print functions

This patch introduces 2 methods to log monitor log.
 - _log_command is used to log which cmd would
   be sent to monitor.
 - _log_response is used to record response
   from monitor. In qmp monitor, json string
   will be decode into multiple lines.

There is a member "debug_log" in monitor class,
which is used to enable/disable debug log in
the whole class.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.kvm_monitor: Use qmp's screendump cmd if qmp support it

New qemu-kvm version supports 'screendump' cmd
in qmp monitor, thus we can use it directly.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
install-autotest-server.sh: Add java-1.7.0-openjdk-devel to pkg list

This way, the appropriate java tools will be installed
to compile the web interface on Fedora 17.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
frontend.db: Pass connection to DatabaseOperations

In Django 1.4, the DatabaseOperations constructor takes
a mandatory connection argument, so let's handle the
TypeError, and make the application compatible with both
Django 1.3 and 1.4.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
frontend.afe.feeds: Update use of deprecated code

In Django 1.2, the access to the feeds object was moved
to from django.contrib.feeds from django.contrib.syndication
and marked it as deprecated. Django 1.4 removed it entirely,
so this change makes the web app actually compatible with
both versions of Django.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
frontend.afe.feeds: Fix coding style

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
apache/django-directives: Update to Django 1.4

Django 1.4 does change the location of the CSS files for
the admin interface, so let's add an extra rule for
that.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils/external_packages.py: Update Django built to 1.4

But stablish a minimum version of 1.3. This way systems
with Django at least 1.3 can use the distro installed
django instead of a newer one.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
frontend.settings: Add MessageMiddleware among the middleware classes

So we can effectively show up popup messages in the Django
admin view. As this class was introduced in 1.2, this change
should also allow to use Django 1.3 as a supported dep.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
install-autotest-server.sh: Fix IP grabbing expression

So the IP displays correctly on Fedora 17.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
test: fix directory name

. fix typo: src -> srcdir
. add 'virtdir' in comments

Signed-off-by: Amos Kong <akong@redhat.com>
introduce a script to execute program

This script is used to execute command and collect the monitor
information in background, redirect the outputs to log files.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
ffsb: add example patches

Those patches are used for performance/ffsb subtest
to add new examples.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
subtests.cfg: update configuration of performance subtest

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
virt_test_utils: introduce cmd_runner_monitor()

This function is used to collect the environment information of
host and guest, such as cpu utilization, meminfo, etc.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
virt_test_utils: introduce summary_up_result()

Use to summary the monitor or other kinds of results. Now it
calculate the average value for each item in the results. It
fit to the records that in matrix form.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>