Hey,
We're using lava to test multiple of our devices. While most tests are similar ("does the device still have a working ethernet connection"), some slightly differ. For example a device might have LEDs 1-3, another the LEDs 1-5.
Today I save multiple test shell definitions test1-device1.yaml, test1-device2.yaml, ..., which all just differ by providing "device1", "device2", ... in an argument to the actual test script, so the run: section looks like this:
run: steps: - cd ./testdir/ - ./run_test.py device1
I would like to get rid of the two, separate .yaml files and only have a `./run_test.py ${device}` or similar. Is there any way to provide a variable from the job definition to the test shell definition? Or are things like the device type set in the environment so I could access them?
Best regards, Olli
On Tue, Jun 22, 2021 at 9:51 AM Westermann, Oliver Oliver.Westermann@cognex.com wrote:
Hey,
We're using lava to test multiple of our devices. While most tests are similar ("does the device still have a working ethernet connection"), some slightly differ. For example a device might have LEDs 1-3, another the LEDs 1-5.
Today I save multiple test shell definitions test1-device1.yaml, test1-device2.yaml, ..., which all just differ by providing "device1", "device2", ... in an argument to the actual test script, so the run: section looks like this:
run: steps: - cd ./testdir/ - ./run_test.py device1
I would like to get rid of the two, separate .yaml files and only have a `./run_test.py ${device}` or similar. Is there any way to provide a variable from the job definition to the test shell definition? Or are things like the device type set in the environment so I could access them?
Yes, use parameters. Example excerpt from job definition (test section): - repository: http://github.com/linaro/test-definitions.git from: git path: automated/linux/network-basic/network-basic.yaml name: network-basic params: INTERFACE: "eth0" SKIP_INSTALL: true CURL: wget DHCLIENT: "udhcpc -i"
The yaml related to this test can be found here: https://github.com/Linaro/test-definitions/blob/master/automated/linux/netwo...
Best Regards, Milosz
Best regards, Olli
Lava-users mailing list Lava-users@lists.lavasoftware.org https://lists.lavasoftware.org/mailman/listinfo/lava-users
On Tue, Jun 22, 2021 at 9:51 AM Westermann, Oliver <Oliver.Westermann at cognex.com> wrote:
Hey,
We're using lava to test multiple of our devices. While most tests are similar ("does the device still have a working ethernet connection"), some slightly differ. For example a device might have LEDs 1-3, another the LEDs 1-5.
Today I save multiple test shell definitions test1-device1.yaml, test1-device2.yaml, ..., which all just differ by providing "device1", "device2", ... in an argument to the actual test script, so the run: section looks like this:
run: steps: - cd ./testdir/ - ./run_test.py device1
I would like to get rid of the two, separate .yaml files and only have a `./run_test.py ${device}` or similar. Is there any way to provide a variable from the job definition to the test shell definition? Or are things like the device type set in the environment so I could access them?
Yes, use parameters. Example excerpt from job definition (test section):
- repository: http://github.com/linaro/test-definitions.git from: git path: automated/linux/network-basic/network-basic.yaml name: network-basic params: INTERFACE: "eth0" SKIP_INSTALL: true CURL: wget DHCLIENT: "udhcpc -i"
The yaml related to this test can be found here: https://github.com/Linaro/test-definitions/blob/master/automated/linux/netwo...
Best Regards, Milosz
Thanks, that looks way to obvious for me to have missed it. Once you know it, you even find it in the reference: https://docs.lavasoftware.org/lava/actions-test.html?highlight=parameter#con...
Thanks again, Olli
Hey,
Those work fine :) I have another question though: Can those be set "globally"? Currently I simply append a
params: DEVICE_TYPE: "mydevice"
To all test definitions. Depending on the device, this might be 20 definitions, resulting in 40 extra lines. Can those be replaced by a top level var?
Best regards, Olli
Am Dienstag, 22. Juni 2021 11:07 schrieb Milosz Wasilewski milosz.wasilewski@foundries.io:
On Tue, Jun 22, 2021 at 9:51 AM Westermann, Oliver <Oliver.Westermann at cognex.com> wrote:
Hey,
We're using lava to test multiple of our devices. While most tests are similar ("does the device still have a working ethernet connection"), some slightly differ. For example a device might have LEDs 1-3, another the LEDs 1-5.
Today I save multiple test shell definitions test1-device1.yaml, test1-device2.yaml, ..., which all just differ by providing "device1", "device2", ... in an argument to the actual test script, so the run: section looks like this:
run: steps: - cd ./testdir/ - ./run_test.py device1
I would like to get rid of the two, separate .yaml files and only have a `./run_test.py ${device}` or similar. Is there any way to provide a variable from the job definition to the test shell definition? Or are things like the device type set in the environment so I could access them?
Yes, use parameters. Example excerpt from job definition (test section):
- repository: http://github.com/linaro/test-definitions.git from: git path: automated/linux/network-basic/network-basic.yaml name: network-basic params: INTERFACE: "eth0" SKIP_INSTALL: true CURL: wget DHCLIENT: "udhcpc -i"
The yaml related to this test can be found here: https://github.com/Linaro/test-definitions/blob/master/automated/linux/netwo...
Best Regards, Milosz
Thanks, that looks way to obvious for me to have missed it. Once you know it, you even find it in the reference: https://docs.lavasoftware.org/lava/actions-test.html?highlight=parameter#con...
Thanks again, Olli
On Fri, Jun 25, 2021 at 7:17 AM Westermann, Oliver Oliver.Westermann@cognex.com wrote:
Hey,
Those work fine :) I have another question though: Can those be set "globally"? Currently I simply append a
params: DEVICE_TYPE: "mydevice"
To all test definitions. Depending on the device, this might be 20 definitions, resulting in 40 extra lines. Can those be replaced by a top level var?
I don't think so. At least I'm not aware of such feature. These variables are copied from the YAML file to the shell script that is executed on the DUT. Since shell script is prepared separately for each definition I assume there are no 'global' variables.
Best Regards, Milosz
Best regards, Olli
Am Dienstag, 22. Juni 2021 11:07 schrieb Milosz Wasilewski milosz.wasilewski@foundries.io:
On Tue, Jun 22, 2021 at 9:51 AM Westermann, Oliver <Oliver.Westermann at cognex.com> wrote:
Hey,
We're using lava to test multiple of our devices. While most tests are similar ("does the device still have a working ethernet connection"), some slightly differ. For example a device might have LEDs 1-3, another the LEDs 1-5.
Today I save multiple test shell definitions test1-device1.yaml, test1-device2.yaml, ..., which all just differ by providing "device1", "device2", ... in an argument to the actual test script, so the run: section looks like this:
run: steps: - cd ./testdir/ - ./run_test.py device1
I would like to get rid of the two, separate .yaml files and only have a `./run_test.py ${device}` or similar. Is there any way to provide a variable from the job definition to the test shell definition? Or are things like the device type set in the environment so I could access them?
Yes, use parameters. Example excerpt from job definition (test section):
- repository: http://github.com/linaro/test-definitions.git from: git path: automated/linux/network-basic/network-basic.yaml name: network-basic params: INTERFACE: "eth0" SKIP_INSTALL: true CURL: wget DHCLIENT: "udhcpc -i"
The yaml related to this test can be found here: https://github.com/Linaro/test-definitions/blob/master/automated/linux/netwo...
Best Regards, Milosz
Thanks, that looks way to obvious for me to have missed it. Once you know it, you even find it in the reference: https://docs.lavasoftware.org/lava/actions-test.html?highlight=parameter#con...
Thanks again, Olli
lava-users@lists.lavasoftware.org