Skip to content
Merged
14 changes: 13 additions & 1 deletion lava_test_plans/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def main():
context.update({"device_type": args.device_type})
context.update({"overlays": overlays})

# Load device file to extract EXCLUDED_TESTPLANS using Jinja2
# Load device file to extract the exclusion lists using Jinja2
try:
# Use Jinja2 to render the device template and extract variables
device_template = j2_env.get_template(args.device_type)
Expand All @@ -450,6 +450,18 @@ def main():
logger.info(
f"Found EXCLUDED_TESTPLANS in device file: {device_module.EXCLUDED_TESTPLANS}"
)

# And EXCLUDED_TESTS the same way. A test case reads it as
# EXCLUDED_TESTS|default([]), which resolves against the context, so a
# device that only sets it as a template variable is not seen unless it
# happens to be reached through inheritance - which depends on how the
# device was addressed on the command line. Putting it in the context
# makes it work whichever way round that is.
if hasattr(device_module, "EXCLUDED_TESTS"):
context["EXCLUDED_TESTS"] = device_module.EXCLUDED_TESTS
logger.info(
f"Found EXCLUDED_TESTS in device file: {device_module.EXCLUDED_TESTS}"
)
except TemplateNotFound as e:
logger.debug(f"Could not extract EXCLUDED_TESTPLANS from device file: {e}")
except TemplateSyntaxError as e:
Expand Down
18 changes: 17 additions & 1 deletion lava_test_plans/include/boot_target/auto_login_commands.jinja2
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
{# the command that becomes root, for a user who reaches it some other way #}
{# than su - through sudo, say #}
{% set AUTO_LOGIN_SU_COMMAND = AUTO_LOGIN_SU_COMMAND|default("su") %}

{# Some images ship an expired password and force a new one to be set right #}
{# after the first login. AUTO_LOGIN_NEW_PASSWORD answers that exchange: #}
{# the current password, then the new one twice, in reply to the prompts #}
{# boot_os_prompt.jinja2 adds for it. #}
{% if AUTO_LOGIN_NEW_PASSWORD is defined and AUTO_LOGIN_NEW_PASSWORD %}
login_commands:
- "{{ AUTO_LOGIN_PASSWORD }}"
- "{{ AUTO_LOGIN_NEW_PASSWORD }}"
- "{{ AUTO_LOGIN_NEW_PASSWORD }}"
{% if AUTO_LOGIN_USERNAME != 'root' %}
- {{ AUTO_LOGIN_SU_COMMAND }}
{% endif %}
{% elif AUTO_LOGIN_USERNAME != 'root' %}
login_commands:
# Become super user to run tests
- su
- {{ AUTO_LOGIN_SU_COMMAND }}
{% endif %}
6 changes: 6 additions & 0 deletions lava_test_plans/include/boot_target/boot_os_prompt.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@
{% else %}
- "{{BOOT_OS_PROMPT}}"
{% endif %}
{% endif %}
{# the forced password change has to be matched before it can be answered #}
{% if AUTO_LOGIN_NEW_PASSWORD is defined and AUTO_LOGIN_NEW_PASSWORD %}
{% for password_prompt in AUTO_LOGIN_PASSWORD_CHANGE_PROMPTS|default(["Current password", "New password", "Retype new password"]) %}
- "{{ password_prompt }}"
{% endfor %}
{% endif %}
- 'root@(.*):[/~]#'
2 changes: 1 addition & 1 deletion lava_test_plans/include/fastboot.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ reboot_to_fastboot: {{ reboot_to_fastboot }}
test_character_delay: 10
{% endblock context %}

{% block actions %}
{% block deploy_target %}
- deploy:
{% if lxc_project == true %}
Expand Down Expand Up @@ -337,6 +336,7 @@ reboot_to_fastboot: {{ reboot_to_fastboot }}
{% include "include/boot_target/post_boot_command.jinja2" %}
{% endblock post_boot_command %}

{% block actions %}
{{ super() }}

{% if lxc_project == true %}
Expand Down
5 changes: 0 additions & 5 deletions lava_test_plans/include/flasher.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

{% set DEPLOY_TARGET = DEPLOY_TARGET|default("flasher") %}

{% block actions %}
{% block deploy_target %}

{% if enable_tests is defined and enable_tests %}
Expand Down Expand Up @@ -82,7 +81,3 @@
{% block post_boot_command %}
{% include "include/boot_target/post_boot_command.jinja2" %}
{% endblock post_boot_command %}

{{ super() }}

{% endblock actions %}
12 changes: 4 additions & 8 deletions lava_test_plans/include/qdl.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
{% set target_downloads_timeout = 0 %}
{% set TARGET_BOOT_TIMEOUT = qdl_boot_timeout * (qdl_stages|length) %}

{% block actions %}
{% block deploy_target %}
- deploy:
rootfs_image: "{{ qdl_rootfs_image }}"
Expand All @@ -56,9 +55,7 @@
timeout:
minutes: {{ qdl_deploy_timeout }}
to: qdl
{% endblock deploy_target %}

{% block boot_target %}
{# flashing over qdl is part of the deployment #}
{% for stage in qdl_stages %}
- boot:
firehose_program: "{{ firehose_program }}"
Expand All @@ -75,6 +72,9 @@
minutes: {{ qdl_boot_timeout }}
method: qdl
{% endfor %}
{% endblock deploy_target %}

{% block boot_target %}
- boot:
{% block boot_commands %}
{% endblock boot_commands %}
Expand All @@ -87,7 +87,3 @@
{% include "include/boot_target/boot_target.jinja2" %}

{% endblock boot_target %}

{{ super() }}

{% endblock actions %}
23 changes: 23 additions & 0 deletions lava_test_plans/master.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@

{% set enable_tests = enable_tests|default(true) %}

{# named device commands issued once the image is deployed and before the #}
{# OS boots, e.g. ["network_turn_on"]. Each name has to be defined in the #}
{# device dictionary of every device that renders it. #}
{% set user_pre_boot_commands = user_pre_boot_commands|default([]) %}

{% block global_settings %}
timeouts:
job:
Expand Down Expand Up @@ -98,6 +103,24 @@ tags:

actions:
{% block actions %}
{% block deploy_target %}
{% endblock deploy_target %}

{% block pre_boot_command %}
{% endblock pre_boot_command %}

{% block user_pre_boot_commands %}
{% for user_pre_boot_command in user_pre_boot_commands %}
- command:
name: {{ user_pre_boot_command }}
{% endfor %}
{% endblock user_pre_boot_commands %}

{% block boot_target %}
{% endblock boot_target %}

{% block post_boot_command %}
{% endblock post_boot_command %}

{% block test_target %}
{% include "include/test_target.jinja2" %}
Expand Down
6 changes: 0 additions & 6 deletions lava_test_plans/nfs.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
{% set apply_overlay = "overlays" %}
{% endif %}

{% block actions %}

{% block deploy_target %}
- deploy:
{% if deploy_namespace is defined %}
Expand Down Expand Up @@ -181,7 +179,3 @@
{% block boot_commands %}
{% endblock boot_commands %}
{% endblock boot_target %}

{{ super() }}

{% endblock actions %}
12 changes: 12 additions & 0 deletions lava_test_plans/projects/qcom-deb-images/devices/glymur-crd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "devices/glymur-crd" %}

{# spinor + nvme flashing stages come from the common device #}
{% set qdl_image_dir = "flash_glymur-crd_nvme" %}
{% set qdl_rootfs_image = "disk-sdcard.img2" %}
{% set qdl_tarball = "flash-emmc.tar.gz" %}

{# exclusions are tracked in #}
{# https://github.com/qualcomm-linux/qcom-deb-images/issues/647 #}
{% import "projects/qcom-deb-images/include/excluded-tests.jinja2" as excluded %}
{% set EXCLUDED_TESTS = excluded.EXCLUDED_TESTS %}
{% set EXCLUDED_TESTPLANS = excluded.EXCLUDED_TESTPLANS %}
19 changes: 19 additions & 0 deletions lava_test_plans/projects/qcom-deb-images/devices/lemans-evk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% extends "devices/lemans-evk" %}

{# the debian image is flashed over ufs only; the common device flashes the #}
{# sail_nor stage first. The stage list is spelled out rather than built #}
{# from rawprogram/patch, which the common device only defines later. #}
{% set qdl_stages = [
{"storage": "ufs", "path": "",
"rawprogram": "rawprogram0.xml rawprogram1.xml rawprogram2.xml rawprogram3.xml rawprogram4.xml rawprogram5.xml",
"patch": "patch0.xml patch1.xml patch2.xml patch3.xml patch4.xml patch5.xml"}
] %}
{% set qdl_image_dir = "flash_lemans-evk_ufs" %}
{% set qdl_rootfs_image = "disk-ufs.img2" %}
{% set qdl_tarball = "flash-ufs.tar.gz" %}

{# exclusions are tracked in #}
{# https://github.com/qualcomm-linux/qcom-deb-images/issues/647 #}
{% import "projects/qcom-deb-images/include/excluded-tests.jinja2" as excluded %}
{% set EXCLUDED_TESTS = excluded.EXCLUDED_TESTS %}
{% set EXCLUDED_TESTPLANS = excluded.EXCLUDED_TESTPLANS %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% extends "devices/monaco-arduino-monza" %}

{# the debian image is flashed over emmc only, with the ddr firehose #}
{# programmer; the common device flashes spinor first using xbl_s. The #}
{# stage list is spelled out rather than built from rawprogram/patch, which #}
{# the common device only defines later. #}
{% set firehose_program = "prog_firehose_ddr.elf" %}
{% set qdl_stages = [
{"storage": "emmc", "path": "", "rawprogram": "rawprogram0.xml", "patch": "patch0.xml"}
] %}
{% set qdl_image_dir = "flash_monaco-arduino-monza_emmc" %}
{% set qdl_rootfs_image = "disk-sdcard.img2" %}
{% set qdl_tarball = "flash-emmc.tar.gz" %}

{# exclusions are tracked in #}
{# https://github.com/qualcomm-linux/qcom-deb-images/issues/647 #}
{% import "projects/qcom-deb-images/include/excluded-tests.jinja2" as excluded %}
{% set EXCLUDED_TESTS = excluded.EXCLUDED_TESTS %}
{% set EXCLUDED_TESTPLANS = excluded.EXCLUDED_TESTPLANS %}
12 changes: 12 additions & 0 deletions lava_test_plans/projects/qcom-deb-images/devices/monaco-evk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "devices/monaco-evk" %}

{# the sail_nor + ufs flashing stages come from the common device #}
{% set qdl_image_dir = "flash_monaco-evk_ufs" %}
{% set qdl_rootfs_image = "disk-ufs.img2" %}
{% set qdl_tarball = "flash-ufs.tar.gz" %}

{# exclusions are tracked in #}
{# https://github.com/qualcomm-linux/qcom-deb-images/issues/647 #}
{% import "projects/qcom-deb-images/include/excluded-tests.jinja2" as excluded %}
{% set EXCLUDED_TESTS = excluded.EXCLUDED_TESTS %}
{% set EXCLUDED_TESTPLANS = excluded.EXCLUDED_TESTPLANS %}
17 changes: 17 additions & 0 deletions lava_test_plans/projects/qcom-deb-images/devices/qcs615-ride
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "devices/qcs615-ride" %}

{# the debian image ships five rawprogram/patch pairs, the common device six #}
{% set qdl_stages = [
{"storage": "ufs", "path": "",
"rawprogram": "rawprogram0.xml rawprogram1.xml rawprogram2.xml rawprogram3.xml rawprogram4.xml",
"patch": "patch0.xml patch1.xml patch2.xml patch3.xml patch4.xml"}
] %}
{% set qdl_image_dir = "flash_qcs615-ride_ufs" %}
{% set qdl_rootfs_image = "disk-ufs.img2" %}
{% set qdl_tarball = "flash-ufs.tar.gz" %}

{# exclusions are tracked in #}
{# https://github.com/qualcomm-linux/qcom-deb-images/issues/647 #}
{% import "projects/qcom-deb-images/include/excluded-tests.jinja2" as excluded %}
{% set EXCLUDED_TESTS = excluded.EXCLUDED_TESTS %}
{% set EXCLUDED_TESTPLANS = excluded.EXCLUDED_TESTPLANS %}
16 changes: 16 additions & 0 deletions lava_test_plans/projects/qcom-deb-images/devices/qcs6490-rb3gen2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% extends "devices/qcs6490-rb3gen2" %}

{# the ufs flashing stage comes from the common device #}
{% set qdl_image_dir = "flash_qcs6490-rb3gen2-vision-kit_ufs" %}
{% set qdl_rootfs_image = "disk-ufs.img2" %}
{% set qdl_tarball = "flash-ufs.tar.gz" %}

{# ask for the vision kit, an alias of the qcs6490-rb3gen2 device type, #}
{# which also covers the core kit #}
{% block device_type %}qcs6490-rb3gen2-vision-kit{% endblock %}

{# exclusions are tracked in #}
{# https://github.com/qualcomm-linux/qcom-deb-images/issues/647 #}
{% import "projects/qcom-deb-images/include/excluded-tests.jinja2" as excluded %}
{% set EXCLUDED_TESTS = excluded.EXCLUDED_TESTS %}
{% set EXCLUDED_TESTPLANS = excluded.EXCLUDED_TESTPLANS %}

This file was deleted.

12 changes: 12 additions & 0 deletions lava_test_plans/projects/qcom-deb-images/devices/qcs9100-ride-r3
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "devices/qcs9100-ride" %}

{# the sail_nor + ufs flashing stages come from the common device #}
{% set qdl_image_dir = "flash_qcs9100-ride-r3_ufs" %}
{% set qdl_rootfs_image = "disk-ufs.img2" %}
{% set qdl_tarball = "flash-ufs.tar.gz" %}

{# exclusions are tracked in #}
{# https://github.com/qualcomm-linux/qcom-deb-images/issues/647 #}
{% import "projects/qcom-deb-images/include/excluded-tests.jinja2" as excluded %}
{% set EXCLUDED_TESTS = excluded.EXCLUDED_TESTS %}
{% set EXCLUDED_TESTPLANS = excluded.EXCLUDED_TESTPLANS %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "devices/qrb2210-arduino-imola" %}

{# the emmc flashing stage comes from the common device #}
{% set qdl_image_dir = "flash_qrb2210-arduino-imola_emmc" %}
{% set qdl_rootfs_image = "disk-sdcard.img2" %}
{% set qdl_tarball = "flash-emmc.tar.gz" %}

{# exclusions are tracked in #}
{# https://github.com/qualcomm-linux/qcom-deb-images/issues/647 #}
{% import "projects/qcom-deb-images/include/excluded-tests.jinja2" as excluded %}
{% set EXCLUDED_TESTS = excluded.EXCLUDED_TESTS %}
{% set EXCLUDED_TESTPLANS = excluded.EXCLUDED_TESTPLANS %}
12 changes: 12 additions & 0 deletions lava_test_plans/projects/qcom-deb-images/devices/qrb2210-rb1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "devices/qrb2210-rb1" %}

{# the emmc flashing stage comes from the common device #}
{% set qdl_image_dir = "flash_qrb2210-rb1_emmc" %}
{% set qdl_rootfs_image = "disk-sdcard.img2" %}
{% set qdl_tarball = "flash-emmc.tar.gz" %}

{# exclusions are tracked in #}
{# https://github.com/qualcomm-linux/qcom-deb-images/issues/647 #}
{% import "projects/qcom-deb-images/include/excluded-tests.jinja2" as excluded %}
{% set EXCLUDED_TESTS = excluded.EXCLUDED_TESTS %}
{% set EXCLUDED_TESTPLANS = excluded.EXCLUDED_TESTPLANS %}

This file was deleted.

20 changes: 20 additions & 0 deletions lava_test_plans/projects/qcom-deb-images/devices/shikra-iqs-evk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends "devices/shikra-iqs-evk" %}

{# ptool describes two physical partitions for shikra-evk/emmc and emits a #}
{# rawprogram/patch pair for each: 0 is the main storage, 1 is the JEDEC #}
{# boot area holding just the CDT. Flash both, so the board also gets the #}
{# CDT this build was generated against. The common device flashes 0 alone. #}
{% set qdl_stages = [
{"storage": "emmc", "path": "",
"rawprogram": "rawprogram0.xml rawprogram1.xml",
"patch": "patch0.xml patch1.xml"}
] %}
{% set qdl_image_dir = "flash_shikra-iqs-evk_emmc" %}
{% set qdl_rootfs_image = "disk-sdcard.img2" %}
{% set qdl_tarball = "flash-emmc.tar.gz" %}

{# exclusions are tracked in #}
{# https://github.com/qualcomm-linux/qcom-deb-images/issues/647 #}
{% import "projects/qcom-deb-images/include/excluded-tests.jinja2" as excluded %}
{% set EXCLUDED_TESTS = excluded.EXCLUDED_TESTS %}
{% set EXCLUDED_TESTPLANS = excluded.EXCLUDED_TESTPLANS %}
18 changes: 0 additions & 18 deletions lava_test_plans/projects/qcom-deb-images/flasher.jinja2

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{# Tests and test plans left out of the debian image jobs. Each device file #}
{# imports both lists from here, so they are maintained in one place. #}
{# The investigation into each exclusion is tracked in #}
{# https://github.com/qualcomm-linux/qcom-deb-images/issues/647 #}

{# WiFi_OnOff needs iw, which the testkit has no debian package mapping for. #}
{# Its installer then takes the warning it logged about that as the name of #}
{# the package to install and dumps apt's policy for the whole archive down #}
{# the serial console, using up the whole budget of the test action so that #}
{# nothing after it runs. Drop it until the testkit is fixed. #}
{# The rest are not run on the debian images for now. #}
{% set EXCLUDED_TESTS = [
'WiFi_OnOff',
'AudioRecord',
'Docker_Kernel_Config',
'Kubernetes_Kernel_Config',
'Logging_Journalctl_Validation'
] %}

{# the bluetooth, audio and display plans need a lab fixture these boards #}
{# are not known to have, and a job asking for one that no device carries #}
{# sits queued until it times out; drop the entry once the boards have it #}
{% set EXCLUDED_TESTPLANS = [
'pre-merge-bt.yaml',
'pre-merge-audio.yaml',
'pre-merge-display-gfx.yaml'
] %}
Loading
Loading