firmware/testing
2022-01-13 13:27:51 -05:00
..
data cleanups 2021-09-15 11:28:43 -04: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 SE2 testing, countdown feature, more 2021-12-21 08:29:26 -05:00
.gitignore Validate TRNG using dieharder test suite 2021-03-16 14:06:36 -04:00
api.py support importdescriptors cmd of Core 0.21 2021-09-02 11:55:32 -04:00
bech32.py Making whole firmware public with single, signed commit. 2018-07-24 14:07:33 -04:00
bip39-vectors.json BIP39 passphrase additions, no UX yet 2019-03-27 11:00:43 -04:00
ckcc_protocol Making whole firmware public with single, signed commit. 2018-07-24 14:07:33 -04:00
conftest.py RF testing for NFC 2022-01-13 13:27:37 -05:00
constants.py multisig changes 2020-11-23 14:52:59 -05:00
helpers.py convert slip132 into bip32 2021-04-19 11:20:18 -04:00
Makefile dev squashed 2020-11-18 14:19:14 -05:00
objstruct.py dev squashed 2020-11-18 14:19:14 -05:00
psbt.py dev squashed 2020-11-18 14:19:14 -05:00
pytest.ini signing over NFC 2021-09-10 16:30:24 -04:00
README.md Avoid producing 72 byte signatures (low-R) 2021-07-27 13:57:27 -04:00
requirements.txt RF testing for NFC 2022-01-13 13:27:37 -05:00
sigheader.py Support firmware limiting itself to specific hardware revs 2020-01-21 09:53:56 -05:00
test_addr.py Add marker for QR-related tests 2021-07-20 09:29:41 -04:00
test_address_explorer.py cleanups 2021-09-15 11:28:43 -04:00
test_attended.py note 2021-12-14 10:16:06 -05:00
test_bip39pw.py passing tests 2021-04-28 11:54:12 -04:00
test_change_pins.py test cases updated 2021-03-12 09:58:27 -05:00
test_drv_entro.py Add marker for QR-related tests 2021-07-20 09:29:41 -04:00
test_export.py Virtdisk working better 2021-11-05 10:47:24 -04:00
test_hsm.py Standardize on BIP-nn in place of BIPnn 2021-04-19 13:51:24 -04:00
test_msg.py Avoid producing 72 byte signatures (low-R) 2021-07-27 13:57:27 -04:00
test_multisig.py Avoid producing 72 byte signatures (low-R) 2021-07-27 13:57:27 -04:00
test_nfc.py RF testing for NFC 2022-01-13 13:27:37 -05:00
test_paper.py skip paper wallet tests if feature not installed 2021-01-07 09:20:16 -05:00
test_pincodes.py More trick-pin tests, some cleanup 2021-12-16 13:07:30 -05:00
test_pwsave.py Bugfix: dup entries in pw restore menu not rendered right 2021-09-02 10:08:39 -04:00
test_rng.py Validate TRNG using dieharder test suite 2021-03-16 14:06:36 -04:00
test_se2.py mk4 vs mk3 fixes 2022-01-13 13:27:51 -05:00
test_seed_xor.py Bugfix: after seed XOR for seed import, menu wrong 2021-07-27 14:32:43 -04:00
test_sign.py Virtdisk working better 2021-11-05 10:47:24 -04:00
test_unit.py mk4 vs mk3 fixes 2022-01-13 13:27:51 -05:00
test_upgrades.py test cases updated 2021-03-12 09:58:27 -05:00
test_usb.py mk4 vs mk3 fixes 2022-01-13 13:27:51 -05:00
test_ux.py More trick-pin tests, some cleanup 2021-12-16 13:07:30 -05:00
txn.py Support bits/mBtc/sats for value display 2021-04-07 10:10:12 -04:00
xfp-miner.py dev squashed 2020-11-18 14:19:14 -05:00
xpub.py Useful helper 2020-12-10 10:35:58 -05:00

Testing Code

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

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