firmware/testing
2024-01-25 14:42:55 -05:00
..
data bugfix: prevent yikes in clone coldcard - creating backup with bypass_tmp=True on master secret 2024-01-04 11:52:47 -05: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 HW Accelerated AES CTR for BSMS and passphrase saver 2024-01-12 08:32:14 -05:00
.gitignore Validate TRNG using dieharder test suite 2021-03-16 14:06:36 -04:00
api.py forgotten BDB cope 2024-01-04 11:52:47 -05:00
authproxy.py bitcoin regtest 2022-05-23 15:19:48 +02:00
bech32.py Support for P2TR cases 2022-05-03 11:37:22 -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 HSM: 'wallet' rule enabled for miniscript; allow miniscript address show 2024-01-18 09:22:14 -05:00
constants.py mainnet/testnet separation 2023-08-30 10:54:52 -04:00
descriptor.py Miniscript 2023-06-20 08:36:58 -04:00
helpers.py fix tests 2024-01-04 11:52:47 -05:00
Makefile dev squashed 2020-11-18 14:19:14 -05:00
msg.py verify digest for detached signature files 2023-02-21 09:21:20 -05:00
objstruct.py dev squashed 2020-11-18 14:19:14 -05:00
psbt.py PSBTv2 2023-10-24 14:30:35 -04:00
pytest.ini remove label from bitcoin core export - in 24.1 label is no longer supported with ranged descriptors 2023-06-20 08:36:58 -04:00
README.md initial test fixing 2022-05-13 14:05:54 +02:00
requirements.txt Taproot keyspend & Tapscript multisig sortedmulti_a (tree depth = 0) 2023-05-09 08:59:39 -04:00
run_sim_tests.py restore to main se2 secret without reboot; active ephemeral seeds have first home menu item [XFP]; tests reorg - created separate test_backup.py; add ability to remove ephemeral seed settings via Restore Seed 2023-10-24 14:30:35 -04:00
sigheader.py Support firmware limiting itself to specific hardware revs 2020-01-21 09:53:56 -05:00
test_addr.py testing: add BIP86 vectors 2024-01-25 14:42:55 -05:00
test_address_explorer.py bugfix on MacOS 2023-09-05 11:12:08 -04:00
test_attended.py fake_txn segwit_in fix 2023-04-25 14:09:56 -04:00
test_backup.py fix tests 2024-01-04 11:52:47 -05:00
test_bip39pw.py xprv master seed with tmp seeds and bip39 passphrase 2024-01-04 11:52:47 -05:00
test_bsms.py mainnet/testnet separation 2023-08-30 10:54:52 -04:00
test_change_pins.py fix change_pin test 2024-01-04 11:52:47 -05:00
test_drv_entro.py fix tests 2024-01-04 11:52:47 -05:00
test_ephemeral.py fix tests 2024-01-04 11:52:47 -05:00
test_export.py fix tests 2024-01-04 11:52:47 -05:00
test_hsm.py HSM: 'wallet' rule enabled for miniscript; allow miniscript address show 2024-01-18 09:22:14 -05:00
test_miniscript.py bugfix: address format not defined in ShowMiniscriptAddress 2024-01-12 08:34:07 -05:00
test_msg.py test fixes after Address Explorer label changes 2023-05-11 08:13:51 -04:00
test_multisig.py cope with future removal of BDB wallet from bitcoin client 2024-01-04 11:52:47 -05:00
test_nfc.py vdisk UX 2022-12-19 14:42:06 -05:00
test_paper.py fix broken tests after master port 2023-09-05 11:12:08 -04:00
test_pincodes.py mk4 se1 cases 2022-03-02 12:40:19 -05:00
test_pwsave.py pwsave menu UX rework; do not allow empty bip39 passphrase 2024-01-04 11:52:47 -05: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 UX: rename Ephemeral Seed to Temporary Seed 2023-10-24 14:30:35 -04:00
test_seed_xor.py provide info about Tx level locktimes (nLocktime, nSequence) when signing 2024-01-04 11:52:47 -05:00
test_sign.py provide info about Tx level locktimes (nLocktime, nSequence) when signing 2024-01-04 11:52:47 -05:00
test_unit.py HW Accelerated AES CTR for BSMS and passphrase saver 2024-01-12 08:32:14 -05:00
test_upgrades.py hacky upgrades ?fixed? 2022-05-17 22:51:52 +02:00
test_usb.py unconditional skip for usb fuzz test (ckcc enforces msg length) 2022-05-17 22:33:56 +02:00
test_ux.py xprv master seed with tmp seeds and bip39 passphrase 2024-01-04 11:52:47 -05:00
test_vdisk.py vdisk UX 2022-12-19 14:42:06 -05:00
txn.py PSBTv2 2023-10-24 14:30:35 -04:00
xfp-miner.py dev squashed 2020-11-18 14:19:14 -05:00
xor.py Fluff 2023-03-31 11:12:14 -04: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.

Dependencies

  • 7z

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