Yes, I understand now. But KVM is not a suitable solution in our test environment. So I plan to add one command in lava dispatcher to call the local python script (Appium/Robotium) to communicate with the DUT. And if I do so, the problem should be the parse of the test results.

Now we use Jenkins to auto-build the source image, and is it possible to receive the email send by Jenkins to start one test Job in LAVA? Otherwise, I can write a script to retrieve the content of the email, and then use "lava sumit-job" to start one test job.


发件人: "Neil Williams";<neil.williams@linaro.org>;
发送时间: 2016年2月1日(星期一) 晚上7:08
收件人: "wangbo"<wangbo.hfut@qq.com>;
抄送: "Lava Users Mailman list"<lava-users@lists.linaro.org>;
主题: Re: Forward of moderated message

On 1 February 2016 at 10:59, wangbo <wangbo.hfut@qq.com> wrote:
> Hi Neil,
>
> After review the test-definition in git.linaro.org/qa/test-definitions.git,
> we can define a job to test the android image and run the python code to
> communicate with the DUT, for example use one KVM as the host to run the
> python code, and one DUT as the target to be tested. In such condition, we
> don't use the python environment in the dispatcher, is it right?

Yes, using KVM and multinode means that you do not use the python
environment on the dispatcher. The python script then runs in a python
environment which you define, inside the KVM. You need to make sure
either that this image has any python dependencies pre-installed or
that the necessary python support is installed before the script runs.

>  And of
> course we can't use python script in the Job/YAML to test the DUT.

Not unless you have a way of deploying the python interpreter as part
of your test or part of the image.

Your tests in the KVM need to use ADB to run tasks on the DUT.

> Thanks.
>
> 发件人: "wangbo";<wangbo.hfut@qq.com>;
> 发送时间: 2016年2月1日(星期一) 下午5:01
> 收件人: "Neil Williams"<neil.williams@linaro.org>;
> 抄送: "Lava Users Mailman list"<lava-users@lists.linaro.org>;
> 主题: 回复: Forward of moderated message
>
> Hi Neil,
>
> But the problem is I want to define a job and use python script to
> communicate with the Android DUT, for example I want to use script.py in
> dispatcher to control the DUT. And the "lava_test_shell" will copy all these
> commands in steps to run.sh.
>
> # test_script.yaml
> run:
>     steps:
>         - echo "hello world"
>         - ./android/script/script.py
>
> # run.sh in DUT
> ###default parameters from yaml###
> ######
> ###test parameters from json###
> ######
> ###other parameters###
> LAVA_SERVER_IP='172.16.117.50'
> TARGET_TYPE='android'
> ######
> set -e
> export TESTRUN_ID=python
> cd /data/local/tmp/lava-mstar01/tests/0_c7a6f9e0-ae70-4d8b-8c06-f6da04b7a26c
> UUID=`cat uuid`
> echo "<LAVA_SIGNAL_STARTRUN $TESTRUN_ID $UUID>"
> #wait for an ack from the dispatcher
> read
> echo "hello world"
> ./android/script/script.py
> echo "<LAVA_SIGNAL_ENDRUN $TESTRUN_ID $UUID>"
> #wait for an ack from the dispatcher
> read

Just for clarity and for others reading the list, this is a run.sh as
generated by LAVA. Do not use LAVA_SIGNAL in test scripts.

--

Neil Williams
=============
neil.williams@linaro.org
http://www.linux.codehelp.co.uk/