diff --git a/ci/hardware_tests/record_video.sh b/ci/hardware_tests/record_video.sh index 44b8c5cee0..5c9bd2a33d 100755 --- a/ci/hardware_tests/record_video.sh +++ b/ci/hardware_tests/record_video.sh @@ -9,7 +9,8 @@ INPUTDEVICE=/dev/video0 if [ "$2" == "start" ]; then echo "[software/video] Starting record to $OUTPUTFILE" - ffmpeg -loglevel panic -f oss -f video4linux2 -i $INPUTDEVICE \ + ffmpeg -loglevel warning -f oss -f video4linux2 -i $INPUTDEVICE \ + -flush_packets 1 \ -vf "drawtext=font=Dejavu Sans: \ text='$1 | %{localtime} | %{pts}': x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1: fontsize=15" $OUTPUTFILE & export VPID=$! diff --git a/ci/hardware_tests/t1_hw_test.sh b/ci/hardware_tests/t1_hw_test.sh new file mode 100755 index 0000000000..621c88ffa6 --- /dev/null +++ b/ci/hardware_tests/t1_hw_test.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +function finish { + ./record_video.sh ${CI_COMMIT_SHORT_SHA} stop + ls -l *.mp4 +} +trap finish EXIT + +set -e # exit on nonzero exitcode +set -x # trace commands + + +./record_video.sh ${CI_COMMIT_SHORT_SHA} start +(cd ../.. && poetry install) +poetry run trezorctl -v list +export TREZOR_PATH=$(./get_trezor_path.sh 'Trezor 1') +echo $TREZOR_PATH +poetry run python bootstrap.py t1 +poetry run python bootstrap.py t1 ../../trezor-*.bin +poetry run pytest ../../tests/device_tests diff --git a/ci/test.yml b/ci/test.yml index aea54a4442..8db0fbbce7 100644 --- a/ci/test.yml +++ b/ci/test.yml @@ -345,19 +345,11 @@ hardware legacy regular device test: - legacy fw regular debug build script: - cd ci/hardware_tests - - nix-shell --run "./record_video.sh ${CI_COMMIT_SHORT_SHA} start" - - nix-shell --run "cd ../.. && poetry install" - - nix-shell --run "poetry run trezorctl list" - - export TREZOR_PATH=$(./get_trezor_path.sh 'Trezor 1') - - nix-shell --run "echo $TREZOR_PATH" - - nix-shell --run "poetry run python bootstrap.py t1" - - nix-shell --run "poetry run python bootstrap.py t1 ../../trezor-*.bin" - - nix-shell --run "poetry run pytest ../../tests/device_tests" - - nix-shell --run "./record_video.sh ${CI_COMMIT_SHORT_SHA} stop" + - nix-shell --run "./t1_hw_test.sh" artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" paths: - - ci/hardware_tests/video*.mp4 + - ci/hardware_tests/*.mp4 expire_in: 2 days when: always @@ -377,19 +369,11 @@ hardware legacy btconly device test: - legacy fw btconly debug build script: - cd ci/hardware_tests - - nix-shell --run "./record_video.sh ${CI_COMMIT_SHORT_SHA} start" - - nix-shell --run "cd ../.. && poetry install" - - nix-shell --run "poetry run trezorctl list" - - export TREZOR_PATH=$(./get_trezor_path.sh 'Trezor 1') - - nix-shell --run "echo $TREZOR_PATH" - - nix-shell --run "poetry run python bootstrap.py t1" - - nix-shell --run "poetry run python bootstrap.py t1 ../../trezor-*.bin" - - nix-shell --run "poetry run pytest ../../tests/device_tests" - - nix-shell --run "./record_video.sh ${CI_COMMIT_SHORT_SHA} stop" + - nix-shell --run "./t1_hw_test.sh" artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" paths: - - ci/hardware_tests/video*.mp4 + - ci/hardware_tests/*.mp4 expire_in: 2 days when: always