ci/lava: Use init-stage2 and setup-test-env.sh from Mesa install

init-stage2.sh and setup-test-env.sh are already downloaded on the DUT as
part of the mesa-build overlay, which downloads the Mesa artifacts from
S3.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35051>
This commit is contained in:
Valentine Burley 2025-05-16 09:20:14 +02:00 committed by Marge Bot
parent a6e1926a8e
commit ffe8a2e023
9 changed files with 11 additions and 8 deletions

View file

@ -47,8 +47,8 @@ rm -rf results
mkdir -p results/job-rootfs-overlay/ mkdir -p results/job-rootfs-overlay/
filter_env_vars > results/job-rootfs-overlay/set-job-env-vars.sh filter_env_vars > results/job-rootfs-overlay/set-job-env-vars.sh
cp artifacts/ci-common/init-*.sh results/job-rootfs-overlay/ # Set SCRIPTS_DIR to point to the Mesa install we download for the DUT
cp "$SCRIPTS_DIR"/setup-test-env.sh results/job-rootfs-overlay/ echo "export SCRIPTS_DIR='$CI_PROJECT_DIR/install'" >> results/job-rootfs-overlay/set-job-env-vars.sh
tar zcf job-rootfs-overlay.tar.gz -C results/job-rootfs-overlay/ . tar zcf job-rootfs-overlay.tar.gz -C results/job-rootfs-overlay/ .
ci-fairy s3cp --token-file "${S3_JWT_FILE}" job-rootfs-overlay.tar.gz "https://${JOB_ROOTFS_OVERLAY_PATH}" ci-fairy s3cp --token-file "${S3_JWT_FILE}" job-rootfs-overlay.tar.gz "https://${JOB_ROOTFS_OVERLAY_PATH}"
@ -98,6 +98,7 @@ PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \
--mesa-job-name "$CI_JOB_NAME" \ --mesa-job-name "$CI_JOB_NAME" \
--structured-log-file "results/lava_job_detail.json" \ --structured-log-file "results/lava_job_detail.json" \
--ssh-client-image "${LAVA_SSH_CLIENT_IMAGE}" \ --ssh-client-image "${LAVA_SSH_CLIENT_IMAGE}" \
--project-dir "${CI_PROJECT_DIR}" \
--project-name "${CI_PROJECT_NAME}" \ --project-name "${CI_PROJECT_NAME}" \
--starting-section "${CURRENT_SECTION}" \ --starting-section "${CURRENT_SECTION}" \
--job-submitted-at "${CI_JOB_STARTED_AT}" \ --job-submitted-at "${CI_JOB_STARTED_AT}" \

View file

@ -415,6 +415,7 @@ class LAVAJobSubmitter(PathResolver):
visibility_group: str = None # Only affects LAVA farm maintainers visibility_group: str = None # Only affects LAVA farm maintainers
structured_log_file: pathlib.Path = None # Log file path with structured LAVA log structured_log_file: pathlib.Path = None # Log file path with structured LAVA log
ssh_client_image: str = None # x86_64 SSH client image to follow the job's output ssh_client_image: str = None # x86_64 SSH client image to follow the job's output
project_dir: str = None # Project directory to be used to find Mesa artifacts
project_name: str = None # Project name to be used in the job name project_name: str = None # Project name to be used in the job name
starting_section: str = None # GitLab section used to start starting_section: str = None # GitLab section used to start
job_submitted_at: [str | datetime] = None job_submitted_at: [str | datetime] = None

View file

@ -170,7 +170,7 @@ def generate_docker_test(
# maintainers with monitoring # maintainers with monitoring
f"lava_ssh_test_case '{args.project_name}_{args.mesa_job_name}' " f"lava_ssh_test_case '{args.project_name}_{args.mesa_job_name}' "
# Changing directory to /, as the HWCI_SCRIPT expects that # Changing directory to /, as the HWCI_SCRIPT expects that
"'cd / && /init-stage2.sh'", f"'cd / && {args.project_dir}/install/common/init-stage2.sh'",
] ]
return init_stages_test return init_stages_test

View file

@ -137,7 +137,7 @@ def uart_test_actions(
"sleep 1", "sleep 1",
# Putting CI_JOB name as the testcase name, it may help LAVA farm # Putting CI_JOB name as the testcase name, it may help LAVA farm
# maintainers with monitoring # maintainers with monitoring
f"lava-test-case '{args.project_name}_{args.mesa_job_name}' --shell /init-stage2.sh", f"lava-test-case '{args.project_name}_{args.mesa_job_name}' --shell {args.project_dir}/install/common/init-stage2.sh",
] ]
return (test,) return (test,)

View file

@ -138,6 +138,6 @@ actions:
sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
EOF EOF
- export SSH_PTY_ARGS=-tt - export SSH_PTY_ARGS=-tt
- lava_ssh_test_case 'test-project_dut' 'cd / && /init-stage2.sh' - lava_ssh_test_case 'test-project_dut' 'cd / && /test_dir/install/common/init-stage2.sh'
docker: docker:
image: image:

View file

@ -90,4 +90,4 @@ actions:
- echo Could not find jwt file, disabling S3 requests... - echo Could not find jwt file, disabling S3 requests...
- sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh - sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
- sleep 1 - sleep 1
- lava-test-case 'test-project_dut' --shell /init-stage2.sh - lava-test-case 'test-project_dut' --shell /test_dir/install/common/init-stage2.sh

View file

@ -109,6 +109,6 @@ actions:
sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
EOF EOF
- export SSH_PTY_ARGS=-tt - export SSH_PTY_ARGS=-tt
- lava_ssh_test_case 'test-project_dut' 'cd / && /init-stage2.sh' - lava_ssh_test_case 'test-project_dut' 'cd / && /test_dir/install/common/init-stage2.sh'
docker: docker:
image: image:

View file

@ -63,4 +63,4 @@ actions:
- echo Could not find jwt file, disabling S3 requests... - echo Could not find jwt file, disabling S3 requests...
- sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh - sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
- sleep 1 - sleep 1
- lava-test-case 'test-project_dut' --shell /init-stage2.sh - lava-test-case 'test-project_dut' --shell /test_dir/install/common/init-stage2.sh

View file

@ -62,6 +62,7 @@ def job_submitter_factory(mode: Literal["UBOOT", "FASTBOOT"], shell_file):
mesa_job_name=mesa_job_name, mesa_job_name=mesa_job_name,
pipeline_info=pipeline_info, pipeline_info=pipeline_info,
visibility_group=visibility_group, visibility_group=visibility_group,
project_dir="/test_dir",
project_name=project_name, project_name=project_name,
) )