web ui: Break labels in host table into multiple lines if they exceed the limit

If host has many labels the display in create job will create
a very wide table pushing the selected hosts way to the right
making it almost impossible to use.

This change will break labels column into separate lines if
labales length exceeded 40 charactes. This will also apply to
Host List page.

Added function to Utils to break string into multiple lines.

Signed-off-by: Julius Gawlas <julius.gawlas@hp.com>
utils/check_patch.py: Fix unittest module loading

We should append 'autotest' to the module namespace,
not replace the first element of the namespace with
'autotest'. This makes the check patch script able
again to run unittests that are involved with the
files touched by the patch.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
drone_utility: Fix packaging bug

This is a solution for the issue #596.

On a system wide install, the autoserv processes are in
fact called autotest-remote rather than autoserv, and the
scheduler wasn't updating the process set with them.

As a result, in the scheduler refresh loop, the processes
always looked as finished, which makes the scheduler to
try to read its pid file, and as the process is not actually
finished, report the process as it died without writing
exit code. The result is even when a verify is finished
successfuly the verify step is reported as a failure.

The solution is to make the _refresh_processes private
method of the DroneUtility class to accept a list of
processes to be verified, and verify both 'autoserv'
and 'autotest-remote' processes when refreshing the
autoserv processes present.

This should be pushed both to next and the 0.14 branch.

Martin, you may apply the patch directly to the RPM as
an emergency measure.

CC: Martin Krizek <mkrizek@redhat.com>
CC: Paul Whalen <pwhalen@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
frontend: introduce MigrateVersion as a Django model

So that it will be created by Django's manage script syncdb command.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: remove the migrate step completely

So that the effects of not using the schema SQL file can be seen.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: set tko_test_view_2 model as not managed

So that the table (we want a view) is not created and thus does not
have to be cleaned up.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: make custom SQL compatible with MySQL

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: only try to create functions if appropriate

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: model fixes for AclGroup

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: model fixes for Test

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: model fixes for HostAttribute

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: introduce database manager module

A wrapper for managing database instances. Currently implementations
for managing database instances exist for:

 * MySQL
 * PostgreSQL
 * SQLite (via "Dummy" manager)

Signed-off-by: Cleber Rosa <crosa@redhat.com>
autotest-database-turnkey: add option to read configuration from file

So that a different use case is also possible, that is, a user manually
edits a file, and wants to setup his database from that configuration.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
autotest-database-turnkey: use database manager functionality

This should make autotest-database-turnkey support other database
database backends transparently.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: allow to run unittests against other database backends.

By using the new database management module.

WARNING: it's currently necessary to edit the code to run the
unittests against other database backends. This is done on purpose
because running the database unittests involve creating and dropping
the database and may result in data loss if pointed to your production
database.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: renamed database dir to database_legacy

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: moved frontend migration files to database_legacy

Signed-off-by: Cleber Rosa <crosa@redhat.com>
database: get rid of the tko migration files

Since the tko database has been merged into the AUTOTEST_WEB database
for far too long (2009), so IMHO this is not something we want to carry
around.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
frontend: add database migrate versioninig info to fixture file

Signed-off-by: Cleber Rosa <crosa@redhat.com>
installation_support/autotest-database-turnkey: adapt to settings module

It's pretty akward to support both the old (global_config) and new
(settings) module, so just support the latter.

Signed-off-by: Cleber Rosa <crosa@redhat.com>