1 # SPDX-License-Identifier: GPL-2.0+
5 MIRROR_DOCKER: docker.io
7 PLATFORM: linux/amd64,linux/arm64
13 # Grab our configured image. The source for this is found
14 # in the u-boot tree at tools/docker/Dockerfile
15 image: ${MIRROR_DOCKER}/trini/u-boot-gitlab-ci-runner:jammy-20240808-03Dec2024
17 # We run some tests in different order, to catch some failures quicker.
24 .buildman_and_testpy_template: &buildman_and_testpy_dfn
26 retry: 2 # QEMU may be too slow, etc.
30 # Clone uboot-test-hooks
31 - git config --global --add safe.directory "${CI_PROJECT_DIR}"
32 - git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks
33 # qemu_arm64_lwip_defconfig is the same as qemu_arm64 but with NET_LWIP enabled.
34 # The test config and the boardenv file from qemu_arm64 can be re-used so create symlinks
35 - ln -s conf.qemu_arm64_na /tmp/uboot-test-hooks/bin/travis-ci/conf.qemu_arm64_lwip_na
36 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
37 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
38 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
39 wget -O - https://github.com/riscv-software-src/opensbi/releases/download/v1.3.1/opensbi-1.3.1-rv-bin.tar.xz | tar -C /tmp -xJ;
40 export OPENSBI=/tmp/opensbi-1.3.1-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
42 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]] || [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
43 wget -O - https://github.com/riscv-software-src/opensbi/releases/download/v1.3.1/opensbi-1.3.1-rv-bin.tar.xz | tar -C /tmp -xJ;
44 export OPENSBI=/tmp/opensbi-1.3.1-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
46 - if [[ "${TEST_PY_BD}" == "qemu-arm-sbsa" ]]; then
47 wget -O /tmp/bl1.bin https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/latest/tf-a/bl1.bin;
48 wget -O /tmp/fip.bin https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/latest/tf-a/fip.bin;
49 export BINMAN_INDIRS=/tmp;
53 - cp -v /tmp/${TEST_PY_BD}/*.{html,css,xml} .
54 - rm -rf /tmp/uboot-test-hooks /tmp/venv
56 # If we've been asked to use clang only do one configuration.
57 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
58 - echo BUILD_ENV ${BUILD_ENV}
59 - if [ -n "${BUILD_ENV}" ]; then
62 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
63 --board ${TEST_PY_BD} ${OVERRIDE}
64 - cp /opt/grub/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/
65 - cp /opt/grub/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/
66 - cp /opt/grub/grubriscv64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv64.efi
67 - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
68 - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
69 # create sdcard / spi-nor images for sifive unleashed using genimage
70 - if [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
72 cp ${UBOOT_TRAVIS_BUILD_DIR}/spl/u-boot-spl.bin .;
73 cp ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.itb .;
75 genimage --inputpath . --config board/sifive/unleashed/genimage_sdcard.cfg;
76 cp images/sdcard.img ${UBOOT_TRAVIS_BUILD_DIR}/;
78 genimage --inputpath . --config board/sifive/unleashed/genimage_spi-nor.cfg;
79 cp images/spi-nor.img ${UBOOT_TRAVIS_BUILD_DIR}/;
81 - if [[ "${TEST_PY_BD}" == "coreboot" ]]; then
82 cp /opt/coreboot/coreboot.rom ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom;
83 /opt/coreboot/cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom remove -n fallback/payload;
84 /opt/coreboot/cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000;
86 - virtualenv -p /usr/bin/python3 /tmp/venv
87 - . /tmp/venv/bin/activate
88 - pip install -r test/py/requirements.txt
89 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
90 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
91 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
92 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
93 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
94 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
95 --junitxml=/tmp/${TEST_PY_BD}/results.xml
110 build all 32bit ARM platforms:
111 extends: .world_build
114 git config --global --add safe.directory "${CI_PROJECT_DIR}";
115 pip install -r tools/buildman/requirements.txt;
116 ./tools/buildman/buildman -o /tmp -PEWM arm -x aarch64 || ret=$?;
117 if [[ $ret -ne 0 ]]; then
118 ./tools/buildman/buildman -o /tmp -seP;
122 build all 64bit ARM platforms:
123 extends: .world_build
125 - virtualenv -p /usr/bin/python3 /tmp/venv
126 - . /tmp/venv/bin/activate
128 git config --global --add safe.directory "${CI_PROJECT_DIR}";
129 pip install -r tools/buildman/requirements.txt;
130 ./tools/buildman/buildman -o /tmp -PEWM aarch64 || ret=$?;
131 if [[ $ret -ne 0 ]]; then
132 ./tools/buildman/buildman -o /tmp -seP;
136 build all PowerPC platforms:
137 extends: .world_build
140 git config --global --add safe.directory "${CI_PROJECT_DIR}";
141 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
142 if [[ $ret -ne 0 ]]; then
143 ./tools/buildman/buildman -o /tmp -seP;
147 build all other platforms:
148 extends: .world_build
151 git config --global --add safe.directory "${CI_PROJECT_DIR}";
152 ./tools/buildman/buildman -o /tmp -PEWM -x arm,powerpc || ret=$?;
153 if [[ $ret -ne 0 ]]; then
154 ./tools/buildman/buildman -o /tmp -seP;
163 check for new CONFIG symbols outside Kconfig:
166 - git config --global --add safe.directory "${CI_PROJECT_DIR}"
167 # If grep succeeds and finds a match the test fails as we should
169 - git grep -E '^#[[:blank:]]*(define|undef)[[:blank:]]*CONFIG_'
170 :^doc/ :^arch/arm/dts/ :^scripts/kconfig/lkc.h
171 :^include/linux/kconfig.h :^tools/ :^dts/upstream/
172 :^lib/mbedtls/external :^lib/mbedtls/mbedtls_def_config.h &&
175 # build documentation
179 - virtualenv -p /usr/bin/python3 /tmp/venvhtml
180 - . /tmp/venvhtml/bin/activate
181 - pip install -r doc/sphinx/requirements.txt
182 - make htmldocs KDOC_WERROR=1
185 # ensure all configs have MAINTAINERS entries
186 Check for configs without MAINTAINERS entry:
189 - ./tools/buildman/buildman --maintainer-check
191 # Ensure host tools build
192 Build tools-only and envtools:
195 - make tools-only_config tools-only -j$(nproc);
197 make tools-only_config envtools -j$(nproc)
199 Run binman, buildman, dtoc, Kconfig and patman testsuites:
202 - git config --global user.name "GitLab CI Runner";
204 git config --global --add safe.directory "${CI_PROJECT_DIR}";
206 virtualenv -p /usr/bin/python3 /tmp/venv;
207 . /tmp/venv/bin/activate;
208 pip install -r test/py/requirements.txt;
209 pip install -r tools/buildman/requirements.txt;
210 export UBOOT_TRAVIS_BUILD_DIR=/tmp/tools-only;
211 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
212 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
214 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
217 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
218 ./tools/buildman/buildman -t;
219 ./tools/dtoc/dtoc -t;
220 ./tools/patman/patman test;
223 # Check for any pylint regressions
227 - git config --global --add safe.directory "${CI_PROJECT_DIR}"
228 - pip install -r test/py/requirements.txt
229 - pip install -r tools/buildman/requirements.txt
230 - pip install asteval pylint==2.12.2 pyopenssl
231 - export PATH=${PATH}:~/.local/bin
232 - echo "[MASTER]" >> .pylintrc
233 - echo "load-plugins=pylint.extensions.docparams" >> .pylintrc
234 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/tools-only
236 - ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
240 - export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
243 # Check for pre-schema driver model tags
244 Check for pre-schema tags:
247 - git config --global --add safe.directory "${CI_PROJECT_DIR}";
248 # If grep succeeds and finds a match the test fails as we should
250 - git grep u-boot,dm- -- '*.dts*' && exit 1 || exit 0
252 # Check we can package the Python tools
253 Check packing of Python tools:
258 # Test sandbox with test.py
261 TEST_PY_BD: "sandbox"
262 <<: *buildman_and_testpy_dfn
264 sandbox with clang test.py:
266 TEST_PY_BD: "sandbox"
267 OVERRIDE: "-O clang-17"
268 <<: *buildman_and_testpy_dfn
272 TEST_PY_BD: "sandbox64"
273 <<: *buildman_and_testpy_dfn
275 sandbox64 with clang test.py:
277 TEST_PY_BD: "sandbox64"
278 OVERRIDE: "-O clang-17"
279 <<: *buildman_and_testpy_dfn
283 TEST_PY_BD: "sandbox_spl"
284 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
285 <<: *buildman_and_testpy_dfn
287 sandbox_noinst_test.py:
289 TEST_PY_BD: "sandbox_noinst"
290 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
291 <<: *buildman_and_testpy_dfn
293 sandbox_noinst with LOAD_FIT_FULL test.py:
295 TEST_PY_BD: "sandbox_noinst"
296 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
297 OVERRIDE: "-a CONFIG_SPL_LOAD_FIT_FULL=y"
298 <<: *buildman_and_testpy_dfn
302 TEST_PY_BD: "sandbox_vpl"
303 TEST_PY_TEST_SPEC: "vpl or test_spl"
304 <<: *buildman_and_testpy_dfn
306 # Enable tracing and disable LTO, to ensure functions are not elided
307 sandbox trace_test.py:
309 TEST_PY_BD: "sandbox"
310 BUILD_ENV: "FTRACE=1 NO_LTO=1"
311 TEST_PY_TEST_SPEC: "trace"
312 OVERRIDE: "-a CONFIG_TRACE=y -a CONFIG_TRACE_EARLY=y -a CONFIG_TRACE_EARLY_SIZE=0x01000000 -a CONFIG_TRACE_BUFFER_SIZE=0x02000000"
313 <<: *buildman_and_testpy_dfn
317 TEST_PY_BD: "evb-ast2500"
318 TEST_PY_TEST_SPEC: "not sleep"
319 TEST_PY_ID: "--id qemu"
320 <<: *buildman_and_testpy_dfn
324 TEST_PY_BD: "evb-ast2600"
325 TEST_PY_TEST_SPEC: "not sleep"
326 TEST_PY_ID: "--id qemu"
327 <<: *buildman_and_testpy_dfn
329 sandbox_flattree test.py:
331 TEST_PY_BD: "sandbox_flattree"
332 <<: *buildman_and_testpy_dfn
334 vexpress_ca9x4 test.py:
336 TEST_PY_BD: "vexpress_ca9x4"
337 TEST_PY_TEST_SPEC: "not sleep"
338 TEST_PY_ID: "--id qemu"
339 <<: *buildman_and_testpy_dfn
341 integratorcp_cm926ejs test.py:
343 TEST_PY_BD: "integratorcp_cm926ejs"
344 TEST_PY_TEST_SPEC: "not sleep"
345 TEST_PY_ID: "--id qemu"
346 <<: *buildman_and_testpy_dfn
350 TEST_PY_BD: "qemu_arm"
351 TEST_PY_TEST_SPEC: "not sleep"
352 <<: *buildman_and_testpy_dfn
356 TEST_PY_BD: "qemu_arm64"
357 TEST_PY_TEST_SPEC: "not sleep"
358 <<: *buildman_and_testpy_dfn
360 qemu_arm64_lwip test.py:
362 TEST_PY_BD: "qemu_arm64_lwip"
363 TEST_PY_TEST_SPEC: "test_net_dhcp or test_net_ping or test_net_tftpboot"
364 <<: *buildman_and_testpy_dfn
366 qemu_arm_sbsa test.py:
368 TEST_PY_BD: "qemu-arm-sbsa"
369 TEST_PY_TEST_SPEC: "not sleep"
370 <<: *buildman_and_testpy_dfn
374 TEST_PY_BD: "M5208EVBE"
375 TEST_PY_ID: "--id qemu"
376 TEST_PY_TEST_SPEC: "not sleep and not efi"
377 OVERRIDE: "-a CONFIG_M68K_QEMU=y -a ~CONFIG_MCFTMR"
378 <<: *buildman_and_testpy_dfn
383 TEST_PY_TEST_SPEC: "not sleep and not efi"
384 TEST_PY_ID: "--id qemu"
385 <<: *buildman_and_testpy_dfn
387 qemu_maltael test.py:
389 TEST_PY_BD: "maltael"
390 TEST_PY_TEST_SPEC: "not sleep and not efi"
391 TEST_PY_ID: "--id qemu"
392 <<: *buildman_and_testpy_dfn
394 qemu_malta64 test.py:
396 TEST_PY_BD: "malta64"
397 TEST_PY_TEST_SPEC: "not sleep and not efi"
398 TEST_PY_ID: "--id qemu"
399 <<: *buildman_and_testpy_dfn
401 qemu_malta64el test.py:
403 TEST_PY_BD: "malta64el"
404 TEST_PY_TEST_SPEC: "not sleep and not efi"
405 TEST_PY_ID: "--id qemu"
406 <<: *buildman_and_testpy_dfn
408 qemu-ppce500 test.py:
410 TEST_PY_BD: "qemu-ppce500"
411 TEST_PY_TEST_SPEC: "not sleep"
412 <<: *buildman_and_testpy_dfn
414 qemu-riscv32 test.py:
416 TEST_PY_BD: "qemu-riscv32"
417 TEST_PY_TEST_SPEC: "not sleep"
418 <<: *buildman_and_testpy_dfn
420 qemu-riscv64 test.py:
422 TEST_PY_BD: "qemu-riscv64"
423 TEST_PY_TEST_SPEC: "not sleep"
424 <<: *buildman_and_testpy_dfn
426 qemu-riscv32_spl test.py:
428 TEST_PY_BD: "qemu-riscv32_spl"
429 TEST_PY_TEST_SPEC: "not sleep"
430 <<: *buildman_and_testpy_dfn
432 qemu-riscv64_spl test.py:
434 TEST_PY_BD: "qemu-riscv64_spl"
435 TEST_PY_TEST_SPEC: "not sleep"
436 <<: *buildman_and_testpy_dfn
440 TEST_PY_BD: "qemu-x86"
441 TEST_PY_TEST_SPEC: "not sleep"
442 <<: *buildman_and_testpy_dfn
446 TEST_PY_BD: "qemu-x86_64"
447 TEST_PY_TEST_SPEC: "not sleep"
448 <<: *buildman_and_testpy_dfn
450 qemu-xtensa-dc233c test.py:
452 TEST_PY_BD: "qemu-xtensa-dc233c"
453 TEST_PY_TEST_SPEC: "not sleep and not efi"
454 <<: *buildman_and_testpy_dfn
456 r2dplus_i82557c test.py:
458 TEST_PY_BD: "r2dplus"
459 TEST_PY_TEST_SPEC: "not sleep"
460 TEST_PY_ID: "--id i82557c_qemu"
461 <<: *buildman_and_testpy_dfn
463 r2dplus_pcnet test.py:
465 TEST_PY_BD: "r2dplus"
466 TEST_PY_TEST_SPEC: "not sleep"
467 TEST_PY_ID: "--id pcnet_qemu"
468 <<: *buildman_and_testpy_dfn
470 r2dplus_rtl8139 test.py:
472 TEST_PY_BD: "r2dplus"
473 TEST_PY_TEST_SPEC: "not sleep"
474 TEST_PY_ID: "--id rtl8139_qemu"
475 <<: *buildman_and_testpy_dfn
477 r2dplus_tulip test.py:
479 TEST_PY_BD: "r2dplus"
480 TEST_PY_TEST_SPEC: "not sleep"
481 TEST_PY_ID: "--id tulip_qemu"
482 <<: *buildman_and_testpy_dfn
484 sifive_unleashed_sdcard test.py:
486 TEST_PY_BD: "sifive_unleashed"
487 TEST_PY_TEST_SPEC: "not sleep"
488 TEST_PY_ID: "--id sdcard_qemu"
489 <<: *buildman_and_testpy_dfn
491 sifive_unleashed_spi-nor test.py:
493 TEST_PY_BD: "sifive_unleashed"
494 TEST_PY_TEST_SPEC: "not sleep"
495 TEST_PY_ID: "--id spi-nor_qemu"
496 <<: *buildman_and_testpy_dfn
498 xilinx_zynq_virt test.py:
500 TEST_PY_BD: "xilinx_zynq_virt"
501 TEST_PY_TEST_SPEC: "not sleep"
502 TEST_PY_ID: "--id qemu"
503 <<: *buildman_and_testpy_dfn
505 xilinx_versal_virt test.py:
507 TEST_PY_BD: "xilinx_versal_virt"
508 TEST_PY_TEST_SPEC: "not sleep"
509 TEST_PY_ID: "--id qemu"
510 <<: *buildman_and_testpy_dfn
515 TEST_PY_TEST_SPEC: "not sleep"
516 TEST_PY_ID: "--id qemu"
517 <<: *buildman_and_testpy_dfn
521 TEST_PY_BD: "coreboot"
522 TEST_PY_TEST_SPEC: "not sleep"
523 TEST_PY_ID: "--id qemu"
524 <<: *buildman_and_testpy_dfn
526 .lab_template: &lab_dfn
529 - if: $SJG_LAB == "1"
531 - if: $SJG_LAB != "1"
536 - if [[ -z "${SJG_LAB}" ]]; then
541 # OUT - output directory for builds
542 - export SRC="$(pwd)"
543 - export OUT="${SRC}/build/${BOARD}"
544 - export PATH=$PATH:~/bin
545 - export PATH=$PATH:/vid/software/devel/ubtest/u-boot-test-hooks/bin
547 # Load it on the device
549 - echo "role ${ROLE}"
550 - export strategy="-s uboot -e off"
551 - export USE_LABGRID_SJG=1
552 # export verbose="-v"
553 - ${SRC}/test/py/test.py --role ${ROLE} --build-dir "${OUT}"
554 --capture=tee-sys -k "not bootstd" || ret=$?
555 - U_BOOT_BOARD_IDENTITY="${ROLE}" u-boot-test-release || true
556 - if [[ $ret -ne 0 ]]; then
562 - "build/${BOARD}/test-log.html"
563 - "build/${BOARD}/multiplexed_log.css"