Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fails on nanosp physical device assumes navigation possible on all backends #41

Open
ericpassmore opened this issue Jan 5, 2023 · 4 comments · Fixed by LedgerHQ/app-eos#20
Assignees

Comments

@ericpassmore
Copy link
Collaborator

ericpassmore commented Jan 5, 2023

When running ragger testing on a physical device the most basic test fails. All other tests pass. All tests pass on the speculos emulator.

Steps to reproduce, using nanosp device with app version 1.4.4 and firmware 1.0.4, includes PR #14

  1. Install app on device
sudo docker run --rm -ti -v "/dev/bus/usb:/dev/bus/usb" -v "$(realpath .):/app" --privileged ledger-app-builder:latest
make clean
BOLOS_SDK=$NANOSP_SDK make
BOLOS_SDK=$NANOSP_SDK make load

Follow prompts on device to remove previous version and install new version.
2. Open eos app on device
3. Run test

cd tests/functional
pytest -v --tb=short --nanosp --backend ledgerwallet -k test_app_mainmenu_settings

Error Report

==================================================== test session starts ====================================================
platform linux -- Python 3.10.6, pytest-7.2.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/eric/repos/ENF/ledger-app/tests/functional
collected 18 items / 17 deselected / 1 selected

test_app_mainmenu_settings_cfg.py::test_app_mainmenu_settings_cfg[nanosp 1.0.3] FAILED [100%]

========================================================= FAILURES ==========================================================
_______________________________________ test_app_mainmenu_settings_cfg[nanosp 1.0.3] ________________________________________
test_app_mainmenu_settings_cfg.py:37: in test_app_mainmenu_settings_cfg
assert data_allowed is True
E assert False is True
--------------------------------------------------- Captured stderr setup ---------------------------------------------------
[2023-01-05 05:29:46,759][INFO] ragger.logger - Starting LedgerWalletBackend stream
---------------------------------------------------- Captured log setup -----------------------------------------------------
INFO ragger.logger:ledgerwallet.py:54 Starting LedgerWalletBackend stream
--------------------------------------------------- Captured stderr call ----------------------------------------------------
[2023-01-05 05:29:46,837][DEBUG] ragger.apdu_logger - => d406000000
[2023-01-05 05:29:46,842][DEBUG] ragger.apdu_logger - <= 000104049000
[2023-01-05 05:29:46,842][DEBUG] ragger.apdu_logger - <= 000104049000
[2023-01-05 05:29:46,843][DEBUG] ragger.apdu_logger - => d406000000
[2023-01-05 05:29:46,848][DEBUG] ragger.apdu_logger - <= 000104049000
[2023-01-05 05:29:46,849][DEBUG] ragger.apdu_logger - <= 000104049000
----------------------------------------------------- Captured log call -----------------------------------------------------
DEBUG ragger.apdu_logger:ledgerwallet.py:82 => d406000000
DEBUG ragger.apdu_logger:ledgerwallet.py:86 <= 000104049000
DEBUG ragger.apdu_logger:ledgerwallet.py:37 <= 000104049000
DEBUG ragger.apdu_logger:ledgerwallet.py:82 => d406000000
DEBUG ragger.apdu_logger:ledgerwallet.py:86 <= 000104049000
DEBUG ragger.apdu_logger:ledgerwallet.py:37 <= 000104049000
================================================== short test summary info ==================================================
FAILED test_app_mainmenu_settings_cfg.py::test_app_mainmenu_settings_cfg[nanosp 1.0.3] - assert False is True
============================================= 1 failed, 17 deselected in 2.16s ==============================================

@ericpassmore ericpassmore self-assigned this Jan 5, 2023
@ericpassmore ericpassmore changed the title Tests Fail on nanosp device Allowed Data always false on nanosp firmware 1.0.4 Get_App_Configuration Jan 6, 2023
@ericpassmore ericpassmore changed the title Allowed Data always false on nanosp firmware 1.0.4 Get_App_Configuration Get_App_Configuration Allowed Data always false on nanosp firmware 1.0.4 Jan 6, 2023
@ericpassmore
Copy link
Collaborator Author

ericpassmore commented Jan 6, 2023

Found the issue, its the contract data allow setting

# CLA 0xD4 
# INS_GET_APP_CONFIGURATION 0x06

def send_get_app_configuration(self) -> (bool, (int, int, int)):
rapdu: RAPDU = self._client.exchange(CLA, INS.INS_GET_APP_CONFIGURATION, 0, 0, b"")
response = rapdu.data
# response = dataAllowed (1) ||
# LEDGER_MAJOR_VERSION (1) ||
# LEDGER_MINOR_VERSION (1) ||
# LEDGER_PATCH_VERSION (1)
assert len(response) == 4
data_allowed = int(response[0]) == 1
major = int(response[1])
minor = int(response[2])
patch = int(response[3])
return data_allowed, (major, minor, patch)

@ericpassmore
Copy link
Collaborator Author

Tried with previous version of EOS APP 1.4.3, still failed on nanosp hardware

@ericpassmore
Copy link
Collaborator Author

ericpassmore commented Jan 6, 2023

Trying to isolate if this is a nanosp 1.0.4 firmware issue with instructions "d406000000"

Next step downgrade firmware on nanosp physical device to 1.0.3 and validate tests pass. Waiting on answer from discord dev support.

@ericpassmore
Copy link
Collaborator Author

Ok, figured this out. Ragger.Navigation does not work on physical devices. Will suggest adding a check for the SpeculosBackend before executing the navigation commands and second data_allowed check

@ericpassmore ericpassmore changed the title Get_App_Configuration Allowed Data always false on nanosp firmware 1.0.4 Tests fails on nanosp physical device assumes navigation possible on all backends Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant