From Fedora Project Wiki

Revision as of 12:58, 31 August 2009 by Kparal (talk | contribs) (i believe the backslash shouldn't be there?)

Note.png
Docs in progress
See this trac ticket for more details.

This page details installing and configuring an autotest server.

Package installation

Autotest is currently packaged for EPEL, but due to library dependencies, the package is not yet available for Fedora. The following section describes how autotest is installed on a Red Hat Enterprise 5 (or CentOS 5) system using the EPEL packages.

Use the right repos

Setup the require package repositories.

  1. Configure your system to receive RHEL or CentOS package updates through the update mechanism provided by the distribution (e.g. for RHEL, run rhn_register).
  2. Configure the system to receive updates from EPEL, for more information see EPEL/FAQ#howtouse
  3. Create a yum repo for the fedora-infrastructure package repository
    # cat << EOF > /etc/yum.repos.d/fedora-infra.repo
    [fedora-infra]
    name=fedora-infra
    baseurl=http://infrastructure.fedoraproject.org/5/$basearch
    gpgcheck=0
    EOF

Download autotest

While under package review, the autotest and required Django-0.96 packages will be not be available in one of the yum repositories listed above. In the meantime, you may download autotest.rpm, autotest-client.rpm and Django.rpm.

Install

Finally, with yum repositories configured and the autotest packages downloaded, use the yum command to install autotest and it's dependencies.

# yum --nogpgcheck localinstall autotest-*.rpm Django*.rpm

Configuration

With the packages installed, it's time to configure related system services.

httpd

  1. Start httpd:
    # service httpd restart
  2. Configure httpd to start on system boot:
    # chkconfig httpd on

mysql

Autotest requires access to a mysql server. You can use an existing server, or setup a new mysql server using the instructions below.

Initialization (optional)

If you are using an existing mysql-server, you may skip this section.

  1. Install and setup mysql server
    # yum install mysql-server
    # chkconfig mysqld on
    # service mysqld start
  2. Setup a password for the root database user. Please use a password other than NEWPASSWORD.
    # mysqladmin -u root password NEWPASSWORD

Tables and priveleges

Whether using a local mysql-server, or connecting to an existing mysql-server, autotest requires database tables with appropriate permissions.

  1. Using the mysql command, login to the root database using the password specified above
    $ mysql -u root -p
  2. Create the databases and user accounts needed by autotest using the following SQL commands. It is recommended that you use a password other than NEWPASSWORD.
    create database autotest_web;
    grant all privileges on autotest_web.* TO 'autotest'@'localhost' identified by 'NEWPASSWORD';
    grant SELECT on autotest_web.* TO 'nobody'@'%';
    grant SELECT on autotest_web.* TO 'nobody'@'localhost';
    create database tko;
    grant all privileges on tko.* TO 'autotest'@'localhost' identified by 'NEWPASSWORD';
    grant SELECT on tko.* TO 'nobody'@'%';
    grant SELECT on tko.* TO 'nobody'@'localhost';
    flush privileges;

autotest

  1. Update the autotest configuration files /usr/share/autotest/global_config.ini and /usr/share/autotest/shadow_config.ini, changing the values for password, hostname and notify_email.
  2. Setup the database schemas and populate initial data
    # python /usr/share/autotest/database/migrate.py --database=AUTOTEST_WEB sync
    # python /usr/share/autotest/database/migrate.py --database=TKO sync
  3. Run the Django syncdb operation
    # /usr/share/autotest/frontend/manage.py syncdb --noinput
  4. Make sure that current database users have admin privileges
    # mysql -u root -p -e 'update autotest_web.auth_user set is_superuser=1;'

Congratulations! Your autotest server should be up and running. Direct your web browser to http://localhost.