firmware/testing
2026-03-05 12:49:31 -05:00
..
data test low R grinding 2024-07-26 11:42:55 -04:00
devtest Updated 2026-02-24 10:00:22 -05:00
.gitignore add ./debug/* 2026-03-04 10:48:06 -05:00
api.py multiprocess simulator 2025-06-11 08:32:22 -04:00
authproxy.py bitcoin regtest 2022-05-23 15:19:48 +02:00
base58.py farewell pycoin 2024-05-27 13:14:31 -04:00
bech32.py Support for P2TR cases 2022-05-03 11:37:22 -04:00
bip32.py teleport testing protocol 2025-04-14 10:12:44 -04:00
bip39-vectors.json BIP39 passphrase additions, no UX yet 2019-03-27 11:00:43 -04:00
bip322.py prevent dupe inputs for specific kind of path_mappers 2026-03-04 10:32:52 -05:00
charcodes.py remove version.has_fatram, add version.supports_hsm 2023-12-05 12:30:39 +01:00
ckcc_protocol Making whole firmware public with single, signed commit. 2018-07-24 14:07:33 -04:00
clone_tests.py Mk hardware 2026-03-04 17:32:21 -05:00
conftest.py WIF store testing 2026-03-05 12:49:31 -05:00
constants.py multiprocess simulator 2025-06-11 08:32:22 -04:00
core_fixtures.py lower Mk4 default wrap-around from 16 to 10 (same as Q) 2025-09-18 08:35:39 -04:00
ctransaction.py farewell pycoin 2024-05-27 13:14:31 -04:00
helpers.py bugfix: PUSHDATA2 in scripts cause yikes 2025-05-12 13:03:46 -04:00
login_settings_tests.py fix login tests 2025-11-17 09:12:26 -05:00
Makefile dev squashed 2020-11-18 14:19:14 -05:00
msg.py upgrade msg signing 2025-01-21 13:05:21 -05:00
objstruct.py dev squashed 2020-11-18 14:19:14 -05:00
psbt.py [Policy] Support raw transaction versions == 3 2025-12-30 12:04:20 -05:00
pytest.ini review comments; importstyle; dissolve complex expression; ad test_ms_sign_simple to veryslow tests 2022-05-24 22:50:04 +02:00
README.md farewell pycoin 2024-05-27 13:14:31 -04:00
requirements.txt Bump requests from 2.32.3 to 2.32.4 in /testing 2025-06-10 09:11:02 -04:00
ripemd.py farewell pycoin 2024-05-27 13:14:31 -04:00
run_sim_tests.py WIF store testing 2026-03-05 12:49:31 -05:00
seedless_tests.py multiprocess simulator 2025-06-11 08:32:22 -04:00
serialize.py farewell pycoin 2024-05-27 13:14:31 -04:00
sigheader.py Support firmware limiting itself to specific hardware revs 2020-01-21 09:53:56 -05:00
teleport_cli.py nits 2025-04-14 10:17:46 -04:00
teleport_protocol.py nits 2025-04-14 10:17:46 -04:00
test_addr.py bugfix: Mk4: export loop for devices with NFC=ViDsk=0 2025-04-28 11:33:58 -04:00
test_address_explorer.py sign multisig export artifacts 2025-04-02 13:53:12 -04:00
test_attended.py fix test_multisig.py; proper handling of buttons 2024-02-09 08:46:34 -05:00
test_backup.py test fixes 2025-10-30 09:43:56 -04:00
test_bbqr.py multiprocess simulator 2025-06-11 08:32:22 -04:00
test_bip39pw.py Mk hardware 2026-03-04 17:32:21 -05:00
test_bip322.py Mk hardware 2026-03-04 17:32:21 -05:00
test_ccc.py Mk hardware 2026-03-04 17:32:21 -05:00
test_change_pins.py mk4=Q rest fixed (sim tests) 2024-04-10 10:27:34 -04:00
test_decoders.py ownership: search particular named wallet via BIP-21 wallet query param 2025-09-18 10:34:22 -04:00
test_drv_entro.py USB send keystrokes for all BIP-85 secret types 2026-01-21 11:43:32 -05:00
test_ephemeral.py fix tests 2026-02-24 11:03:00 -05:00
test_export.py show descriptor & key expression in story; signed key expression export 2026-03-04 10:46:45 -05:00
test_hobble.py WIF store testing 2026-03-05 12:49:31 -05:00
test_hsm.py Mk hardware 2026-03-04 17:32:21 -05:00
test_msg.py WIF store testing 2026-03-05 12:49:31 -05:00
test_multisig.py WIF store testing 2026-03-05 12:49:31 -05:00
test_nfc.py multisig input/output address format 2025-09-23 10:47:16 -04:00
test_notes.py test cases 2025-09-16 10:35:07 -04:00
test_ownership.py WIF store testing 2026-03-05 12:49:31 -05:00
test_paper.py multiprocess simulator 2025-06-11 08:32:22 -04:00
test_pincodes.py mk4 se1 cases 2022-03-02 12:40:19 -05:00
test_pwsave.py multiprocess simulator 2025-06-11 08:32:22 -04:00
test_rng.py initial test fixing 2022-05-13 14:05:54 +02:00
test_rolls.py add root to path for pytest to find dice rolls code 2023-01-20 15:59:31 -05:00
test_se2.py test deltamode works 2025-09-16 10:35:07 -04:00
test_seed_xor.py allow viewing QR codes for XOR split mnemonics 2025-11-18 14:53:39 -05:00
test_sign.py WIF store testing 2026-03-05 12:49:31 -05:00
test_sssp.py Mk hardware 2026-03-04 17:32:21 -05:00
test_teleport.py UX confirm loading backup 2025-10-29 16:35:48 -04:00
test_unit.py fix word_wrap; adjust tests for new double wide policy 2025-06-06 09:54:53 -04:00
test_upgrades.py Mk hardware 2026-03-04 17:32:21 -05:00
test_usb.py farewell pycoin 2024-05-27 13:14:31 -04:00
test_ux.py WIF tests, support paper wallet format 2026-03-05 11:51:21 -05:00
test_vdisk.py Mk hardware 2026-03-04 17:32:21 -05:00
test_wif.py WIF store testing 2026-03-05 12:49:31 -05:00
txn.py prevent dupe inputs for specific kind of path_mappers 2026-03-04 10:32:52 -05:00
xfp-miner.py farewell pycoin 2024-05-27 13:14:31 -04:00
xor.py Fluff 2023-03-31 11:12:14 -04:00
xpub.py farewell pycoin 2024-05-27 13:14:31 -04:00

Testing Code

None of this code ships on the product itself, but it does get used for testing purposes.

Dependencies

  • 7z

Crypto Backend

Background

  • pytest is used to track test cases and fixtures, etc
  • most test code is desktop (simulator), but it can also validate stuff from/to the device
  • some tests might only be possible in 'devmode': a unit that has booted w/ non-standard bootrom
  • some tests may be destructive for funds/seeds/wallets
  • most unit tests will work only on simulator because the useful hooks are too dangerous in product
  • you need a testnet bitcoind running for some tests (will be skipped if not present)

Command line args

  • pass argument "--sim" or "--dev" to select simulator or real device

  • will skip tests that are inappropriate

  • and/or use "marker" for bitcoind interaction: "-m bitcoind"

  • with "--dev" include "--manual" to require operator to press X/OK at times (also needs -s), so:

    --dev --manual -s

Marked Test Cases

  • test all QR code related cases with:

    py.test -m qrcode

  • txn signing where an unfinalized PSBT is created (low-R tests)

    py.test -m unfinalized

  • "bitcoind" which means test would be skipped if you don't have bitcoin core running locally (on testnet)

PSBT reference files

  • examples with IN_REDEEM_SCRIPT:

    data/2-of-2.psbt data/failed-ex.psbt data/filled_scriptsig.psbt data/multisig-single.psbt data/p2pkh+p2sh+outs.psbt data/p2pkh-p2sh-p2wpkh.psbt data/p2sh_p2wpkh.psbt data/worked-*.psbt