ci/lava: Use UART for non-Chromebooks

Some Chromebooks have unreliable UART, so we fall back to SSH for them.
However, SSH setup adds a 10-15s overhead, so we now restrict its usage
to devices with the "depthcharge" boot method (i.e., Chromebooks).

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35936>
This commit is contained in:
Valentine Burley 2025-07-04 09:07:10 +02:00 committed by Marge Bot
parent cba15ce787
commit 0bf2e3c712
4 changed files with 24 additions and 6 deletions

View file

@ -30,7 +30,7 @@ variables:
ALPINE_X86_64_BUILD_TAG: "20250709-libwayland"
ALPINE_X86_64_LAVA_SSH_TAG: "20250423-rootfs"
ALPINE_X86_64_LAVA_TRIGGER_TAG: "20250619-cts-ovl"
ALPINE_X86_64_LAVA_TRIGGER_TAG: "20250701-uart"
FEDORA_X86_64_BUILD_TAG: "20250709-libwayland"

View file

@ -18,3 +18,16 @@ def get_lava_farm() -> str:
logging.warning("FARM environment variable is not set, using unknown")
return farm.lower()
def get_lava_boot_method() -> str:
"""
Returns the LAVA boot method based on the BOOT_METHOD environment variable.
:return: The LAVA boot method
"""
boot_method: str = os.getenv("BOOT_METHOD", "unknown")
if boot_method == "unknown":
logging.warning("BOOT_METHOD environment variable is not set, using unknown")
return boot_method.lower()

View file

@ -11,7 +11,7 @@ from ruamel.yaml import YAML
from os import getenv
from lava.utils.lava_farm import get_lava_farm
from lava.utils.lava_farm import get_lava_farm, get_lava_boot_method
from lava.utils.log_section import LAVA_DEPLOY_TIMEOUT
from lava.utils.ssh_job_definition import (
generate_docker_test,
@ -60,11 +60,15 @@ class LAVAJobDefinition:
if FORCE_UART:
return False
# Only Collabora's farm supports to run docker container as a LAVA actions,
# which is required to follow the job in a SSH section
current_farm = get_lava_farm()
boot_method = get_lava_boot_method()
return current_farm == "collabora"
# Some Chromebooks have unreliable serial connections, so SSH is preferred.
# Only Collabora's farm supports running docker container as a LAVA actions,
# which is required to follow the job in an SSH section
# Chromebooks use the "depthcharge" boot method, so use SSH in that case,
# and UART for everything else.
return current_farm == "collabora" and boot_method == "depthcharge"
def generate_lava_yaml_payload(self) -> dict[str, Any]:
"""

View file

@ -85,8 +85,9 @@ def clear_env_vars(autouse=True):
@pytest.fixture
def mock_collabora_farm(clear_env_vars, monkeypatch):
# Mock a Collabora farm-like device runner tag to enable SSH execution
# Mock a Chromebook in the Collabora farm
monkeypatch.setenv("FARM", "collabora")
monkeypatch.setenv("BOOT_METHOD", "depthcharge")
@pytest.mark.parametrize("force_uart", [True, False], ids=["SSH", "UART"])