firmware/testing
2026-06-25 11:18:33 -04: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 testing: cope with bitcoin core v30 2026-06-19 12:50:10 -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 BIP-322 changes after BIP got in to the complete state 2026-06-22 11:20:44 -04: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 bugfix: Delta Mode Trick PIN restore from backup 2026-04-20 11:17:52 -04:00
conftest.py WIF Store upgrade 2026-06-22 12:46:50 -04:00
constants.py multiprocess simulator 2025-06-11 08:32:22 -04:00
core_fixtures.py bugfix: Delta Mode Trick PIN restore from backup 2026-04-20 11:17:52 -04:00
ctransaction.py farewell pycoin 2024-05-27 13:14:31 -04:00
electrum.py WIF Store upgrade 2026-06-22 12:46:50 -04:00
helpers.py bugfix: p2pk 2026-06-23 11:43:39 -04:00
login_settings_tests.py revert SSSP bypass PIN login 2026-06-25 11:18:33 -04: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 Reject witness-only UTXO for legacy inputs; Suppress fee for unverified witness UTXOs;normalize legacy inputs to proper utxo 2026-06-23 11:25:53 -04: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.4 to 2.33.0 in /testing 2026-06-19 10:58:24 -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 bundle small fixes 2026-06-19 10:56:45 -04:00
serialize.py farewell pycoin 2024-05-27 13:14:31 -04:00
sighash.py BIP-322 changes after BIP got in to the complete state 2026-06-22 11:20:44 -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 bugfix: default menu position in custom path address format menu 2026-04-20 15:18:30 -04:00
test_attended.py fix test_multisig.py; proper handling of buttons 2024-02-09 08:46:34 -05:00
test_backup.py bugfix: attribute error on exception object + more 7z header tests 2026-04-20 15:19:31 -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 fix tests 2026-06-24 08:22:54 -04:00
test_ccc.py stabilize tests 2026-06-22 10:39:46 -04: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 final solution can_cancel=True 2026-04-20 12:40:07 -04:00
test_ephemeral.py bundle small fixes 2026-06-19 10:56:45 -04: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 apply note or pwd as b39 passphrase 2026-06-24 14:07:25 -04:00
test_hsm.py improve USB validation 2026-06-23 10:55:08 -04:00
test_msg.py bundle small fixes 2026-06-19 10:56:45 -04:00
test_multisig.py fix tests 2026-06-24 08:22:54 -04:00
test_nfc.py bugfix: NFC verify address wrong error message 2026-04-20 15:21:43 -04:00
test_notes.py apply note or pwd as b39 passphrase 2026-06-24 14:07:25 -04:00
test_ownership.py bundle small fixes 2026-06-19 10:56:45 -04: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 bundle small fixes 2026-06-19 10:56:45 -04:00
test_sign.py bugfix: p2pk 2026-06-23 11:43:39 -04:00
test_sssp.py testing: block_h bumped for SSSP too, when CCC overrides SSSP block 2026-06-19 12:50:26 -04:00
test_teleport.py Reject witness-only UTXO for legacy inputs; Suppress fee for unverified witness UTXOs;normalize legacy inputs to proper utxo 2026-06-23 11:25:53 -04:00
test_unit.py bundle small fixes 2026-06-19 10:56:45 -04:00
test_upgrades.py Mk hardware 2026-03-04 17:32:21 -05:00
test_usb.py improve USB validation 2026-06-23 10:55:08 -04:00
test_ux.py stabilize tests 2026-06-22 10:39:46 -04:00
test_vdisk.py Mk hardware 2026-03-04 17:32:21 -05:00
test_wif.py WIF Store upgrade 2026-06-22 12:46:50 -04:00
txn.py bugfix: p2pk 2026-06-23 11:43:39 -04: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