From 2dcf953cc12b631a59a54673225c8a9c1d1c3eb2 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Fri, 24 Nov 2023 15:51:47 +0100 Subject: [PATCH] test --- ci/hardware_tests/bootstrap.py | 14 ++--- ci/hardware_tests/hardware.cfg | 1 + ci/test-hw.yml | 97 ++++++++++++++++++---------------- 3 files changed, 58 insertions(+), 54 deletions(-) diff --git a/ci/hardware_tests/bootstrap.py b/ci/hardware_tests/bootstrap.py index 6baa2d564..d4c6db0df 100755 --- a/ci/hardware_tests/bootstrap.py +++ b/ci/hardware_tests/bootstrap.py @@ -6,18 +6,18 @@ from device.tt import TrezorT def main(model: str, file: str = None): - t1 = TrezorOne( - os.environ["T1_UHUB_LOCATION"], - os.environ["T1_ARDUINO_SERIAL"], - os.environ["T1_UHUB_PORT"], - ) +# t1 = TrezorOne( +# os.environ["T1_UHUB_LOCATION"], +# os.environ["T1_ARDUINO_SERIAL"], +# os.environ["T1_UHUB_PORT"], +# ) tt = TrezorT(os.environ["TT_UHUB_LOCATION"], os.environ["TT_UHUB_PORT"]) if model == "t1": tt.power_off() - path = t1.update_firmware(file) + #path = t1.update_firmware(file) elif model == "tt": - t1.power_off() + #t1.power_off() path = tt.update_firmware(file) else: raise ValueError("Unknown Trezor model.") diff --git a/ci/hardware_tests/hardware.cfg b/ci/hardware_tests/hardware.cfg index 0eb8d529b..317be89a5 100644 --- a/ci/hardware_tests/hardware.cfg +++ b/ci/hardware_tests/hardware.cfg @@ -6,6 +6,7 @@ T1_UHUB_PORT="2" # camera device T1_CAMERA="/dev/video0" +# XXX /dev/serial/by-id/ does not exist at all # arduino that pushes T1 buttons T1_ARDUINO_SERIAL="/dev/serial/by-id/usb-Arduino__www.arduino.cc__0043_8573332373935181A0C0-if00" diff --git a/ci/test-hw.yml b/ci/test-hw.yml index cebb27f16..53231076f 100644 --- a/ci/test-hw.yml +++ b/ci/test-hw.yml @@ -42,6 +42,7 @@ hardware core regular device test: - source hardware.cfg - set +a - $NIX_SHELL --run "cd ../.. && poetry install" + - $NIX_SHELL --run "poetry run uhubctl" - $NIX_SHELL --run "poetry run python bootstrap.py tt ../../firmware-T2*.bin | ts -s" - $NIX_SHELL --run "poetry run pytest ../../tests/device_tests | ts -s" timeout: 6h @@ -72,6 +73,7 @@ hardware core btconly device test: - source hardware.cfg - set +a - $NIX_SHELL --run "cd ../.. && poetry install" + - $NIX_SHELL --run "poetry run uhubctl" - $NIX_SHELL --run "poetry run python bootstrap.py tt ../../firmware-T2*.bin | ts -s" - $NIX_SHELL --run "poetry run pytest ../../tests/device_tests | ts -s" timeout: 4h @@ -99,6 +101,7 @@ hardware core monero test: - source hardware.cfg - set +a - $NIX_SHELL --run "cd ../.. && poetry install" + - $NIX_SHELL --run "poetry run uhubctl" - $NIX_SHELL --run "poetry run python bootstrap.py tt ../../firmware-T2*.bin | ts -s" - $NIX_SHELL --arg fullDeps true --run "cd ../../core/tests && ./run_tests_device_emu_monero.sh $TESTOPTS | ts -s" timeout: 1h @@ -110,50 +113,50 @@ hardware core monero test: # [Device tests](../tests/device-tests.md) executed on physical Trezor 1. # This works thanks to [tpmb](https://github.com/mmahut/tpmb), which is a small arduino # device capable of pushing an actual buttons on the device. -hardware legacy regular device test: - stage: test - only: - - schedules # nightly build - - /^legacy\// - - /^release\// - - /^secfix\// - - /^hw\// - tags: - - tpmb - needs: - - legacy fw regular debug build - script: - - cd ci/hardware_tests - - $NIX_SHELL --run "./t1_hw_test.sh | ts -s" - timeout: 1h20m - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" - paths: - - ci/hardware_tests/*.mp4 - expire_in: 2 days - when: always - -# Also device tests on physical Trezor 1 but with Bitcoin-only firmware. -hardware legacy btconly device test: - stage: test - variables: - TREZOR_PYTEST_SKIP_ALTCOINS: 1 - only: - - schedules # nightly build - - /^legacy\// - - /^release\// - - /^secfix\// - - /^hw\// - tags: - - tpmb - needs: - - legacy fw btconly debug build - script: - - cd ci/hardware_tests - - $NIX_SHELL --run "./t1_hw_test.sh | ts -s" - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" - paths: - - ci/hardware_tests/*.mp4 - expire_in: 2 days - when: always +#hardware legacy regular device test: +# stage: test +# only: +# - schedules # nightly build +# - /^legacy\// +# - /^release\// +# - /^secfix\// +# - /^hw\// +# tags: +# - tpmb +# needs: +# - legacy fw regular debug build +# script: +# - cd ci/hardware_tests +# - $NIX_SHELL --run "./t1_hw_test.sh | ts -s" +# timeout: 1h20m +# artifacts: +# name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" +# paths: +# - ci/hardware_tests/*.mp4 +# expire_in: 2 days +# when: always +# +## Also device tests on physical Trezor 1 but with Bitcoin-only firmware. +#hardware legacy btconly device test: +# stage: test +# variables: +# TREZOR_PYTEST_SKIP_ALTCOINS: 1 +# only: +# - schedules # nightly build +# - /^legacy\// +# - /^release\// +# - /^secfix\// +# - /^hw\// +# tags: +# - tpmb +# needs: +# - legacy fw btconly debug build +# script: +# - cd ci/hardware_tests +# - $NIX_SHELL --run "./t1_hw_test.sh | ts -s" +# artifacts: +# name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" +# paths: +# - ci/hardware_tests/*.mp4 +# expire_in: 2 days +# when: always