Meego Wiki
Views

Quality/QA-tools/OTS/UserDocumentation/Conductor

From MeeGo wiki
< Quality | QA-tools | OTS | UserDocumentation(Difference between revisions)
Jump to: navigation, search
(Configuration Files)
 
(12 intermediate revisions not shown)
Line 1: Line 1:
== Conductor ==
== Conductor ==
-
 
-
=== Related Documentation ===
 
-
 
-
* [[Quality/QA-tools/OTS/Glossary]]
 
-
* [[Quality/QA-tools/Testrunner-lite]]
 
-
* [[Quality/QA-tools/Autotest-guide]]
 
=== Prerequisites ===
=== Prerequisites ===
Line 20: Line 14:
The URL in above command is ignored.
The URL in above command is ignored.
 +
 +
=== Images ===
 +
 +
The supported format for meego-ai-flasher is a tar.gz containing an image and a kernel. Ensure that the directory structure in meego_ai_conf is consistent with your tar.gz. So for:
 +
 +
 +
: meego_image.tar.gz
 +
:|
 +
:+--meego-image
 +
:::|
 +
:::+-my_kernel-vmlinuz-foo-bar
 +
:::|
 +
:::+-my_image-foo-bar.raw
 +
 +
 +
For example notice the inclusion of the sub directories...
 +
 +
<code>
 +
/tmp/n900/*/*mmcblk0p*
 +
/tmp/n900/*/*vmlinuz*
 +
</code>
 +
 +
... in flash_command and post_flash_command in this meego_ai_conf:
 +
 +
<code>
 +
flash_command: ls %s; IMAGE=$(ls /tmp/n900/*/*mmcblk0p*);sleep 5;dd if=${IMAGE} | nc6 192.168.2.15 500 -q 10:10; sleep 10; echo "/sbin/reboot -f" | nc 192.168.2.15 500
 +
flash_timeout: 1800
 +
post_flash_command: KERNEL=$(ls /tmp/n900/*/*vmlinuz*); /usr/bin/flasher-3.5 -b -l
 +
</code>
 +
 +
The conductor takes the image from a URL. If you are running this locally you'll need a webserver handy (For example [http://myy.helia.fi/~karte/install_apache_on_ubuntu.html apache on ubuntu])
=== Configuration Files ===
=== Configuration Files ===
-
Conductor's main configuration file is /etc/conductor.conf and it holds all parameters that are needed for execution. There's one parameter called 'custom_config_folder' (default value is /etc/conductor) in conductor.conf file which specifies directory where user can put optional configuration files (files must have '.conf' suffix). With optional configuration files one can extend list type parameters like 'pre_test_info_commands'. 'pre_test_info_commands_debian' and pre_test_info_commands_rpm'.
+
Conductor's main configuration file is
 +
/etc/conductor.conf
 +
 
 +
It holds all parameters that are needed for execution. There's one parameter called '''custom_config_folder''' (default value is /etc/conductor) in conductor.conf file which specifies directory where user can put optional configuration files (files must have '.conf' suffix). With optional configuration files one can extend list type parameters like 'pre_test_info_commands'. 'pre_test_info_commands_debian' and pre_test_info_commands_rpm'.
=== Custom Flasher ===
=== Custom Flasher ===
Line 38: Line 66:
Source code for OTS Worker includes a reference implementation for ''customflasher'' in [http://gitorious.org/qa-tools/ots/blobs/dev_branch_0.1/ots.worker/ots/worker/conductor/defaultflasher.py defaultflasher.py] file.
Source code for OTS Worker includes a reference implementation for ''customflasher'' in [http://gitorious.org/qa-tools/ots/blobs/dev_branch_0.1/ots.worker/ots/worker/conductor/defaultflasher.py defaultflasher.py] file.
 +
 +
==== Setting your USB permissions for Flashing ====
 +
 +
To avoid the need for sudo/root access when Flashing you need to set the USB permissions.
 +
 +
e.g. For an ubuntu hosted system
 +
 +
===== 1. Find the vendor and product id =====
 +
 +
e.g. For your Acme device
 +
 +
<code>
 +
$lsusb | grep Acme
 +
 +
Bus XXX Device XXX: ID <idVendor>:<idProduct> Acme Corp
 +
</code>
 +
 +
===== 2. Add new udev rule file =====
 +
 +
sudo nano /etc/udev/rules.d/meego-n900.rules
 +
 +
<code>
 +
SUBSYSTEMS=="usb", ATTR{idVendor}==<idVendor>, ATTR{idProduct}==<idProduct>, GROUP="<user's group>", MODE="0664"
 +
</code>
 +
 +
=== Related Documentation ===
 +
 +
* [[Quality/QA-tools/OTS/Glossary]]
 +
* [[Quality/QA-tools/Testrunner-lite]]
 +
* [[Quality/QA-tools/Autotest-guide]]

Latest revision as of 09:59, 3 February 2011

Contents

Conductor

Prerequisites

An environment described in Quality/QA-tools/Autotest-guide

Running tests manually from Worker PC

OTS Worker comes with a component named as Conductor. Conductor includes a command line interface that can be used to manually execute one or more test packages from Worker PC. The test result files are collected to a local folder (under ~/conductor/None) from where the user can examine them.

Here's an example how to process two test packages using Conductor from command line:

# sudo conductor -u http://my.build.host/image --dontflash -t mypackage1-tests,mypackage2-tests

The URL in above command is ignored.

Images

The supported format for meego-ai-flasher is a tar.gz containing an image and a kernel. Ensure that the directory structure in meego_ai_conf is consistent with your tar.gz. So for:


meego_image.tar.gz
|
+--meego-image
|
+-my_kernel-vmlinuz-foo-bar
|
+-my_image-foo-bar.raw


For example notice the inclusion of the sub directories...

/tmp/n900/*/*mmcblk0p*
/tmp/n900/*/*vmlinuz*

... in flash_command and post_flash_command in this meego_ai_conf:

flash_command: ls %s; IMAGE=$(ls /tmp/n900/*/*mmcblk0p*);sleep 5;dd if=${IMAGE} | nc6 192.168.2.15 500 -q 10:10; sleep 10; echo "/sbin/reboot -f" | nc 192.168.2.15 500
flash_timeout: 1800
post_flash_command: KERNEL=$(ls /tmp/n900/*/*vmlinuz*); /usr/bin/flasher-3.5 -b -l 

The conductor takes the image from a URL. If you are running this locally you'll need a webserver handy (For example apache on ubuntu)

Configuration Files

Conductor's main configuration file is

/etc/conductor.conf

It holds all parameters that are needed for execution. There's one parameter called custom_config_folder (default value is /etc/conductor) in conductor.conf file which specifies directory where user can put optional configuration files (files must have '.conf' suffix). With optional configuration files one can extend list type parameters like 'pre_test_info_commands'. 'pre_test_info_commands_debian' and pre_test_info_commands_rpm'.

Custom Flasher

Custom Flasher is a component responsible for setting up and preparing the test target for test execution from Worker PC. Typically this includes flashing the software image to hardware that is serving as the test target, and then booting up the hardware.

The user must implement his/her own Custom Flasher.

If Custom Flasher is not available at Worker PC, Worker skips the phase of preparing the test target. Typically this behaviour is useful only when running Conductor manually from command line (see above).

How To Add Support For Custom Test Target

The user must implement Python module customflasher and have it available in PYTHONPATH in Worker PC. In that module, the user can define all the steps and maneuvers that are necessary before his/her test target is ready for test execution. Customflasher is required to leave test target in such a state that establishing an SSH connection from Worker PC to the test target will succeed.

Source code for OTS Worker includes a reference implementation for customflasher in defaultflasher.py file.

Setting your USB permissions for Flashing

To avoid the need for sudo/root access when Flashing you need to set the USB permissions.

e.g. For an ubuntu hosted system

1. Find the vendor and product id

e.g. For your Acme device

$lsusb | grep Acme

Bus XXX Device XXX: ID <idVendor>:<idProduct> Acme Corp

2. Add new udev rule file

sudo nano /etc/udev/rules.d/meego-n900.rules

SUBSYSTEMS=="usb", ATTR{idVendor}==<idVendor>, ATTR{idProduct}==<idProduct>, GROUP="<user's group>", MODE="0664"

Related Documentation

Personal tools