diff --git a/Makefile b/Makefile index 2e0cc8f16..0fc6d0518 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,8 @@ docker_speculos: $(DOCKER) image tag $(LEDGERHQ)/speculos speculos docker_ledger_app_builder: - $(DOCKER) pull $(LEDGERHQ)/ledger-app-builder/ledger-app-builder:1d9f741e9bc969b072e2de53762b64993536c0f7 - $(DOCKER) image tag $(LEDGERHQ)/ledger-app-builder/ledger-app-builder:1d9f741e9bc969b072e2de53762b64993536c0f7 \ + $(DOCKER) pull $(LEDGERHQ)/ledger-app-builder/ledger-app-builder:3.5.0 + $(DOCKER) image tag $(LEDGERHQ)/ledger-app-builder/ledger-app-builder:3.5.0 \ ledger-app-builder docker_ledger_app_ocaml: diff --git a/docker/Dockerfile.integration-tests b/docker/Dockerfile.integration-tests index 20ba7024d..6330b1d0d 100644 --- a/docker/Dockerfile.integration-tests +++ b/docker/Dockerfile.integration-tests @@ -1,4 +1,4 @@ -FROM ghcr.io/ledgerhq/speculos:sha-744f56b +FROM ghcr.io/ledgerhq/speculos:sha-6a34680 RUN apt update && \ apt install -y curl jq build-essential libsodium-dev git && \ diff --git a/tests/integration/check_section_text.py b/tests/integration/check_section_text.py index 74e0e5622..3f4e6a6d9 100755 --- a/tests/integration/check_section_text.py +++ b/tests/integration/check_section_text.py @@ -26,9 +26,8 @@ class Screen: title: str text: list[str] - def matches(self, content: str, content_lines: int, device) -> bool: + def matches(self, content: str, content_lines: int) -> bool: for l in self.text: - l = device_alter_content(device, l) content = content.lstrip('\n') if not content.startswith(l): return False @@ -82,12 +81,12 @@ def press_left(url): """Press the left button.""" return press_button(url, 'left') -def check_multi_screen(url, title, content, content_lines, device): +def check_multi_screen(url, title, content, content_lines): """Assert that the screen contents across all screens with the given title match expected content.""" while True: def check_screen(screen): assert screen.title == title, f"expected section '{title}' but on '{screen.title}'" - assert screen.matches(content, content_lines, device), f"{screen} did not match {content}" + assert screen.matches(content, content_lines), f"{screen} did not match {content}" return screen on_screen = with_retry(url, check_screen) @@ -100,29 +99,6 @@ def check_screen(screen): print(f'- final screen {on_screen} -') -def check_potential_remaining_screen(url, device, title, content): - """Ignore the next blank screen on nanosp/nanox to avoid missing a potential terminal 'S'.""" - # OCR issue https://github.com/LedgerHQ/speculos/issues/204 - if device in ["nanosp", "nanox"] and content.endswith('S'): - - def check_screen(screen): - if screen.title == title: - assert all([l == "" for l in screen.text]), f"Expected blank screen (containing only 'S'), got {screen.text}" - return screen - - while True: - press_right(url) - screen = with_retry(url, check_screen) - if screen.title != title: - break - - def check_back(screen): - assert screen.title == title - - press_left(url) - # wait until we are back on last page of content - with_retry(url, check_back) - def device_content_lines(device: str) -> int: if device == "nanos": return 2 @@ -131,17 +107,6 @@ def device_content_lines(device: str) -> int: raise ValueError(f"unsupported device '{device}'") -def device_alter_content(device: str, content: str) -> str: - if device == "nanos": - return content - if device in ["nanosp", "nanox"]: - # OCR issue https://github.com/LedgerHQ/speculos/issues/204 - content = content.replace('S', '') - content = content.replace('I', 'l') - return content - - raise ValueError(f"unsupported device '{device}'") - if __name__ == "__main__": parser = argparse.ArgumentParser(description="Check a section of pages contain the expected content.") parser.add_argument("-d", "--device", help="device type: nanos | nanosp", required=True) @@ -151,7 +116,6 @@ def device_alter_content(device: str, content: str) -> str: args = parser.parse_args() content_lines = device_content_lines(args.device) - content = device_alter_content(args.device, args.expected_content) + content = args.expected_content - check_multi_screen(args.url, args.title, content, content_lines, args.device) - check_potential_remaining_screen(args.url, args.device, args.title, args.expected_content) + check_multi_screen(args.url, args.title, content, content_lines) diff --git a/tests/integration/nanosp/regression_press_right_works_across_apdu_recieves.sh b/tests/integration/nanosp/regression_press_right_works_across_apdu_recieves.sh index a91673595..65b6fe385 100644 --- a/tests/integration/nanosp/regression_press_right_works_across_apdu_recieves.sh +++ b/tests/integration/nanosp/regression_press_right_works_across_apdu_recieves.sh @@ -10,19 +10,11 @@ send_async_apdus \ 800f8200502000040743036c030b07430359030a074303680100000009225c365f340a246b25074303680100000024635e31225c3f45795f31214556627e393b45583b59550a234b6a325a54386860552158200345 "expect_apdu_return dcba96786c40c7894527a85050bc0b75eaee37aa020a52c634275450018da47822d552099146915f4c3280b3dbd4ab5d459b96b585247e58fda9bf53c9951dbe017811d074e688f11d8f47ce7f94c0548dca76be9ae9e87df794d3facdb4bb0a9000 " -expect_full_text 'Expression' '{lF_NONE {{WAP;lF {DlP {{DROP 1;PUH unit Unit;PUH bool True;PUH string "' -press_button right -expect_full_text 'Expression' ';L\\?p$-Fq)VDg\n]te\no4v0_8)\""}}} {{DROP 2;PUH unit Unit;PUH bool False;' -press_button right -expect_full_text 'Expression' 'PUH string "Li-%*edF6~?E[5Kmu?dyviwJ^2\"\\d$FyQ>>!>D$g(Qg";PUH string "*Tx' -press_button right -expect_full_text 'Expression' '>!>D$g(Qg";PUSH string "*Tx