diff --git a/ci/hardware_tests/device/device.py b/ci/hardware_tests/device/device.py index eee8ac455..4aa4f59f1 100644 --- a/ci/hardware_tests/device/device.py +++ b/ci/hardware_tests/device/device.py @@ -20,10 +20,11 @@ class Device: return run(full_cmd, shell=True, check=True, **kwargs) def check_model(self, model=None): - res = self.run_trezorctl("list", capture_output=True, text=True).stdout - self.log(res) + res = self.run_trezorctl("list", capture_output=True, text=True) + self.log(res.stdout) + self.log(res.stderr) self.run_trezorctl("get-features | grep version") - lines = res.splitlines() + lines = res.stdout.splitlines() if len(lines) != 1: raise RuntimeError("{} trezors connected".format(len(lines))) if model and model not in lines[0]: diff --git a/ci/hardware_tests/device/t1.py b/ci/hardware_tests/device/t1.py index 8ff830ddd..5acb0e20b 100644 --- a/ci/hardware_tests/device/t1.py +++ b/ci/hardware_tests/device/t1.py @@ -27,9 +27,9 @@ class TrezorOne(Device): self.wait(3) self._enter_bootloader() - self.run_trezorctl("list") - self.wait(3) + self.check_model("Trezor 1 bootloader") + self.run_trezorctl(trezorctlcmd) self.wait(3) self.touch("right", "click") diff --git a/ci/hardware_tests/device/tt.py b/ci/hardware_tests/device/tt.py index 67821a612..a34e7b99b 100644 --- a/ci/hardware_tests/device/tt.py +++ b/ci/hardware_tests/device/tt.py @@ -3,18 +3,18 @@ from .device import Device class TrezorT(Device): def update_firmware(self, file=None): - # reset to enter bootloader again - self.power_off() - self.power_on() - - self.run_trezorctl("list") - if not file: raise ValueError( "Uploading production firmware will replace the bootloader, it is not allowed!" ) + # reset to enter bootloader again + self.power_off() + self.power_on() + self.wait(5) + self.check_model("Trezor T bootloader") + self.run_trezorctl("device wipe --bootloader || true") self.wait(5) self.power_off()