On 30 April 2018 at 13:47, Tim Jaacks <tim.jaacks@garz-fricke.com> wrote:
Hello everybody,

I have some testcases which need a remote network connection to the DUT. I already managed to implement this using an LXC container as part of a multinode job.

Example: Check whether a telnet server is running on the DUT.
Implementation:
* DUT and LXC are deployed and booted as two roles in a multinode job
* DUT sends its IP address to LXC via the multinode API (lava-send) and then waits for a signal (lava-wait)
* LXC reads the IP address (lava-wait, lava_multi_node_cache.txt), tries a telnet connection to DUT (lava-test-case) and then sends a signal to DUT (lava-send)
* DUT and LXC are shut down

Now I read that LXC containers can be used in a singlenode job context as well, using the "namespace" attribute. I tried this and got the LXC container running along with my DUT, without the need of a multinode job. However, the multinode API cannot be used in this case, obviously. Is there another possibility to submit the DUT's IP address to the LXC?

Modify the DHCP configuration so that the DUT always gets the same IP address and then set that as device_ip - this will be available inside the test shell usingĀ https://git.linaro.org/lava/lava.git/tree/lava_dispatcher/lava_test_shell/lava-target-ip

https://staging.validation.linaro.org/scheduler/device/staging-hi6220-hikey-r2-01/devicedict

Devices which have device_ip set then have a suitable device tag added (static_ip) and that allows test writers to get the right support.

--