From Fedora Project Wiki

(Update instructions to match autotest-0.12.0 release)
 
(48 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{header|qa}}
{{header|qa}}
{{admon/note|Docs in progress|See [https://fedorahosted.org/autoqa/ticket/5 this trac ticket] for more details.}}


This page details installing and configuring {{package|autotest-server}}.
This page details installing and configuring {{package|autotest-server}}.
Line 7: Line 5:
= Package installation =
= 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 {{command|yum}} command to install ''autotest'' and it's dependencies.
<pre> yum install autotest-server</pre>


== Use the right repos ==
The web interface is available in ''autotest-web'' package. Due to unpackaged dependencies (Google Web Toolkit), this package is not packaged in Fedora, but it is available in the AutoQA repository:


Setup the required package repositories.   
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 {{command|rhn_register}}).
<ol>
# If using RHEL or CentOS, enable [[EPEL]] by following the instructions at [[EPEL/FAQ#howtouse]]
<li>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 {{command|rhn_register}}).</li>
# Enable the Fedora infrastructure package repository.  Create a configuration file {{filename|/etc/yum.repos.d/fedora-infra.repo}} that contains the following information:
<li>If using RHEL or CentOS, enable [[EPEL]] by following the instructions at [[EPEL/FAQ#howtouse]]</li>
#: <pre>
#: [fedora-infrastructure]
#: name=fedora-infrastructure - $releasever - $basearch
#: baseurl=http://infrastructure.fedoraproject.org/$releasever/$basearch
#: enabled=1
#: gpgcheck=0</pre>
# Enable the Fedora infrastructure package repository.  Create a configuration file {{filename|/etc/yum.repos.d/autoqa.repo}} that contains the following information:
#: <pre>
#: [autoqa]
#: name=autoqa - $releasever
#: baseurl=http://jlaska.fedorapeople.org/autoqa/repos/$releasever
#: enabled=1
#: gpgcheck=0</pre>
 
<!--
<!--
== Download autotest ==
<li>Enable the Fedora infrastructure package repository. Create a configuration file {{filename|/etc/yum.repos.d/fedora-infra.repo}} that contains the following information:
 
<pre>
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 the packages individually using the links below.
[fedora-infrastructure]
 
name=fedora-infrastructure - $releasever - $basearch
* <code>[[image:Echo-package-16px.png]][http://jlaska.fedorapeople.org/autoqa/rpms/autotest/autotest-0.11.0-4.el5.noarch.rpm autotest.rpm]</code>
baseurl=http://infrastructure.fedoraproject.org/$releasever/$basearch
* <code>[[image:Echo-package-16px.png]][http://jlaska.fedorapeople.org/autoqa/rpms/autotest/autotest-client-0.11.0-3.el5.noarch.rpm autotest-client.rpm]</code>
enabled=1
* <code>[[image:Echo-package-16px.png]][http://jlaska.fedorapeople.org/autoqa/rpms/Django/Django-0.96-1.20071126svn.ep5.el5.noarch.rpm Django.rpm]</code>
gpgcheck=0
</pre></li>
-->
-->
 
<li>Add the same repositories as mentioned in the [[Install_and_configure_AutoQA#Use_the_Right_Repo|AutoQA installation guide]].</li>
== Install ==
</ol>
 
Finally, install the package:
Finally, with yum repositories configured, use the {{command|yum}} command to install ''autotest'' and it's dependencies.
<pre> yum install autotest-web</pre>
<pre># yum install autotest-server</pre>


= Configuration =
= Configuration =
Line 52: Line 37:


The autotest server requires the Apache HTTP Server.  No additional configuration is required, autotest provides a {{filename|/etc/httpd/conf.d/autotest.conf}} configuration file.
The autotest server requires the Apache HTTP Server.  No additional configuration is required, autotest provides a {{filename|/etc/httpd/conf.d/autotest.conf}} configuration file.
 
<ol>
# Start httpd: <pre># service httpd restart</pre>
<li> Start httpd:<br>
# Configure httpd to start on system boot: <pre># chkconfig httpd on</pre>
<pre>systemctl start httpd.service</pre>
</li>
<li>Configure httpd to start on system boot: <pre>systemctl enable httpd.service</pre></li>
</ol>


== mysql ==
== mysql ==
Line 64: Line 52:
If you are using an existing mysql-server, you may skip this section.
If you are using an existing mysql-server, you may skip this section.


# Install and setup mysql server
<ol>
#: <pre>
<li>Setup mysql server
#: # yum install mysql-server
<pre>systemctl enable mysqld.service</pre>
#: # chkconfig mysqld on
<pre>systemctl start mysqld.service</pre>
#: # service mysqld start</pre>
</li>
# Setup a password for the ''root'' database user.  Please use a password other than ''NEWPASSWORD''.
<li>Setup a password for the ''root'' database user.  Please use a password other than ''NEWPASSWORD''.
#: <pre>
<pre>mysqladmin -u root password NEWPASSWORD</pre>
#: # mysqladmin -u root password NEWPASSWORD</pre>
</li></ol>


=== Tables and priveleges ===
=== Tables and privileges ===


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


# Using the {{command|mysql}} command, login to the root database using the password specified above
<ol><li>Using the {{command|mysql}} command, login to the root database using the password specified above
#: <pre>
<pre>mysql -u root -p</pre>
#:$ mysql -u root -p</pre>
</li><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 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''.
<pre>create database autotest_web;
#: <pre>
grant all privileges on autotest_web.* TO 'autotest'@'localhost' identified by 'NEWPASSWORD';
#: create database autotest_web;
grant SELECT on autotest_web.* TO 'nobody'@'%';
#: grant all privileges on autotest_web.* TO 'autotest'@'localhost' identified by 'NEWPASSWORD';
grant SELECT on autotest_web.* TO 'nobody'@'localhost';
#: grant SELECT on autotest_web.* TO 'nobody'@'%';
flush privileges;</pre>
#: grant SELECT on autotest_web.* TO 'nobody'@'localhost';
</li></ol>
#: flush privileges;</pre>
 
# 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''.
{{anchor|autotest}}
#: <pre>
#: 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;</pre>


== autotest ==
== autotest ==
Line 99: Line 81:
With the mysql database configured, it's time to tell autotest how to connect, and to pre-populate the database with initial data.
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 {{filename|/usr/share/autotest/global_config.ini}} and {{filename|/usr/share/autotest/shadow_config.ini}}, changing the values for ''password'', ''hostname'' and ''notify_email''.
<onlyinclude>
# Setup the database schemas and populate initial data
<ol>
#: <pre>
<includeonly><li>Examine the autotest configuration file {{filename|/usr/share/autotest/global_config.ini}} to determine whether updates are required</includeonly>
#: # python /usr/share/autotest/database/migrate.py --database=AUTOTEST_WEB sync
<noinclude><li>Update the autotest configuration file {{filename|/etc/autotest/global_config.ini}}
#: # python /usr/share/autotest/database/migrate.py --database=TKO sync</pre>
  <ul>
# Run the Django syncdb operation
    <li>In section <code>[AUTOTEST_WEB]</code>:
#: <pre>
      <ul>
#: # /usr/share/autotest/frontend/manage.py syncdb --noinput</pre>
        <li>Enter the correct value for <code>password</code>.</li>
# Restart httpd to
        <li>Set appropriate value for <code>job_max_runtime_hrs_default</code>, the maximum number of hours a single test can run before it is aborted. The recommended value for AutoQA purposes is <code>2</code>, but we currently use <code>10</code> because of [https://github.com/autotest/autotest/issues/117 autotest bug 117].</li>
#: <pre>
      </ul>
#: $ service httpd restart</pre>
    </li>
# Make sure that current database users have admin privileges
    <li>In section <code>[SERVER]</code>, set the value of <code>hostname</code></li>
#: <pre>
  </ul>
#: # mysql -u root -p -e 'update autotest_web.auth_user set is_superuser=1;'</pre>
</li>
<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.
<pre>setenforce permissive
vim /etc/sysconfig/selinux  # set SELINUX=permissive
</pre>
</li></noinclude>
<includeonly>
<li>Stop httpd <pre>service httpd stop</pre>
<li> Stop the autotest scheduler <pre>service autotestd stop</pre></li>
</includeonly>
<li> Setup the database schemas and populate initial data
<pre>autotest-upgrade-db sync</pre>
</li><li> Run the Django syncdb operation. This needs to be run twice, otherwise ''debug_user'' won't have access to the Django administrative interface.
<pre>
autotest-manage-rpc-server syncdb --noinput
autotest-manage-rpc-server syncdb --noinput
</pre>
</li><li> Restart httpd <pre>systemctl restart httpd.service</pre>
</li><li> Start the autotest scheduler <pre>systemctl start autotestd.service</pre>
</li><li> If you want to have autotest scheduler automatically started on machine boot, run one more command: <pre>systemctl enable autotestd.service</pre></li>
</ol>
</onlyinclude>
 
Congratulations! Your autotest server should be up and running. Direct your web browser to http://localhost.
 
= Package upgrade =
 
When upgrading to a newer {{package|autotest|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 {{package|autotest|autotest-server}} package.
 
{{:Install_and_configure_autotest}}
 
= Maintenance =
 
== Removing old results ==
 
Depending on how you use autotest, the {{filename|results/}} 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|tmpwatch}} command to remove results that meet certain criteria.  For example, to remove test results older than ''60 days'', the following {{command|tmpwatch}} command can be used.
<pre>
/usr/sbin/tmpwatch --dirmtime -m -f 60d /var/lib/autotest/results/ -X README
</pre>
or in case of version lower than 0.14
<pre>
/usr/sbin/tmpwatch --dirmtime -m -f 60d /usr/share/autotest/results/ -X README
</pre>


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


[[Category:AutoQA]]
[[Category:AutoQA]]

Latest revision as of 11:16, 29 November 2012

QA.png


This page details installing and configuring Package-x-generic-16.pngautotest-server.

Package installation

Use the yum command to install autotest and it's dependencies.

 yum install autotest-server

The web interface is available in autotest-web package. Due to unpackaged dependencies (Google Web Toolkit), this package is not packaged in Fedora, but it is available in the AutoQA repository:

Setup the required package repositories.

  1. 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).
  2. If using RHEL or CentOS, enable EPEL by following the instructions at EPEL/FAQ#howtouse
  3. Add the same repositories as mentioned in the AutoQA installation guide.

Finally, install the package:

 yum install autotest-web

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.

  1. Start httpd:
    systemctl start httpd.service
  2. Configure httpd to start on system boot:
    systemctl enable httpd.service

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. Setup mysql server
    systemctl enable mysqld.service
    systemctl start mysqld.service
  2. Setup a password for the root database user. Please use a password other than NEWPASSWORD.
    mysqladmin -u root password NEWPASSWORD

Tables and privileges

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 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;

autotest

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


  1. Update the autotest configuration file /etc/autotest/global_config.ini
    • In section [AUTOTEST_WEB]:
      • Enter the correct value for password.
      • Set appropriate value for job_max_runtime_hrs_default, the maximum number of hours a single test can run before it is aborted. The recommended value for AutoQA purposes is 2, but we currently use 10 because of autotest bug 117.
    • In section [SERVER], set the value of hostname
  2. 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
    
  3. Setup the database schemas and populate initial data
    autotest-upgrade-db sync
  4. Run the Django syncdb operation. This needs to be run twice, otherwise debug_user won't have access to the Django administrative interface.
    autotest-manage-rpc-server syncdb --noinput
    autotest-manage-rpc-server syncdb --noinput
    
  5. Restart httpd
    systemctl restart httpd.service
  6. Start the autotest scheduler
    systemctl start autotestd.service
  7. If you want to have autotest scheduler automatically started on machine boot, run one more command:
    systemctl enable autotestd.service


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

Package upgrade

When upgrading to a newer Package-x-generic-16.pngautotest-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 Package-x-generic-16.pngautotest-server package.


  1. Examine the autotest configuration file /usr/share/autotest/global_config.ini to determine whether updates are required
  2. Stop httpd
    service httpd stop
  3. Stop the autotest scheduler
    service autotestd stop
  4. Setup the database schemas and populate initial data
    autotest-upgrade-db sync
  5. Run the Django syncdb operation. This needs to be run twice, otherwise debug_user won't have access to the Django administrative interface.
    autotest-manage-rpc-server syncdb --noinput
    autotest-manage-rpc-server syncdb --noinput
    
  6. Restart httpd
    systemctl restart httpd.service
  7. Start the autotest scheduler
    systemctl start autotestd.service
  8. If you want to have autotest scheduler automatically started on machine boot, run one more command:
    systemctl enable autotestd.service


Maintenance

Removing old results

Depending on how you use autotest, the results/ 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 tmpwatch command to remove results that meet certain criteria. For example, to remove test results older than 60 days, the following tmpwatch command can be used.

/usr/sbin/tmpwatch --dirmtime -m -f 60d /var/lib/autotest/results/ -X README

or in case of version lower than 0.14

/usr/sbin/tmpwatch --dirmtime -m -f 60d /usr/share/autotest/results/ -X README