m (Corrected repo URL's) |
(debug_user does not have access to Admin tab if not run twice) |
||
Line 116: | Line 116: | ||
# Setup the database schemas and populate initial data | # Setup the database schemas and populate initial data | ||
#: <pre> | #: <pre> | ||
#: | #: $ python /usr/share/autotest/database/migrate.py --database=AUTOTEST_WEB sync | ||
#: | #: $ python /usr/share/autotest/database/migrate.py --database=TKO sync</pre> | ||
# Run the Django syncdb operation | # Run the Django syncdb operation | ||
#: <pre> | #: <pre> | ||
#: | #: $ /usr/share/autotest/frontend/manage.py syncdb --noinput | ||
#: # you may have to run this twice, like if the debug_user does not have access to the Django Admin interface | |||
#: $ /usr/local/autotest/frontend/manage.py syncdb</pre> | |||
# Restart httpd | # Restart httpd | ||
#: <pre> | #: <pre> |
Revision as of 08:50, 29 November 2010
This page details installing and configuring autotest-server
.
Package installation
Autotest is currently packaged for Fedora 13, but due to unpackaged dependencies, is not yet available for Fedora. The following section describes how autotest is installed on a Fedora 13 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
rhn_register
). - If using RHEL or CentOS, enable EPEL by following the instructions at EPEL/FAQ#howtouse
- Configure the AutoQA package repository.
- For Fedora, execute the command:
wget -P /etc/yum.repos.d http://repos.fedorapeople.org/repos/fedora-qa/autoqa/fedora-autoqa.repo
- Otherwise, for EPEL, execute the command:
wget -P /etc/yum.repos.d http://repos.fedorapeople.org/repos/fedora-qa/autoqa/epel-autoqa.repo
- For Fedora, execute the command:
Install
Finally, with yum repositories configured, use the yum
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 /etc/httpd/conf.d/autotest.conf
configuration file.
- Start httpd:
# service httpd restart
- Configure httpd to start on system boot:
# chkconfig httpd on
If you install the results front-end autoqa-israwhidebroken
package, you will need to enable mod_wsgi.
- In
/etc/httpd/conf.d/wsgi.conf
, be sure that themod_wsgi.so
module is being loaded. You should see a line of text like the following:LoadModule wsgi_module modules/mod_wsgi.so
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
- # service mysqld start
- 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.
- Using the
mysql
command, login to the root database using the password specified above- $ mysql -u root -p
- 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;
- Create the tko 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_tko;
- grant all privileges on autotest_tko.* TO 'autotest'@'localhost' identified by 'NEWPASSWORD';
- grant SELECT on autotest_tko.* TO 'nobody'@'%';
- grant SELECT on autotest_tko.* TO 'nobody'@'localhost';
- flush privileges;
autotest
With the mysql database configured, it's time to tell autotest how to connect, and to pre-populate the database with initial data.
- Update the autotest configuration files
/usr/share/autotest/global_config.ini
and/usr/share/autotest/shadow_config.ini
- In sections
[TKO]
and[AUTOTEST_WEB]
, enter the correct values for password - In section
[TKO]
, change the value ofdatabase
toautotest_tko
- In section
[SERVER]
, set the value ofhostname
- In sections
- 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
- Run the Django syncdb operation
- $ /usr/share/autotest/frontend/manage.py syncdb --noinput
- # you may have to run this twice, like if the debug_user does not have access to the Django Admin interface
- $ /usr/local/autotest/frontend/manage.py syncdb
- Restart httpd
- $ service httpd restart
- Start the autotest scheduler
- $ service autotestd start
Congratulations! Your autotest server should be up and running. Direct your web browser to http://localhost.
Package upgrade
When upgrading to a newer autotest-server
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 #autotest after installing a newer autotest-server
package.
- Stop httpd
- $ service httpd stop
- Stop the autotest scheduler
- $ service autotestd stop
- 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
- Run the Django syncdb operation
- $ /usr/share/autotest/frontend/manage.py syncdb --noinput
- # you may have to run this twice, like if the debug_user does not have access to the Django Admin interface
- $ /usr/local/autotest/frontend/manage.py syncdb
- Restart httpd
- $ service httpd restart
- Start the autotest scheduler
- $ service autotestd start