firmware/testing
2020-06-11 08:54:15 -04:00
..
data Sample test data provided by @AChow 2020-06-11 08:54:15 -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 Derived seed test code 2020-04-20 15:05:42 -04:00
.gitignore Cleanup gitignores; put closed to used directory 2018-11-26 09:00:01 -05:00
api.py Add testcase against bitcoind as discussed on PR#32 2019-11-25 10:26:20 -05: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 Missed files 2020-06-10 14:46:28 -04:00
constants.py More HSM test cases 2020-01-17 14:52:32 -05:00
helpers.py Changes for 3.0.6 2019-12-19 10:57:59 -05:00
Makefile Add CLI test case for multisig 2019-05-21 10:07:51 -04:00
objstruct.py Starting HSM test code 2020-01-15 16:32:59 -05:00
psbt.py Cleanup imports 2019-06-17 09:20:28 -04:00
pytest.ini Merge branch 'master' into swols 2020-04-30 11:37:15 -04:00
README.md Added more detail 2019-04-18 13:14:27 -04:00
requirements.txt New feature: press 4 to show QR for address shown via USB protocol (mk3) 2020-02-25 09:39:08 -05:00
sigheader.py Support firmware limiting itself to specific hardware revs 2020-01-21 09:53:56 -05:00
test_addr.py readback QR from screen and verify during test 2020-06-08 16:02:05 -04:00
test_address_explorer.py Updates to match new UX 2020-01-17 10:29:31 -05:00
test_attended.py Making whole firmware public with single, signed commit. 2018-07-24 14:07:33 -04:00
test_bip39pw.py Starting HSM test code 2020-01-15 16:32:59 -05:00
test_change_pins.py test pin changes while in duress/secondary wallet modes 2019-10-07 13:39:26 -04:00
test_drv_entro.py XPRV created from entropy, not BIP32 process; more tests 2020-04-27 10:13:15 -04:00
test_export.py Merge branch 'master' into swols 2020-04-30 11:37:15 -04:00
test_hsm.py Tighten notes field 2020-02-18 11:25:47 -05:00
test_msg.py Merge branch 'master' into swols 2020-04-30 11:37:15 -04:00
test_multisig.py Merge branch 'master' into swols 2020-04-30 11:37:15 -04:00
test_paper.py Add test case for dice-rolling method 2019-11-21 11:33:45 -05:00
test_pincodes.py Test UX for changing PIN codes, all of them 2019-10-01 16:00:34 -04:00
test_pwsave.py Change filename to be more OS-neutral 2020-04-30 11:13:31 -04:00
test_sign.py Detect and block attempts to resign UTXO w/ differing values 2020-06-10 14:34:56 -04:00
test_unit.py Add HMAC(sha512) and testcase 2020-04-16 09:46:45 -04:00
test_upgrades.py Remove risky patching of signed firmware headers 2020-02-20 08:56:06 -05:00
test_usb.py Support firmware limiting itself to specific hardware revs 2020-01-21 09:53:56 -05:00
test_ux.py Refactor 2020-04-29 10:09:07 -04:00
test-wallet-backup.txt Making whole firmware public with single, signed commit. 2018-07-24 14:07:33 -04:00
txn.py Add testcase for XPUBs in globals of PSBT for single-signer 2020-02-24 14:16:08 -05:00
xfp-miner.py Finalize 2019-05-16 13:45:00 -04: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

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