hw/mmilata/usb
Martin Milata 6 months ago
parent 2172644626
commit 2dcf953cc1

@ -6,18 +6,18 @@ from device.tt import TrezorT
def main(model: str, file: str = None): def main(model: str, file: str = None):
t1 = TrezorOne( # t1 = TrezorOne(
os.environ["T1_UHUB_LOCATION"], # os.environ["T1_UHUB_LOCATION"],
os.environ["T1_ARDUINO_SERIAL"], # os.environ["T1_ARDUINO_SERIAL"],
os.environ["T1_UHUB_PORT"], # os.environ["T1_UHUB_PORT"],
) # )
tt = TrezorT(os.environ["TT_UHUB_LOCATION"], os.environ["TT_UHUB_PORT"]) tt = TrezorT(os.environ["TT_UHUB_LOCATION"], os.environ["TT_UHUB_PORT"])
if model == "t1": if model == "t1":
tt.power_off() tt.power_off()
path = t1.update_firmware(file) #path = t1.update_firmware(file)
elif model == "tt": elif model == "tt":
t1.power_off() #t1.power_off()
path = tt.update_firmware(file) path = tt.update_firmware(file)
else: else:
raise ValueError("Unknown Trezor model.") raise ValueError("Unknown Trezor model.")

@ -6,6 +6,7 @@ T1_UHUB_PORT="2"
# camera device # camera device
T1_CAMERA="/dev/video0" T1_CAMERA="/dev/video0"
# XXX /dev/serial/by-id/ does not exist at all
# arduino that pushes T1 buttons # arduino that pushes T1 buttons
T1_ARDUINO_SERIAL="/dev/serial/by-id/usb-Arduino__www.arduino.cc__0043_8573332373935181A0C0-if00" T1_ARDUINO_SERIAL="/dev/serial/by-id/usb-Arduino__www.arduino.cc__0043_8573332373935181A0C0-if00"

@ -42,6 +42,7 @@ hardware core regular device test:
- source hardware.cfg - source hardware.cfg
- set +a - set +a
- $NIX_SHELL --run "cd ../.. && poetry install" - $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 python bootstrap.py tt ../../firmware-T2*.bin | ts -s"
- $NIX_SHELL --run "poetry run pytest ../../tests/device_tests | ts -s" - $NIX_SHELL --run "poetry run pytest ../../tests/device_tests | ts -s"
timeout: 6h timeout: 6h
@ -72,6 +73,7 @@ hardware core btconly device test:
- source hardware.cfg - source hardware.cfg
- set +a - set +a
- $NIX_SHELL --run "cd ../.. && poetry install" - $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 python bootstrap.py tt ../../firmware-T2*.bin | ts -s"
- $NIX_SHELL --run "poetry run pytest ../../tests/device_tests | ts -s" - $NIX_SHELL --run "poetry run pytest ../../tests/device_tests | ts -s"
timeout: 4h timeout: 4h
@ -99,6 +101,7 @@ hardware core monero test:
- source hardware.cfg - source hardware.cfg
- set +a - set +a
- $NIX_SHELL --run "cd ../.. && poetry install" - $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 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" - $NIX_SHELL --arg fullDeps true --run "cd ../../core/tests && ./run_tests_device_emu_monero.sh $TESTOPTS | ts -s"
timeout: 1h timeout: 1h
@ -110,50 +113,50 @@ hardware core monero test:
# [Device tests](../tests/device-tests.md) executed on physical Trezor 1. # [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 # 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. # device capable of pushing an actual buttons on the device.
hardware legacy regular device test: #hardware legacy regular device test:
stage: test # stage: test
only: # only:
- schedules # nightly build # - schedules # nightly build
- /^legacy\// # - /^legacy\//
- /^release\// # - /^release\//
- /^secfix\// # - /^secfix\//
- /^hw\// # - /^hw\//
tags: # tags:
- tpmb # - tpmb
needs: # needs:
- legacy fw regular debug build # - legacy fw regular debug build
script: # script:
- cd ci/hardware_tests # - cd ci/hardware_tests
- $NIX_SHELL --run "./t1_hw_test.sh | ts -s" # - $NIX_SHELL --run "./t1_hw_test.sh | ts -s"
timeout: 1h20m # timeout: 1h20m
artifacts: # artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" # name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: # paths:
- ci/hardware_tests/*.mp4 # - ci/hardware_tests/*.mp4
expire_in: 2 days # expire_in: 2 days
when: always # when: always
#
# Also device tests on physical Trezor 1 but with Bitcoin-only firmware. ## Also device tests on physical Trezor 1 but with Bitcoin-only firmware.
hardware legacy btconly device test: #hardware legacy btconly device test:
stage: test # stage: test
variables: # variables:
TREZOR_PYTEST_SKIP_ALTCOINS: 1 # TREZOR_PYTEST_SKIP_ALTCOINS: 1
only: # only:
- schedules # nightly build # - schedules # nightly build
- /^legacy\// # - /^legacy\//
- /^release\// # - /^release\//
- /^secfix\// # - /^secfix\//
- /^hw\// # - /^hw\//
tags: # tags:
- tpmb # - tpmb
needs: # needs:
- legacy fw btconly debug build # - legacy fw btconly debug build
script: # script:
- cd ci/hardware_tests # - cd ci/hardware_tests
- $NIX_SHELL --run "./t1_hw_test.sh | ts -s" # - $NIX_SHELL --run "./t1_hw_test.sh | ts -s"
artifacts: # artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" # name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: # paths:
- ci/hardware_tests/*.mp4 # - ci/hardware_tests/*.mp4
expire_in: 2 days # expire_in: 2 days
when: always # when: always

Loading…
Cancel
Save