From d67436c7ec8f2bf34e8dbc7fc53186cb5eca5571 Mon Sep 17 00:00:00 2001 From: Vignesh Raman Date: Mon, 7 Jul 2025 07:29:59 +0530 Subject: [PATCH] ci/lava: make rootfs shell prompt configurable Add support for setting rootfs shell prompt. This is optional and defaults to "lava-shell:" if not specified. Signed-off-by: Vignesh Raman Part-of: --- .gitlab-ci/lava/lava_job_submitter.py | 1 + .gitlab-ci/lava/utils/uart_job_definition.py | 6 +++--- .gitlab-ci/tests/test_lava_job_submitter.py | 1 + .gitlab-ci/tests/utils/test_lava_job_definition.py | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci/lava/lava_job_submitter.py b/.gitlab-ci/lava/lava_job_submitter.py index 2a262313bb2..2cb5f9f88b5 100755 --- a/.gitlab-ci/lava/lava_job_submitter.py +++ b/.gitlab-ci/lava/lava_job_submitter.py @@ -404,6 +404,7 @@ class LAVAJobSubmitter(PathResolver): device_type: str farm: str job_timeout_min: int # The job timeout in minutes + shell_prompt: str = "lava-shell:" dtb_filename: str = None dump_yaml: bool = False # Whether to dump the YAML payload to stdout first_stage_init: str = None diff --git a/.gitlab-ci/lava/utils/uart_job_definition.py b/.gitlab-ci/lava/utils/uart_job_definition.py index 538b4565181..88421adb2a7 100644 --- a/.gitlab-ci/lava/utils/uart_job_definition.py +++ b/.gitlab-ci/lava/utils/uart_job_definition.py @@ -151,7 +151,7 @@ def tftp_boot_action(args: "LAVAJobSubmitter") -> dict[str, Any]: tftp_boot = { "failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT, "method": args.boot_method, - "prompts": ["lava-shell:"], + "prompts": [args.shell_prompt], "commands": "nfs", } @@ -162,7 +162,7 @@ def qemu_boot_action(args: "LAVAJobSubmitter") -> dict[str, Any]: qemu_boot = { "failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT, "method": args.boot_method, - "prompts": ["lava-shell:"], + "prompts": [args.shell_prompt], } return qemu_boot @@ -174,7 +174,7 @@ def fastboot_boot_action(args: "LAVAJobSubmitter") -> dict[str, Any]: "docker": {"image": DOCKER_IMAGE}, "failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT, "method": args.boot_method, - "prompts": ["lava-shell:"], + "prompts": [args.shell_prompt], "commands": ["set_active a"], } diff --git a/.gitlab-ci/tests/test_lava_job_submitter.py b/.gitlab-ci/tests/test_lava_job_submitter.py index bd2726ceebf..4d37c07feca 100644 --- a/.gitlab-ci/tests/test_lava_job_submitter.py +++ b/.gitlab-ci/tests/test_lava_job_submitter.py @@ -80,6 +80,7 @@ def lava_job_submitter( mock_setup_lava_proxy.return_value = mock_proxy() yield LAVAJobSubmitter( boot_method="test_boot", + shell_prompt="lava-shell:", device_type="test_device", farm="test_farm", job_timeout_min=1, diff --git a/.gitlab-ci/tests/utils/test_lava_job_definition.py b/.gitlab-ci/tests/utils/test_lava_job_definition.py index 579a3393374..d24e23bf67d 100644 --- a/.gitlab-ci/tests/utils/test_lava_job_definition.py +++ b/.gitlab-ci/tests/utils/test_lava_job_definition.py @@ -47,6 +47,7 @@ def job_submitter_factory(mode: Literal["UBOOT", "FASTBOOT"], shell_file): boot_method = "fastboot" device_type = "my_fastboot_device_type" + shell_prompt = "lava-shell:" job_timeout_min = 10 mesa_job_name = "dut test" pipeline_info = "my_pipeline_info" @@ -55,6 +56,7 @@ def job_submitter_factory(mode: Literal["UBOOT", "FASTBOOT"], shell_file): return LAVAJobSubmitter( boot_method=boot_method, + shell_prompt=shell_prompt, device_type=device_type, farm="test_farm", dtb_filename="my_dtb_filename",