Skip to content

Commit

Permalink
Fix stax test failing due to ragger python package changes and SDK up…
Browse files Browse the repository at this point in the history
…grade.

Add target field in makefile to distinguish between stax and flex. Both use same BOLOS_SDK
  • Loading branch information
ajinkyaraj-23 committed Jun 27, 2024
1 parent 13a9e84 commit 6f04c75
Show file tree
Hide file tree
Showing 17 changed files with 14 additions and 12 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,20 @@ scan-build: scan-build-nanos scan-build-nanosp \
app_%_dbg.tgz: app/src/*.[ch] \
app/src/parser/*.[ch] \
app/Makefile
target=$(shell echo $*); \
SDK=$(shell echo $* | tr "[:lower:]" "[:upper:]")_SDK; \
$(DOCKER_RUN_APP_BUILDER) bash -c \
"BOLOS_SDK=\$$$$SDK make -C app DEBUG=1"
"BOLOS_SDK=\$$$$SDK TARGET=\$$$$target make -C app DEBUG=1"
$(DOCKER_RUN_APP_BUILDER) bash -c "cd app/bin/ && tar cz ." > $@


app_%.tgz: app/src/*.[ch] \
app/src/parser/*.[ch] \
app/Makefile
target=$(shell echo $*); \
SDK=$(shell echo $* | tr "[:lower:]" "[:upper:]")_SDK; \
$(DOCKER_RUN_APP_BUILDER) bash -c \
"BOLOS_SDK=\$$$$SDK make -C app"
"BOLOS_SDK=\$$$$SDK TARGET=\$$$$target make -C app"
$(DOCKER_RUN_APP_BUILDER) bash -c "cd app/bin/ && tar cz ." > $@

clean:
Expand Down
Binary file modified tests/integration/stax/snapshots/test_basic/info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/integration/stax/snapshots/test_basic/settings_expert_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/integration/stax/snapshots/test_blindsign_too_deep/info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/integration/stax/snapshots/test_blindsign_too_large/info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/integration/stax/snapshots/test_blindsign_valid/info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions tests/integration/stax/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
from ragger.backend import SpeculosBackend
from ragger.backend.interface import RaisePolicy
from ragger.firmware import Firmware
from ragger.firmware.stax.screen import MetaScreen
from ragger.firmware.stax.use_cases import UseCaseHomeExt, UseCaseSettings, UseCaseAddressConfirmation, UseCaseReview, UseCaseChoice
from ragger.firmware.stax.layouts import ChoiceList
from ragger.firmware.stax.positions import BUTTON_LOWER_LEFT, BUTTON_LOWER_RIGHT, BUTTON_ABOVE_LOWER_MIDDLE, BUTTON_LOWER_MIDDLE
from ragger.firmware.touch.screen import MetaScreen
from ragger.firmware.touch.use_cases import UseCaseHomeExt, UseCaseSettings, UseCaseAddressConfirmation, UseCaseReview, UseCaseChoice
from ragger.firmware.touch.layouts import ChoiceList
from ragger.firmware.touch.positions import STAX_BUTTON_LOWER_LEFT, STAX_BUTTON_LOWER_RIGHT, STAX_BUTTON_ABOVE_LOWER_MIDDLE, STAX_BUTTON_LOWER_MIDDLE

MAX_ATTEMPTS = 50

Expand Down Expand Up @@ -140,7 +140,7 @@ def review_confirm_signing(self, expected_apdu):
def enable_expert_mode(self, expert_enabled=False):
if not expert_enabled:
self.assert_screen("enable_expert_mode")
self.welcome.client.finger_touch(BUTTON_ABOVE_LOWER_MIDDLE.x, BUTTON_ABOVE_LOWER_MIDDLE.y)
self.welcome.client.finger_touch(STAX_BUTTON_ABOVE_LOWER_MIDDLE.x, STAX_BUTTON_ABOVE_LOWER_MIDDLE.y)
self.assert_screen("enabled_expert_mode")

def expert_mode_splash(self, expert_enabled=False):
Expand All @@ -151,17 +151,17 @@ def expert_mode_splash(self, expert_enabled=False):


def review_reject_signing(self, confirmRejection = True):
self.welcome.client.finger_touch(BUTTON_LOWER_LEFT.x, BUTTON_LOWER_RIGHT.y)
self.welcome.client.finger_touch(STAX_BUTTON_LOWER_LEFT.x, STAX_BUTTON_LOWER_RIGHT.y)
# Rejection confirmation page
self.assert_screen("confirm_rejection")
if confirmRejection:
self.welcome.client.pause_ticker()
self.welcome.client.finger_touch(BUTTON_ABOVE_LOWER_MIDDLE.x, BUTTON_ABOVE_LOWER_MIDDLE.y)
self.welcome.client.finger_touch(STAX_BUTTON_ABOVE_LOWER_MIDDLE.x, STAX_BUTTON_ABOVE_LOWER_MIDDLE.y)
self.assert_screen("reject_review")
self.review.tap()
self.welcome.client.resume_ticker()
else:
self.welcome.client.finger_touch(BUTTON_LOWER_MIDDLE.x, BUTTON_LOWER_MIDDLE.y)
self.welcome.client.finger_touch(STAX_BUTTON_LOWER_MIDDLE.x, STAX_BUTTON_LOWER_MIDDLE.y)

def stax_app(prefix) -> TezosAppScreen:
port = os.environ["PORT"]
Expand Down Expand Up @@ -201,7 +201,7 @@ def verify_reject_response_common(app, tag, err_code):
app.review.reject()
app.assert_screen("reject_review")
app.welcome.client.pause_ticker()
app.welcome.client.finger_touch(BUTTON_ABOVE_LOWER_MIDDLE.x, BUTTON_ABOVE_LOWER_MIDDLE.y)
app.welcome.client.finger_touch(STAX_BUTTON_ABOVE_LOWER_MIDDLE.x, STAX_BUTTON_ABOVE_LOWER_MIDDLE.y)
app.assert_screen("rejected")
app.review.tap()
app.welcome.client.resume_ticker()
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ setuptools
pkginfo
cryptography
base58
pytezos==3.10.3
pytezos
GitPython
pytest-xdist

0 comments on commit 6f04c75

Please sign in to comment.