Install and configure autotest

This page details installing and configuring.

= Package installation =

Autotest is currently packaged for Fedora, but due to unpackaged dependencies, is not yet available in Fedora official repositories. The following section describes how Autotest is installed on a Fedora system using the AutoQA package repository.

Use the right repos
Setup the required package repositories.

 If using RHEL or CentOS, configure the system to receive package updates using the update mechanism provided by the distribution (e.g. for RHEL, run ). If using RHEL or CentOS, enable EPEL by following the instructions at EPEL/FAQ

Add the same repositories as mentioned in the AutoQA installation guide. 

Install
Finally, with yum repositories configured, use the command to install autotest and it's dependencies. yum install autotest-server

= Configuration =

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

httpd
The autotest server requires the Apache HTTP Server. No additional configuration is required, autotest provides a configuration file.


 * 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.

 Install and setup mysql server yum install mysql-server chkconfig mysqld on  On Fedora 15 and lower service mysqld start  On Fedora 16 and better systemctl start mysqld.service  Setup a password for the root database user. Please use a password other than NEWPASSWORD. mysqladmin -u root password NEWPASSWORD </li></ol>

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

Using the command, login to the root database using the password specified above mysql -u root -p </li>Create the autotest_web database and user permissions 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'; flush privileges; </li></ol>

autotest
With the mysql database configured, it's time to tell autotest how to connect, and to pre-populate the database with initial data.

 Examine the autotest configuration file to determine whether updates are required Update the autotest configuration file <ul> In section : <ul> Enter the correct value for .</li> Set appropriate value for, the maximum number of hours a single test can run before it is aborted. The recommended value for AutoQA purposes is, but we currently use   because of autotest bug 117.</li> </ul> </li> In section, set the value of  </li> </ul> </li>  At this time, autotest and SELinux do not play well together. Until autotest conforms to SELinux policy, or custom policy is available, ensure SELinux is in permissive mode. setenforce permissive vim /etc/sysconfig/selinux  # set SELINUX=permissive </li> Stop httpd service httpd stop  Stop the autotest scheduler service autotestd stop </li>  Setup the database schemas and populate initial data python /usr/share/autotest/database/migrate.py sync </li> Run the Django syncdb operation. This needs to be run twice, otherwise debug_user won't have access to the Django administrative interface. /usr/share/autotest/frontend/manage.py syncdb --noinput /usr/share/autotest/frontend/manage.py syncdb --noinput </li> Restart httpd service httpd restart </li><li> Start the autotest scheduler service autotestd start </li><li> If you want to have autotest scheduler automatically started on machine boot, run one more command: chkconfig autotestd on </li> </ol>

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

= Package upgrade =

When upgrading to a newer package, it is common that the newer server includes database schema changes. The procedure for updating your autotest database is the same procedure used when initially setting up the database. Follow the instructions in after installing a newer  package.

= Maintenance =

Removing old results
Depending on how you use autotest, the directory can fill up rather quickly. Depending on underlying file-system, you may run out of available inodes or disk space. To prevent both scenarios, you can use the command to remove results that meet certain criteria. For example, to remove test results older than 60 days, the following command can be used. /usr/sbin/tmpwatch --dirmtime -m -f 60d /usr/share/autotest/results/ -X README