Thanks Neil for such quick response!

 

The reason I am doing this is that I have some device-specific information and I need to pass this information to my test script. For example I have a device named demo-01 and the information maybe like “demo-production-123456” and I need to input that to my test script, which would be like: python test_runner.py –p demo-production-123456.

 

I am not sure where to save device information so I turned to add it into device dictionary of each device, but if there is a better way to do this, I would like to have a try. J I have read about ‘context’ in job submission but I found it is for modify properties in device dictionary.

 

Thanks for the documents about lava-target-mac and I will read your documents to see if I can came up with a good idea.

 

Thanks and Best Regards,

Yifan

 

From: Neil Williams [mailto:neil.williams@linaro.org]
Sent: Thursday, June 29, 2017 5:09 PM
To: Li, Yifan2 <yifan2.li@intel.com>
Cc: Lava-users@lists.linaro.org
Subject: Re: [Lava-users] Is it possible to get data in device dictionary inside a job?

 

On 29 June 2017 at 09:52, Li, Yifan2 <yifan2.li@intel.com> wrote:

Hello LAVA experts,

 

I am currently working with LAVA and was asked to find is there a way to get data from device dictionary inside a running job. Details like below:

I have a device name demo-01, and its device-dictionary have one line like “{% set my_property = ’my_prop’ %}”. Then I have a job running on demo-01 device, and I would like to use string ‘my_prop’ to passed into a script during running. Is it possible to get device-dictionary data directly from job definition(Job Submitter webpage) or test definition(yaml file)? If yes, how could I do this? If not, is there any good way you would like to share to solve this problem?

 

No, device configuration should generally not be available inside the test shell, it is admin-specific and a lot of the commands can often be inaccessible to the test shell or use scripts which only exist on the worker or be blocked by network configuration etc. There is no guarantee that a test shell running on a device will be able to contact the master, so direct retrieval is unlikely to work (plus you'd need a parser at the other end).

 

What is the property you are trying to set and retrieve and why? What does the test shell do with the value?

 

The test job submission itself support parameters and these are passed into the test shell. The most common example of that is the hacking session:

 

We do have support for exporting some values into the test shell overlay - lava-target-mac is one (we need some documentation of that but it has a fairly limited use case, so it's been largely internal until now).

 


 

--


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