boottool: Fix boottool to work on system wide install

The boottool code import magic failed to take that into
account. Fix it in a similar way done for other entry
points.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tko: Remove empty file create-db-postgres

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
cli: Entry points rename

Drop the atest entry point, and rename the entry points
properly so they can be more easily recognizable on a
system wide install.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
frontend: Delete autotest-manage-rpc-server

As it is only needed when developing the rpc server.
It was never meant to be a user visible script. So
we keep manage.py and get rid of this one.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Autotest: Introducing setup.py script to install autotest files

In order to support packaging, we need the ability to determine
which file goes where and which ones get packaged.

I decided to use the standard setup.py approach to accomplish
this. This is an initial first cut and should be reviewed and
tweaked as needed.

Changes from v3:
 * More fixes with regards to file positioning inside FS
 * Corrected system wide prefixes

Changes from v2:
 * Updated several entry points to the current status
   of the tree

Changes from v1:
 * Starting the tweaks - Change references to author
 * Remove unneeded glob imports

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
server/install_host: synchronize dhcp after setting netboot_enabled

Recent Cobbler (as of 741faeafc4782ee66d7d1934a29b107602f1ebe9 in the
Cobbler git tree) only writes dhcpd.conf entries for netboot-enabled
systems. When we mark a system as netboot_enabled, therefore, we need to
also ensure dhcpd is synchronized, and there is a new API for this
purpose.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
virt: RHEL-6-series.ks - Add coreutils and usbutils

Those packages are needed for some of the new tests
added to the kvm test set.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
client job: Instantiate job.bootloader lazily

Only instantiate job.bootloader to a usable value
if it's really needed (ie, we want to reboot the
machine), since now we depend on a C tool to do
that and the compilation of this tool might fail.

So only throw errors if something wrong happens
there, so we don't have to punish users that only
want to run some tests with the autotest client.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
contrib/install-autotest-server.sh: make the script more modularized

The encapsulation of the script code into functions will allow one
to chose specific installation actions, such as just installing packages,
and may help the code reuse between the script itself and %pre/%post
scripts on RPM packages.

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

This should improve the install time a little, as YUM won't have to do all
the checking (including contacting repos, cheking depencies) multiple times.

Still, the packages are still separated into different groups, so it's easy
to select only a subset of them if necessary.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
contrib/install-autotest-server.sh: only play with iptables config if it exists

I've observed that minimal installations might lack the iptables configuration
file, so add a check.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
contrib/install-autotest-server.sh: better filter libvirt's default network address

If installing a VM with an autotest server using libvirt's default network
address assigment, if the aquired address starts with '1', then it'd not
be shown on the installation status message.

So, let's filter out just the address assigned to the host interface.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
contrib/install-autotest-server.sh: allow to short-circuit the installation

This first commit allows one to install the necessary packages on a base
system. Suitable for generating and keeping a base autotest installation
image, handy for development.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
contrib/install-autotest-server.sh: check and skip package installation

We can quickly detect if packages are already installed. If desired and
installed counters match, skip installation.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
boottool: Instantiate job.bootloader lazily take 2

We did find out that the job.boottool attribute was
more pervasively used than we originally thought, so
267bebd93546d43a0900052742767dad941e7ed2 did resolve
the problem for users of autotest local, but broke
use for any code that involved kernel code. So instead
of treating all the places that might use job.bootloader
methods, make boottool.boottool a child class that will
initialize the grubby compilation on demand, only
if one of the methods of it are actually accessed.

With this, we resolve the bug that makes any job that
installs a kernel to fail, since self.job.bootloader
might be None currently.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
subtests.cfg: Make boot_with_usb and reboot_with_usb Linux only

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
boottool: Fix __getattribute__ acessor

The shorthand __getattr__ can't be used.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
boottool: optmize implementation of get_entries()

Now 'grubby --info=<arg>' should be called just once, instead of
once for every entry.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
boottool: fix misleading error message

When running --info without parameters, a misleading error message
was printed out. Replace it with a proper message.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
boottool: made parsing of grubby output (entries) more resilient

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