Instructions here are taken from LavaTestTutorial as it is and slightly modified to help running Android tests in LAVA.

These steps should help you get an Android test running in LAVA in no time.

Installing Dependencies

The main thing you need for developing a test for LAVA is to extend the lava-android-test component with a thin wrapper around your existing test. We call this a "test definition". Installing lava-android-test for development can be done with:

# virtualenv provides a nice mechanism to use python code without making changes to the whole system.
apt-get install curl python-virtualenv python-pip python-keyring

# for ubuntu pre 12.04:
virtualenv lava-test-workspace

# for ubuntu 12.04
virtualenv --system-site-packages lava-test-workspace

# activate your workspace with:
. ./lava-test-workspace/bin/activate
cd lava-test-workspace

# download lava-test code and activate it in the virtual env
bzr branch lp:lava-android-test
cd lava-android-test
./setup.py develop

# you should now have lava-test in your virtual env, you can test with:
lava-android-test -h

Running An Android Test

# Get the list of pre-installed tests by running following command.
lava-android-test list-tests

# "install" the lava-android-test to be run on target device:
lava-android-test install busybox 

# run the test:
lava-android-test run busybox

# The final line to STDOUT will be something like:
#  ANDROID TEST RUN COMPLETE: Result id is 'busybox1339134818.0'
# You can now test your parser logic by using the parser command
lava-android-test parse [RESULT_ID from above] > ./tmp.json

# view the json to see if it looks correct:
cat tmp.json

# Output/result(pass|fail) should look like:
<snip>
      "test_results": [
        {
          "log_filename": "stdout.log", 
          "log_lineno": 1, 
          "test_case_id": "mkdir", 
          "result": "pass"
        }, 
        {
          "log_filename": "stdout.log", 
          "log_lineno": 2, 
          "test_case_id": "touch", 
          "result": "pass"
        }, 
        {
          "log_filename": "stdout.log", 
          "log_lineno": 3, 
          "test_case_id": "ls", 
          "result": "pass"
        }, 
        {
          "log_filename": "stdout.log", 
          "log_lineno": 4, 
          "test_case_id": "ps", 
          "result": "pass"
        }, 
        {
          "log_filename": "stdout.log", 
          "log_lineno": 5, 
          "test_case_id": "whoami", 
          "result": "pass"
        }, 
        {
          "log_filename": "stdout.log", 
          "log_lineno": 6, 
          "test_case_id": "which", 
          "result": "pass"
        }, 
        {
          "log_filename": "stdout.log", 
          "log_lineno": 7, 
          "test_case_id": "basename", 
          "result": "pass"
        }, 
        {
          "log_filename": "stdout.log", 
          "log_lineno": 8, 
          "test_case_id": "cp", 
          "result": "pass"
        }, 
        {
          "log_filename": "stdout.log", 
          "log_lineno": 9, 
          "test_case_id": "rm", 
          "result": "pass"
        }, 
        {
          "log_filename": "stdout.log", 
          "log_lineno": 10, 
          "test_case_id": "dmesg", 
          "result": "pass"
        }, 
        {
          "log_filename": "stdout.log", 
          "log_lineno": 11, 
          "test_case_id": "grep", 
          "result": "pass"
        }
<snip>

Sending Local Results To LAVA

TODO

Including Your Test In Daily Automation

TODO


CategoryHowTo

Platform/Validation/LAVA/LavaAndroidTestTutorial (last modified 2012-06-09 17:05:13)