-
Notifications
You must be signed in to change notification settings - Fork 0
Analysis
This document is quick start to setup separate TKO without AFE and scheduler. It works on Red Hat EL 5.2. Most of info here comes from AutotestServerInstall. For more details, please refer there.
Basically, TKO depends on Mysql, Apache and gnuplot. What we need to do is creating one mysql databases named "tko" and granting its privileges to a special user autotest. Tests results will be structured into tko database, then we can use cgi scripts to dynamically query the data. In addition, please make sure you set up apache to have appropriate aliases in Apache configuration, and to allow cgi scripts to be run.
-
Create autotest account
sudo adduser autotest cd /usr/local/ sudo mkdir autotest sudo chown autotest:autotest autotest su autotest
-
Checkout the full Autotest repository:
git clone git://github.com/autotest/autotest.git /usr/local/autotest
-
Set up MySQL. To get a mysql prompt, type
mysql -u root -p
. The following commands will set up mysql with a read-only user called nobody and a user with full permissions called autotest:create database autotest_web; grant all privileges on autotest_web.* TO 'autotest'@'localhost' identified by 'some_password'; grant SELECT on autotest_web.* TO 'nobody'@'%'; create database tko; grant all privileges on tko.* TO 'autotest'@'localhost' identified by 'some_password'; grant SELECT on tko.* TO 'nobody'@'%';
-
Edit
global_config.ini
to match the passwords you set earlier. -
Run DB migrations to set up DB schemas and initial data:
$cd /usr/local/autotest/tko && python ../database/migrate.py --database=TKO sync
-
In /etc/httpd/conf/httpd.conf, add this line
Include "/usr/local/autotest/apache/conf/tko-directives"
-
In /etc/httpd/conf/httpd.conf, un-comment this line out if it already exists:
AddHandler cgi-script .cgi
-
Make everything in the /usr/local/autotest directory world-readable, for Apache's sake:
#chmod -R o+r /usr/local/autotest #find /usr/local/autotest -type d | xargs chmod o+x #chmod o+x /usr/local/autotest/tko/*.cgi
-
Restart Apache server
service httpd restart
30 second orientation below:
- parse - the main script. "parse <top_level results dir>"
- parse.py - helper library for parsing.
- tko - name of the default database in mysql. Stands for "test.kernel.org", not "total knockout" ;-)
- ../database/migrate.py - database schemas and initial data
- ../global_config.ini - global configuration for autotest. You can specify host and database. Defaults to 'localhost' and 'tko'.
- ../shadow_config.ini - username and password for the backend (needs read/write tko database!).
- *.cgi - some fancy cgi scripts. machine_kernel.cgi is the main functional one and machine_benchmark.cgi the main perf one.
- frontend.py - Frontend classes for the database to make it easier to use. All the cgi scripts use this.
- display.py - draw coloured matrix tables, etc (see machine_kernel.cgi for example usage)
- plotgraph.py - python class to draw gnuplot scripts for you (see machine_test_attribute_graph.cgi for example usage)