Hi William,
Thanks for your information. I have read this wiki and got a question. I see device_info itself only support keys 'board_id', 'usb_vendor_id' and 'usb_product_id', however I want to expose is a device path like '/dev/ttyUSB0'. I also took a look at LAVA source code on GitHub to see if it support other keys, I found it validate above device keys. Code is here: https://github.com/Linaro/lava-dispatcher/blob/release/lava_dispatcher/pipel... line: 302. There's no board_id, usb_vendor_id and usb_product_id for my DUT which is a Yocto device. So how should I use device_info to expose '/dev/ttyUSB0' to lxc? I know I can hack the code to expose, but I do prefer a solution that works on original LAVA. Could you please give me some hint?
By the way, I found a typo in https://staging.validation.linaro.org/static/docs/v2/admin-lxc-deploy.html: "{% set device_info = [{'board_id': '0123456789', 'usb_vendor_id': '0451', 'usb_vendor_id': 'd109'}] %}" => I guess this should be "{% set device_info = [{'board_id': '0123456789', 'usb_vendor_id': '0451', 'usb_product_id': 'd109'}] %}", the second 'usb_vendor_id' is typo of 'usb_product_id'.
-Yifan
-----Original Message----- From: Neil Williams [mailto:neil.williams@linaro.org] Sent: Wednesday, July 19, 2017 6:37 PM To: Li, Yifan2 yifan2.li@intel.com Cc: Lava-users@lists.linaro.org Subject: Re: [Lava-users] How to expose device path like '/dev/ttyUSB0' to LAVA-LXC?
On 19 July 2017 at 11:16, Li, Yifan2 yifan2.li@intel.com wrote:
Hello LAVA experts,
Is it possible to expose a device path like ‘/dev/ttyUSB0’ to lxc in job definition or device definition? I have a feature requirement to control a relay card inside LAVA lxc.
Yes. This is the device_info dictionary which can be part of the device dictionary.
https://staging.validation.linaro.org/scheduler/device/staging-hi6220-hikey- 03/devicedict
https://git.linaro.org/lava/lava- lab.git/tree/staging.validation.linaro.org/lava/pipeline/devices/staging- hi6220-hikey-03.jinja2
Also:
https://git.linaro.org/lava/lava- lab.git/tree/staging.validation.linaro.org/lava/pipeline/devices/staging- panda03.jinja2
I have got clues for device_info and read https://validation.linaro.org/static/docs/v2/lava-scheduler-device-dic tionary.html?highlight=device_info and https://validation.linaro.org/static/docs/v2/admin-lxc-
deploy.html?highlight=device_info.
However I did not know how to use it to expose ‘/dev/ttyUSB0’ to LXC.
You need 2017.6 or later for this to work.
https://staging.validation.linaro.org/static/docs/v2/admin-lxc-deploy.html
Although designed for Android testing, the support is available to any use of the LXC.
https://staging.validation.linaro.org/static/docs/v2/admin-lxc- deploy.html#arbitrary-usb-devices-with-lxc-support
--
Neil Williams
neil.williams@linaro.org http://www.linux.codehelp.co.uk/