On Mon, Apr 8, 2024 at 8:44 AM irreallich@126.com wrote:
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/testca..., 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?
You're confusing YAML (which is used for LAVA test job definition) and JINJA2, which is used to generate text files. LAVA doesn't support any loops in test job definitions, nor does it support JINJA2 there.
Best Regards, Milosz
I tried to get help from lava-users@lists.lavasoftware.org but never got a reply, link: https://lists.lavasoftware.org/archives/list/lava-users@lists.lavasoftware.o... _______________________________________________ lava-devel mailing list -- lava-devel@lists.lavasoftware.org To unsubscribe send an email to lava-devel-leave@lists.lavasoftware.org