Opentest First Steps

= Background / Prerequisites =

This is a walkthrough of installing Opentest in a self-contained environment and then performing "hello world" style tests of Opentest to ensure that basic setup is functional. In certain places we note workaround that are required currently.

We assume that OpentestInstallation has been read or at least is available for reference while performing the install. Of special importance are the packages on host which must be installed prior to starting.

WORKAROUND: As currently software reset of the DUT is not functional, a supported power_controller for the board is required. In this example we are using a beaglebone so a [|Devantech Relay Controller] is used as that is most appropriate for a Beaglebone.

WORKAROUND: As currently linux-devtest.py supports only using an FTP BEE, we use the ftp server that Testlink installs.

= Installation =


 * In many parts of the install it will ask for subnets/locations of various services. In all cases, answer 127.0.0.1 or localhost
 * When in doubt, use the defaults. When no default is provided select a versioned root-directory such as /home/me/work/opentest/opentest-YY.MM herein refered to as 

Download latest opentest_installer*.tar.gz from http://arago-project.org/files/releases/opentest/ untar it, run it and then:
 * 1) Select 'all'.
 * 2) Note that during STAF installation, the version / location of perl/python/tcl isn't needed.
 * 3) When the TMC installation part comes up, select the exit option (we shall revisit this section of the installer later).
 * 4) As noted above, when installing BEEs you must select FTP as one of the ones to be installed.
 * 5) Select all when prompted for XAMP/Testlink.
 * 6) When configuring mysql DO NOT use root as the user to configure.
 * 7) Continue with the installer until it brings you back to the main menu.
 * 8) Select Commandline Tools, install
 * 9) Exit the installer.
 * 10) Run sudo /opt/lampp/lampp start
 * 11) In a web browser, open http:/localhost/testlink, login (the user/pass you used on mysql above) and click personal.
 * 12) Click on generate API key, note the key value for use in later steps
 * 13) Re-launch the opentest installer.
 * 14) Select TMC as the install option, enter the API key created in the previous step.
 * 15) Exit the installer as we are now complete.

WORKAROUND: The testscripts installation may not have happened. To fix this, where you said in the install testscripts should be installed: $ rmdir /path/to/testscripts $ git clone http://arago-project.org/git/projects/test-automation/execution-engines/vatf-scripts.git /path/to/testscripts

= Configuration =

When configuring systems it is important to note that board names are NOT freeform and need to have matching entries in (assuming default paths) /usr/local/vatf/source/target/linux/linux_equipment_driver.rb

Best Practices
Before getting into configuring the system itself and just after installation the following best practices are recommended.
 * Make a git repository out of .
 * Create a local tracking branch in /usr/local/vatf and manage your board-related modifications as local checkins.

Tips

 * /usr/local/vatf/source/target/linux/linux_equipment_driver.rb is the proper place to change default kernel arguments for your DUT.
 * /bench/ contains the bench file(s) for each TEE you have installed

General Configuration Steps
All ofthe following assume you are working from .


 * Edit client/config/site_info.xml
 * tms_url: http://localhost
 * tms_api_url: http://localhost/testlink/lib/api/xmlrpc.php
 * tms_devkey: KEY YOU GENERATED
 * tms_user: mysql user from above
 * tms_pswd: mysql pass from above
 * tmc_machine: 127.0.0.1
 * local_ftp_server_url: ftp://nobody:lampp@localhost/
 * Edit bench/NAME-YOU-SET-FOR-YOUR-TEE.rb
 * Assuming tftpd-hpa note that the default is /var/lib/tftpboot not /tftpboot
 * Edit dns_workaround.sh:
 * Add staf local var set shared var vatf@1/auto/tee/test_scripts_root="", see other variables that set test_scripts_root

= Testing =

After having installed Opentest and configured a DUT, both physically (cables, etc) and in the bench file (and confirmed that the assumptions in the vatf sources are also correct) it is important to test the framework itself before adding your own tests or software to test. The following steps assume a known working U-Boot/Kernel/rootfs are being passed so any issues would be related to Opentest. In all cases, we use linux-devtest.py and are located in /client. For more about using linux-devtest.py see OpentestOtherSrvLinuxDevtest.

Shell script
$ cat > foo.sh << EOF > true > EOF $ ./linux-devtest.py -hw beaglebone,linux -p /tmp/u-boot-spl.bin -b /tmp/u-boot.img  -k /tmp/uImage -d /tmp/am335x-bone.dtb \ -n 192.168.0.3:/home/trini/work/nfsroot/beaglebone -a "vatf@1 on 127.0.0.1" -s foo.sh
 * 1) !/bin/sh

LTP-DDT testplan
$ ./linux-devtest.py -hw beaglebone,linux -p /tmp/u-boot-spl.bin -b /tmp/u-boot.img  -k /tmp/uImage -d /tmp/am335x-bone.dtb \ -n 192.168.0.3:/home/trini/work/nfsroot/beaglebone -a "vatf@1 on 127.0.0.1" -t default

= General Tips =


 * In order to use staf you need to have loaded /usr/local/staf/STAFEnv.sh into your environment (not run).
 * At every boot you need to run:
 * sudo /opt/lampp/lampp start
 * /usr/local/staf/startSTAFProc.sh as the user that will run the services
 * /dns_workaround.sh again, as the suer that will run the services

You can most easily deal with this by adding the following crontab entry on the user that runs the services @reboot sudo /opt/lampp/lampp start @reboot /usr/local/staf/startSTAFProc.sh

WORKAROUND: You cannot invoke the /dns_workaround.sh via crontab and must run by hand.