firmware/testing
2025-02-19 10:18:20 +01:00
..
data taproot singlesig 2024-09-17 15:26:13 +02:00
debug New feature: press 4 to show QR for address shown via USB protocol (mk3) 2020-02-25 09:39:08 -05:00
devtest new address format for UX display 2025-02-19 10:14:43 +01:00
.gitignore Validate TRNG using dieharder test suite 2021-03-16 14:06:36 -04:00
api.py fixes 2024-12-17 10:22:32 -05: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 unspend( & ranged unspendable taproot internal keys 2024-09-17 15:26:13 +02:00
bip39-vectors.json BIP39 passphrase additions, no UX yet 2019-03-27 11:00:43 -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 fix tests after re-word removal 2024-08-25 11:34:18 -04:00
conftest.py new address format for UX display 2025-02-19 10:14:43 +01:00
constants.py upgrade msg signing 2025-02-19 09:36:05 +01:00
core_fixtures.py mk4=Q export wallet 2024-04-08 10:39:14 -04:00
ctransaction.py farewell pycoin 2024-05-27 13:14:31 -04:00
descriptor.py fixes after master rebase 2024-09-17 15:26:13 +02:00
helpers.py new address format for UX display 2025-02-19 10:14:43 +01:00
login_settings_tests.py test fixes 2024-06-26 09:26:02 -04:00
Makefile dev squashed 2020-11-18 14:19:14 -05:00
msg.py upgrade msg signing 2025-02-19 09:36:05 +01:00
objstruct.py dev squashed 2020-11-18 14:19:14 -05:00
psbt.py fix test_iss6743 after removal of SIGHASH_ALL from psbt input 2025-02-19 09:38:59 +01: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 farewell pycoin 2024-05-27 13:14:31 -04:00
ripemd.py farewell pycoin 2024-05-27 13:14:31 -04:00
run_sim_tests.py bugfix: seedless mode restore master status bar re-draw 2024-09-16 08:54:54 -04:00
seedless_tests.py bugfix: seedless mode restore master status bar re-draw 2024-09-16 08:54:54 -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
test_addr.py new address format for UX display 2025-02-19 10:14:43 +01:00
test_address_explorer.py new address format for UX display 2025-02-19 10:14:43 +01:00
test_attended.py fix test_multisig.py; proper handling of buttons 2024-02-09 08:46:34 -05:00
test_backup.py add ability to use master bkpw for tmp seeds; add bkpw override 2025-02-19 09:39:24 +01:00
test_bbqr.py upgrade msg signing 2025-02-19 09:36:05 +01:00
test_bip39pw.py bugfix: do not re-word UX stories 2024-08-23 12:55:22 -04:00
test_bsms.py fixes after master rebase 2024-09-17 15:26:13 +02:00
test_change_pins.py mk4=Q rest fixed (sim tests) 2024-04-10 10:27:34 -04:00
test_decoders.py upgrade msg signing 2025-02-19 09:36:05 +01:00
test_drv_entro.py fix tests after re-word removal 2024-08-25 11:34:18 -04:00
test_ephemeral.py stabilize temporary seed tests 2025-02-19 09:53:24 +01:00
test_export.py add ability to switch between slip132 and bip32 representations of extended public keys in Export XPUB 2025-02-19 08:39:03 +01:00
test_hsm.py miniscript/tapscript; BSMS; show multisig/miniscript addresses in exports 2024-09-17 15:26:13 +02:00
test_miniscript.py bugfix: single key miniscript wallets 2024-12-16 09:06:39 -05:00
test_msg.py msg sign: address format from standard derivation paths if address format not specified 2025-02-19 10:18:20 +01:00
test_multisig.py new address format for UX display 2025-02-19 10:14:43 +01:00
test_nfc.py QR file share, allow to share JSON via NFC file share, allow .sig 2024-07-15 08:53:39 -04:00
test_notes.py upgrade msg signing 2025-02-19 09:36:05 +01:00
test_ownership.py new address format for UX display 2025-02-19 10:14:43 +01:00
test_paper.py taproot singlesig 2024-09-17 15:26:13 +02:00
test_pincodes.py mk4 se1 cases 2022-03-02 12:40:19 -05:00
test_pwsave.py farewell pycoin 2024-05-27 13:14:31 -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 farewell pycoin 2024-05-27 13:14:31 -04:00
test_seed_xor.py test fixes 2024-09-11 08:35:26 -04:00
test_sign.py new address format for UX display 2025-02-19 10:14:43 +01:00
test_unit.py taproot singlesig 2024-09-17 15:26:13 +02:00
test_upgrades.py kill file_picker annoying file count UI 2024-02-21 09:05:32 -05:00
test_usb.py farewell pycoin 2024-05-27 13:14:31 -04:00
test_ux.py fix tests after re-word removal 2024-08-25 11:34:18 -04:00
test_vdisk.py farewell pycoin 2024-05-27 13:14:31 -04:00
txn.py taproot singlesig 2024-09-17 15:26:13 +02: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