Because our system needs to save some content when rebooting, I hope to test this function, such as rebooting 5000 times, but I don’t know how to add a loop to lava device (jinja2) or job (yaml).
I find the file https://github.com/Linaro/lava-test-plans/blob/master/lava_test_plans/testc…, It looks like the "-boot" action can be controlled through a for loop.
{% for index in range(1,8) %}
{% with FASTBOOT_COMMANDS=Null %}
- boot:
{% include "include/boot_target/boot_target.jinja2" %}
{% endwith %}
{% with test_timeout=boottime_timeout %}
{% include "include/test_target.jinja2" %}
{% endwith %}
But when I try the following code,
{% for index in range(1,8) %}
- boot:
method: minimal
timeout:
minutes: 10
auto_login:
login_prompt: 'tegra-ubuntu login:'
username: root
password_prompt: "Password:"
password: "root"
login_commands:
- ifconfig
prompts:
- 'root@tegra-ubuntu:'
parameters:
kernel-start-message: ''
transfer_overlay:
download_command: cd /tmp ; wget
unpack_command: tar -m -C / -xzf
{% endfor %}
lava report error: line22 is "{% for index in range(1,8) %}"
Invalid definition: Loading job submission failed: while scanning for the next token found character that cannot start any token in "", line 22, column 2.
Where did I go wrong?
I tried to get help from lava-users(a)lists.lavasoftware.org but never got a reply,
link: https://lists.lavasoftware.org/archives/list/lava-users@lists.lavasoftware.…