Meego Wiki
Views

Quality/QA-tools/OTS/UserDocumentation/Installation

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(fixed example config file to avoid copypaste errors)
Line 1: Line 1:
-
== Installation Instructions for OTS 0.1 ==
+
= OTS Setup =
-
These instructions have been tested with Ubuntu 10.04.
+
== Used hardware ==
-
=== Network Setup ===
+
:1 x Server (Ubuntu 10.10)
 +
:1 x Client (Ubuntu 10.10)
 +
::1 x HAT controller
 +
:: 1 x Power cable
 +
:: 1 x Power supply
 +
:: 2 x USB A-B cable
 +
:: 1 x USB A-microB cable
 +
:: 1 x N900
 +
 
 +
== Network Setup ==
Using static IP addresses on all OTS machines is strongly recommended. It is possible to setup the system also with dynamic IP addresses but it might cause problems every now and then because IP's and hostnames change.
Using static IP addresses on all OTS machines is strongly recommended. It is possible to setup the system also with dynamic IP addresses but it might cause problems every now and then because IP's and hostnames change.
Line 9: Line 18:
All OTS machines need to be able to access other OTS machines based on their hostname.
All OTS machines need to be able to access other OTS machines based on their hostname.
-
=== Server ===
+
== Preparation ==
-
==== prerequisites ====
+
There are two ways of getting OTS binary packages: from '''the source code'''
 +
or from the '''MeeGo Tools:Testing repository'''. From the repository you can get
 +
the stable version and from the source code the development version.
-
* An smtp server is needed for OTS to be able to send result emails.
+
* Add Tools:Testing apt source to /etc/apt/sources.list
-
** You can use the smtp server provided by your ISP or organization
+
sudo nano /etc/apt/sources.list
-
** Or you can setup your own. for example [http://my.opera.com/Contrid/blog/show.dml/478684 postfix]
+
deb http://download.meego.com/live/Tools:/Testing/xUbuntu_10.10/ /
 +
Notice that if you are using Ubuntu 10.04, change the path.
-
==== Basic Setup ====
+
* Add repository keys
 +
gpg --keyserver subkeys.pgp.net --recv-keys 0BC7BEC479FC1F8A
 +
gpg --export --armor 0BC7BEC479FC1F8A | sudo apt-key add -
-
* Download and install RabbitMQ server from http://www.rabbitmq.com/server.html
+
* Update the repositories
-
 
+
-
* Install dependencies from ubuntu repository:
+
  sudo apt-get update
  sudo apt-get update
-
sudo apt-get install python-setuptools python-amqplib python-django
 
-
* Install rest of the dependencies with easy_install:
+
'''Build packages from source (optional)'''
-
  sudo easy_install minixsv
+
* Install git core
 +
  sudo apt-get install git-core
-
* Get source code from http://meego.gitorious.org/meego-quality-assurance/ots/ (latest tag)
+
* Get sources
 +
git clone git://gitorious.org/meego-quality-assurance/ots.git
-
* Install ots.common:
+
* Get building tools
-
cd ots/ots.common/
+
  sudo apt-get install dpkg-dev debhelper python-setuptools
-
  sudo python setup.py install
+
-
* Install ots.server:
+
* Build packages
-
  cd ots/ots.server/
+
  cd ots
-
  sudo python setup.py install
+
  dpkg-buildpackage -rfakeroot
-
* Install ots.tools: (Required only for triggering testruns easily from command line over xmlrpc)
+
== OTS server installation ==
-
cd ots/ots.tools/
+
-
sudo python setup.py install
+
-
* Download and install test definition schema files from http://meego.gitorious.org/meego-quality-assurance/test-definition
+
* Install dependencies
 +
sudo apt-get install python-django python-amqplib python-configobj rabbitmq-server test-definition
-
* Create a directory for testrun logs and make sure the user running ots.server has write permissions to it:
+
* Install OTS server components
-
  sudo mkdir /var/log/ots
+
  sudo apt-get install python-ots-common python-ots-results python-ots-server
 +
Or if you are using own built packages
 +
sudo dpkg -i ...
-
* At this point it should be possible to trigger testruns from python shell if you have a worker already set up and configured to use this server. Here's an example ipython session:
+
* Configure OTS server settings
-
<pre>
+
sudo nano /etc/ots_server.ini
-
In [1]: from ots.server.xmlrpc.public import request_sync
+
-
In [4]: program = "example_sw_product"
+
Recommended to change following:
 +
'example_sw_product', example to 'meego_product'
 +
'devicegroup', example to 'meego_n900'
-
In [5]: request = "5"
+
* Install OTS server plug-ins
 +
[http://wiki.meego.com/Quality/QA-tools/OTS/Plugins/HTTP_logger Logger plug-in] (recommended)
-
In [6]: notify_list = ['tvainio@localhost']
+
See more plug-ins from [http://wiki.meego.com/Quality/QA-tools/OTS/Plugins OTS Plug-ins]
-
In [7]: options = dict()
+
* If logger plug-in is installed
 +
Change permissions to logging directory
 +
sudo chown www-data:www-data /var/log/ots
-
In [8]: options['image'] = "http://somewhere/some_image.bin"
+
Now the OTS server can be used via apache (django_xmlrpc).
-
In [9]: options['email'] = "off"
+
* If logger plug-in is not installed
 +
Change user permissions to logging directory
 +
sudo chown <user>:<group> /var/log/ots
-
In [13]: options["device"] = "devicegroup:default"            # Make this match the worker
 
-
 
-
In [14]: request_sync(program, request, notify_list, options)
 
-
Out[14]: 'FAIL'
 
-
</pre>
 
-
 
-
The result will be PASS/FAIL/ERROR. ERROR means that something went wrong in server side and testrun was not even started. FAIL means failed testrun and PASS means that everything went fine and all tests passed. Testrun logs with more information about the possible errors are available in /var/log/ots/
 
-
 
-
==== Configuring the Server ====
 
-
 
-
The previous example was not very useful. To get OTS server running as a real server you have two options. A simple xmlrpc server or a more advanced django based server. First thing you need to do is setup a custom config file.
 
-
 
-
===== Custom Config File =====
 
-
 
-
Ots server tries to import a configuration module ots_extensions.ots_config. If it does not succeed it uses the default from ots.server.testrun_host.default_ots_config. You can set up your own ots_config by following these instructions:
 
-
 
-
* Create a directory for your extensions:
 
-
mkdir my_ots_extensions
 
-
 
-
* Add it to your python path
 
-
export PYTHONPATH=/full/path/to/my_ots_extensions/:$PYTHONPATH
 
-
 
-
* Create custom ots_extensions python package:
 
-
mkdir my_ots_extensions/ots_extensions
 
-
touch my_ots_extensions/ots_extensions/__init__.py
 
-
 
-
* Copy the default config file from ots/ots.server/ots/server/testrun_host/default_ots_config.py to my_ots_extensions/ots_extensions/ots_config.py
 
-
 
-
* Modify the file to suit your needs. Check at least the following settings:
 
-
** Email settings (The smtp server OTS uses to send testrun results)
 
-
** xmlrpc server config (if you are setting the simple xmlrpc server setup. More info below.)
 
-
** The default options for your sw product:
 
-
You can define default values for all options here. The example_sw_product contains and example how to define options. You cannot use an sw_product if it does not contain the default options in ots_config. Here's a small example. I'm developing a Meego based coffeemaker and creating custom software images for it. To automate the testing I create an sw_product called "my_meego_variant":
 
-
'''TODO: Document all options'''
 
-
<pre>
 
-
#
 
-
# Defaults for my_meego_variant                           
 
-
#                                                                                                                                 
 
-
 
-
# Lets start with the global_defaults
 
-
default_options["my_meego_variant"] = global_defaults.copy()
 
-
 
-
# The images work only on meego coffeemakers so the default devicegroup will be "meego_coffeemaker"
 
-
default_options["my_meego_variant"]['device'] = {'devicegroup':'meego_coffeemaker'}
 
-
 
-
# Coffeemaker needs to be fast so we define a 3 minutes global timeout for the test execution.
 
-
default_options["my_meego_variant"]['timeout'] = 3
 
-
</pre>
 
-
 
-
===== Extension Points =====
 
-
 
-
OTS uses plugins to do various things during the testrun. You can write your own plugins to add more functionality by implementing a module ots_extensions.extension_points. An example file can be found from ots/ots.server/ots/server/testrun_host/example_extension_points.py
 
-
 
-
==== Simple XMLRPC Server ====
 
-
 
-
* After you have implemented your custom config file and defined suitable xmlrpc_host and xmlrpc_port values you can start the simple xmlrpc server:
 
  ots_server
  ots_server
-
* After that you can start testruns on your ots_server by calling the request_sync() method over xmlrpc just like we did locally in the example above. There's also a command line tool called ots_trigger in ots.tools package.
+
== OTS worker installation ==
-
* A testrun can be triggered from command line with ots_trigger:
+
* Install dependencies
 +
sudo apt-get install python-amqplib testrunner-lite
-
  ots_trigger -s your_xmlrpc_host:your_xmlrpc_port -b 333 -i url_to_dummyimage -p my_meego_variant -e your_email_address
+
* Install OTS worker packages
 +
  sudo apt-get install python-ots-common python-ots-worker
-
The result should be FAIL and if your email server settings are correct you should also receive an email.
+
* Configure OTS worker settings
 +
sudo nano /etc/ots.ini
-
* If we look into the new testrun log file in /var/log/ots/ we should find something like this:
+
Change 'devicegroup', example meego_n900
-
<pre>
+
Change 'host' to server's address
-
2010-09-24 15:48:21,188  conductorengine ERROR    Device group 'meego_coffeemaker' does not exist
+
-
Traceback (most recent call last):
+
-
  File "/usr/local/lib/python2.6/dist-packages/ots.server-0.1dev-py2.6.egg/ots/server/conductorengine/conductorengine.py", line 150, in execute
+
-
    self._taskrunner.run()
+
-
  File "/usr/local/lib/python2.6/dist-packages/ots.server-0.1dev-py2.6.egg/ots/server/distributor/taskrunner.py", line 417, in run
+
-
    (self._routing_key))
+
-
OtsQueueDoesNotExistError: No queue for meego_coffeemaker
+
-
</pre>
+
-
* Next step is to set up an OTS worker into the devicegroup meego_coffeemaker. Instructions can be found below.
+
* Change permissions to OTS worker log
-
 
+
  sudo chown <user>:<group> /var/log/ots.log
-
==== Django Based Server ====
+
-
 
+
-
With Django and Apache it's possible to set up a more advanced ots server.
+
-
 
+
-
There's for example a global logger application available in ots.server.logger. By setting up the logger it is possible to get log messages for a specific testrun from all parts of the system (ots server, ots conductor and testrunner-lite). The logs are stored into database and can be accessed with a web UI. It's also easy to implement a result db and web views for the test results.
+
-
 
+
-
If you are not familiar with Django you can study the basics from the tutorial: http://docs.djangoproject.com/en/1.2/intro/tutorial01/
+
-
 
+
-
These instructions assume that you have already done the setup described in: [[http://wiki.meego.com/Quality/QA-tools/OTS/UserDocumentation/Installation#Server]]
+
-
 
+
-
There is an example django project in ots.server.django_ots. It is possible to use that directly but in most cases you should create your own django project to be able to modify the settings.
+
-
 
+
-
===== Installation Using the Default Django Project in ots.server.django_ots =====
+
-
 
+
-
* Install required packages:
+
-
<pre>
+
-
sudo apt-get update
+
-
sudo apt-get install python-django python-setuptools rabbitmq-server python-amqplib
+
-
</pre>
+
-
 
+
-
* Install django-xmlrpc from https://launchpad.net/django-xmlrpc to somewhere in your pythonpath
+
-
 
+
-
* After that you should be able to execute tests for the ots django applications:
+
-
<pre>
+
-
python ots/server/django_ots/manage.py test logger testrun_db
+
-
</pre>
+
-
 
+
-
* Create the database. The default ots django project uses sqlite. The DB file is located in /opt/ots.sqlite.
+
-
<pre>
+
-
python ots/server/django_ots/manage.py syncdb
+
-
</pre>
+
-
 
+
-
The script asks about creating a superuser for the Django's auth system. OTS does not use the auth system at the moment but it might be useful to create the account if you start writing custom django applications or want to use django admin interface at some point.
+
-
 
+
-
If you get errors like "unable to open database file" make sure your user has write permissions to /opt/
+
-
 
+
-
* Install apache and mod-python: (OTS requires the prefork version of apache)
+
-
 
+
-
  sudo apt-get install apache2-mpm-prefork libapache2-mod-python
+
-
 
+
-
* Setup your custom ots_config and extension points
+
-
** Instructions are available in [[http://wiki.meego.com/Quality/QA-tools/OTS/UserDocumentation/Installation#Configuring_the_Server]]
+
-
** Use ots/server/django_ots/extension_points.py as the basis of your extension points. It takes the testrun_db into use.
+
-
** Changes http_loggin_enabled to True in your ots_config.py if you want to have global testrun logs:
+
-
http_logging_enabled = True
+
-
 
+
-
* Configure your django_ots to /etc/apache2/apache2.conf by adding the following:
+
-
 
+
-
<pre>
+
-
<Location "/">
+
-
SetHandler python-program
+
-
PythonHandler django.core.handlers.modpython
+
-
SetEnv DJANGO_SETTINGS_MODULE ots.server.django_ots.settings
+
-
PythonDebug On
+
-
PythonPath "['ADD HERE THE PATH WHERE YOUR ots_extensions directory with CUSTOM OTS ENTRYPOINTS AND CONFIGFILE CAN BE FOUND'] + sys.path"
+
-
</Location>
+
-
</pre>
+
-
 
+
-
* Open http://localhost/logger/view/ in your web browser. You should see an empty logging message page.
+
-
** If you get "Unable to open database file" make sure that the user apache is running on has read and write permissions to the db file (/opt/ots.sqlite).
+
-
* Try triggering a testrun with ots_trigger (note the /xmlrpc in server url):
+
-
ots_trigger -s localhost/xmlrpc -b 333 -i url_to_dummyimage -p my_meego_variant -e your_email_address
+
-
 
+
-
If everything went ok you should see a succesful testrun and logs from OTS server, OTS Worker.conductor and testrunner-lite appearing in the http://localhost/logger/view/ and http://localhost/logger/view/ots/<your_testrun_id>/
+
-
 
+
-
If you only see log messages from your server most probably yuor hostnames are not set up correctly. The worker machine needs to be able to access the server by it's host name. Or you can try to play around with the "results_storage_config["host"]" setting in ots_config.py. It is the hostname ots_server sends to worker to use for global logging.
+
-
 
+
-
===== Installation Using a Custom Django Project =====
+
-
 
+
-
If you want to use different django setup you can create a custom django project. You can use ots/server/django_ots/ as an example. Django documentation contains lots of information about the features and settings: http://www.djangoproject.com/
+
-
 
+
-
The most important files are:
+
-
* settings.py - DB settings, installed django applications, email etc.
+
-
* urls.py - Url mappings. For example the "xmlrpc/" url is defined here.
+
-
 
+
-
You also need to modify your apache configuration to point to your own django project instead of the default one. Also note that if you change your code, mod_python does not automatically reload the changed code so you need to restart apache to make sure you are using the right version of your code. If you do a full apache restart all ongoing testruns will fail. If you do a graceful restart (<code>"apache2ctl graceful"</code>)the testruns won't fail but updated code is reloaded only after the testruns have fininshed.
+
-
 
+
-
==== Uploading Results to Meego QA Reports Tool ====
+
-
 
+
-
Starting from version 0.1.6 OTS can automatically upload results to Meego QA Reports tool.
+
-
 
+
-
* Make sure ots.qareports_plugin is installed.
+
-
* Modify values in /etc/ots_qareports_plugin.conf to match your setup:
+
-
 
+
-
<pre>
+
-
# More information about the options is available in
+
-
# http://wiki.meego.com/Quality/QA-tools/QAReports/API
+
-
 
+
-
[ots.qareports_plugin]
+
-
host = "localhost"
+
-
url = "/api/import"
+
-
auth_token = ""
+
-
release_version = "1.0"
+
-
target = "Core"
+
-
testtype = "Acceptance"
+
-
hwproduct = "N900"
+
-
</pre>
+
-
 
+
-
* Modify "get_resultbackends()" in your custom extension_points.py to take QaReportsBackend into use:
+
-
 
+
-
<pre>
+
-
from ots.qareports_plugin.qareports_backend import QAReportsBackend
+
-
 
+
-
 
+
-
def get_resultbackends(testrun):
+
-
    """Returns custom ResultBackends as a list"""
+
-
    return [QAReportsBackend()]
+
-
</pre>
+
-
===== Dynamic Report Control =====
+
-
 
+
-
Starting from OTS 0.1.7 it's possible to control reporting options dynamically when triggering a testrun with "--options" command line parameter in ots_trigger:
+
-
<pre>
+
-
ots_trigger --options="qa_hwproduct:<HWPRODUCT> qa_testtype:<TESTTYPE> qa_target:<TARGET> qa_release_version:<RELEASE_VERSION>"
+
-
</pre>
+
-
 
+
-
=== Worker ===
+
-
 
+
-
* Install dependencies:
+
-
sudo apt-get update
+
-
sudo apt-get install python-setuptools python-amqplib
+
-
* Get source code from http://meego.gitorious.org/meego-quality-assurance/ots/ (latest tag)
+
* Start OTS worker
 +
ots_worker
-
* Install ots.common:
+
== OTS tools ==
-
cd ots/ots.common/
+
-
sudo python setup.py install
+
-
* Install ots.worker:
+
Tools are used for triggering test runs from the command line.
-
cd ots/ots.worker/
+
-
sudo python setup.py install
+
-
* Configure the worker by editing devicegroup and server address in /etc/ots.ini:
+
* Install OTS tools
-
<pre>
+
sudo apt-get install python-ots-tools
-
###########################################
+
-
# REPLACE `fix_me` WITH YOUR DEVICEGROUP
+
-
###########################################
+
-
[Device]
+
-
# Change this to the devicegroup this worker belongs to
+
-
devicegroup = fix_me
+
-
#############################
+
* Trigger a test run
-
# Optional device properties
+
ots_trigger -s localhost/xmlrpc -b test_build -i http://url_to_image -p example_sw_product -e test@man.com
-
#############################
+
-
# Uncomment these if you want more detailed testrun routing
+
* Kickstart file for automation can be found from
-
# See http://wiki.meego.com/Quality/QA-tools/OTS/Routing for details
+
http://meego.gitorious.org/meego-quality-assurance/enables-automated-testing/blobs/ks/meego-n900-autotest.ks
-
#devicename = name of the device type
+
* You need to build the image with mic-image-creator with parameters:
-
#deviceid = Specific HW id of the device
+
--save-kernel --package=tar.gz
-
#############################
+
== How to install N900 automation tools to OTS worker ==
-
# ADVANCED CONFIGURATION
+
-
#############################
+
-
[Worker]
+
-
# Change this to your ots server address
+
-
host = your_server_address
+
-
vhost = /
+
-
port = 5672
+
-
username = guest
+
-
password = guest
+
-
log_file = /var/log/ots.log
+
-
</pre>
+
-
More info about testrun routing is available here: [[Quality/QA-tools/OTS/Routing]]
+
* Install dependencies
 +
sudo apt-get install meego-ai-flaster eat-host-ubuntu
 +
 +
* Get N900 flasher from the Nokia's tablets-dev portal
 +
http://tablets-dev.nokia.com/maemo-dev-env-downloads.php?f=maemo_flasher-3.5_2.5.2.2_i386.deb
 +
sudo dpkg -i maemo_flasher-3.5_2.5.2.2_i386.deb
-
* Start the worker:
+
* Configure conductor to use rpm and fetch /var/log/messages
 +
sudo nano /etc/conductor.conf
-
  sudo ots_worker
+
* If you want run ots_worker as user, copy SSH keys to the user and make udev rule for n900
 +
mkdir ~/.ssh
 +
  sudo cp /root/.ssh/config ~/.ssh
 +
sudo cp /root/.ssh/id_eat_dsa ~/.ssh
 +
sudo chown <user> ~/.ssh/*
 +
chmod 600 ~/.ssh/*
 +
sudo nano /etc/udev/rules.d/meego-n900.rules
 +
SUBSYSTEMS=="usb", ATTR{idVendor}=="0421", ATTR{idProduct}=="0105", GROUP="<group>", MODE="0664"
-
* If everything went ok, you should see something like this:
+
* Create a power_cycle.sh script for turning N900 on/off. This requires external accessory, like [http://wiki.meego.com/Quality/QA-tools/hat-control HAT]  
-
<pre>
+
sudo nano /usr/bin/power_cycle.sh
-
2010-11-08 12:55:10,790 - ots.worker.worker - DEBUG - Initialising the server
+
-
2010-11-08 12:55:10,790 - ots.worker.connection - DEBUG - Connecting to RabbitMQ
+
-
2010-11-08 12:55:10,894 - amqplib - DEBUG - Start from server, version: 8.0, properties: {u'platform': 'Erlang/OTP', u'product': 'RabbitMQ', u'version': '2.1.0', u'copyright': 'Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd.', u'information': 'Licensed under the MPL.  See http://www.rabbitmq.com/'}, mechanisms: ['PLAIN', 'AMQPLAIN'], locales: ['en_US']
+
-
2010-11-08 12:55:10,935 - amqplib - DEBUG - Open OK! known_hosts []
+
-
2010-11-08 12:55:10,935 - amqplib - DEBUG - using channel_id: 1
+
-
2010-11-08 12:55:10,937 - amqplib - DEBUG - Channel open
+
-
2010-11-08 12:55:10,938 - ots.worker.worker - DEBUG - Starting the worker. server: 192.168.1.102:5672, device_properties: {'devicegroup': 'meego_coffeemaker'}
+
-
2010-11-08 12:55:10,957 - ots.worker.task_broker - INFO - consume on queue: meego_coffeemaker
+
-
2010-11-08 12:55:10,958 - ots.worker.task_broker - DEBUG - Starting main loop...
+
-
</pre>
+
-
* There's also an init script available in ots.worker/debian/python-ots-worker.ots-worker.init to make running the worker easier
+
#!/bin/bash
 +
 +
hat_ctrl -pwr1=off
 +
hat_ctrl -usb1data=off
 +
hat_ctrl -usb1pwr=off
 +
sleep 2;
 +
hat_ctrl -usb1pwr=on
 +
hat_ctrl -usb1data=on
 +
hat_ctrl -pwr1=on
-
* After that the worker should be ready for receiving tasks. To make sure the actual test execution works please see the instructions for ots.worker.conductor: [[Quality/QA-tools/OTS/UserDocumentation/Conductor| Conductor]]
+
* Test manually that everything is OK, this is executed in the worker
 +
conductor -u <image url>

Revision as of 08:43, 28 January 2011

Contents

OTS Setup

Used hardware

1 x Server (Ubuntu 10.10)
1 x Client (Ubuntu 10.10)
1 x HAT controller
1 x Power cable
1 x Power supply
2 x USB A-B cable
1 x USB A-microB cable
1 x N900

Network Setup

Using static IP addresses on all OTS machines is strongly recommended. It is possible to setup the system also with dynamic IP addresses but it might cause problems every now and then because IP's and hostnames change.

All OTS machines need to be able to access other OTS machines based on their hostname.

Preparation

There are two ways of getting OTS binary packages: from the source code or from the MeeGo Tools:Testing repository. From the repository you can get the stable version and from the source code the development version.

  • Add Tools:Testing apt source to /etc/apt/sources.list
sudo nano /etc/apt/sources.list
deb http://download.meego.com/live/Tools:/Testing/xUbuntu_10.10/ /

Notice that if you are using Ubuntu 10.04, change the path.

  • Add repository keys
gpg --keyserver subkeys.pgp.net --recv-keys 0BC7BEC479FC1F8A
gpg --export --armor 0BC7BEC479FC1F8A | sudo apt-key add -
  • Update the repositories
sudo apt-get update

Build packages from source (optional)

  • Install git core
sudo apt-get install git-core
  • Get sources
git clone git://gitorious.org/meego-quality-assurance/ots.git
  • Get building tools
sudo apt-get install dpkg-dev debhelper python-setuptools
  • Build packages
cd ots
dpkg-buildpackage -rfakeroot

OTS server installation

  • Install dependencies
sudo apt-get install python-django python-amqplib python-configobj rabbitmq-server test-definition
  • Install OTS server components
sudo apt-get install python-ots-common python-ots-results python-ots-server

Or if you are using own built packages

sudo dpkg -i ...
  • Configure OTS server settings
sudo nano /etc/ots_server.ini

Recommended to change following:

'example_sw_product', example to 'meego_product'
'devicegroup', example to 'meego_n900'
  • Install OTS server plug-ins
Logger plug-in (recommended)

See more plug-ins from OTS Plug-ins

  • If logger plug-in is installed
Change permissions to logging directory
sudo chown www-data:www-data /var/log/ots

Now the OTS server can be used via apache (django_xmlrpc).

  • If logger plug-in is not installed
Change user permissions to logging directory
sudo chown <user>:<group> /var/log/ots
ots_server

OTS worker installation

  • Install dependencies
sudo apt-get install python-amqplib testrunner-lite
  • Install OTS worker packages
sudo apt-get install python-ots-common python-ots-worker
  • Configure OTS worker settings
sudo nano /etc/ots.ini

Change 'devicegroup', example meego_n900

Change 'host' to server's address

  • Change permissions to OTS worker log
sudo chown <user>:<group> /var/log/ots.log
  • Start OTS worker
ots_worker

OTS tools

Tools are used for triggering test runs from the command line.

  • Install OTS tools
sudo apt-get install python-ots-tools
  • Trigger a test run
ots_trigger -s localhost/xmlrpc -b test_build -i http://url_to_image -p example_sw_product -e test@man.com
  • Kickstart file for automation can be found from
http://meego.gitorious.org/meego-quality-assurance/enables-automated-testing/blobs/ks/meego-n900-autotest.ks
  • You need to build the image with mic-image-creator with parameters:
--save-kernel --package=tar.gz

How to install N900 automation tools to OTS worker

  • Install dependencies
sudo apt-get install meego-ai-flaster eat-host-ubuntu

  • Get N900 flasher from the Nokia's tablets-dev portal
http://tablets-dev.nokia.com/maemo-dev-env-downloads.php?f=maemo_flasher-3.5_2.5.2.2_i386.deb
sudo dpkg -i maemo_flasher-3.5_2.5.2.2_i386.deb
  • Configure conductor to use rpm and fetch /var/log/messages
sudo nano /etc/conductor.conf
  • If you want run ots_worker as user, copy SSH keys to the user and make udev rule for n900
mkdir ~/.ssh
sudo cp /root/.ssh/config ~/.ssh
sudo cp /root/.ssh/id_eat_dsa ~/.ssh
sudo chown <user> ~/.ssh/*
chmod 600 ~/.ssh/*
sudo nano /etc/udev/rules.d/meego-n900.rules
SUBSYSTEMS=="usb", ATTR{idVendor}=="0421", ATTR{idProduct}=="0105", GROUP="<group>", MODE="0664"
  • Create a power_cycle.sh script for turning N900 on/off. This requires external accessory, like HAT
sudo nano /usr/bin/power_cycle.sh
#!/bin/bash

hat_ctrl -pwr1=off
hat_ctrl -usb1data=off
hat_ctrl -usb1pwr=off
sleep 2;
hat_ctrl -usb1pwr=on
hat_ctrl -usb1data=on
hat_ctrl -pwr1=on
  • Test manually that everything is OK, this is executed in the worker
conductor -u <image url>
Personal tools