Commit Graph

88 Commits

Author SHA1 Message Date
Andrew Chow
84315dd5de Build and test with Trezor T emulator 2019-06-16 13:02:32 -04:00
Andrew Chow
ef816628e1 Switch to Trezor monorepo 2019-06-16 10:45:08 -04:00
Andrew Chow
6952edd879 Introduce full_type in tests for distinguishing between device models 2019-06-16 10:45:08 -04:00
Andrew Chow
4d21f29127 ignore other devices when checking that the coldcard has started 2019-05-30 18:44:18 -04:00
Andrew Chow
54e14ba301 Change the order devices are tested in
Test the digitalbitbox first because it will self wipe if the wrong
password is given too many times (by other tests) which causes test
to fail.

Then, group up tests by simulator, those with simulators started at
the beginning (dbb and coldcard) go first. Then those with simulators
started for each test (trezor and keepkey). Lastly the test that
requires a physical device.
2019-05-30 18:44:18 -04:00
Andrew Chow
1c33312bb1 Test need_passphrase_sent and need_pin_sent 2019-05-30 18:44:18 -04:00
Andrew Chow
a4a3aff89b
Merge #169: Add installudevrules command for linux
cada7f5 Add installudevrules command for linux (lontivero)

Pull request description:

  This PR is for discussing the concept and the implementation. The idea is to make it easier for Linux users to install the udev rules in their systems by running:

  ```
  $ hwi installudevrules
  ```

ACKs for commit cada7f:
  achow101:
    ACK cada7f5ce0

Tree-SHA512: 54a11b9bbbf8f4258a32a8503694026fda6adfe301bc3f44ed85c155426b894d512698046f14d9b62600d80614f2a6bd28d1d77ff0cfd2859c0f0786bc4013d6
2019-05-28 15:31:52 -04:00
lontivero
cada7f5ce0 Add installudevrules command for linux 2019-05-28 15:43:54 -03:00
Andrew Chow
54bd6687cc Actually test that displayaddress is returning correct output 2019-05-21 19:34:15 -04:00
Andrew Chow
cea784ef60 tests: Replace remaining process_commands with self.do_command in tests 2019-05-21 19:09:18 -04:00
Andrew Chow
70e31cad0c tests: Properly escape arguments for cli interface 2019-05-21 19:09:10 -04:00
Andrew Chow
67359835eb Have setup_environment.sh remove emulator.img files for trezor and keepkey 2019-04-30 19:29:15 -04:00
Andrew Chow
18857d9cd0 Add interactive option and move setup and restore to interactive only 2019-03-14 16:39:12 -04:00
Andrew Chow
0dd2e86394
Merge #126: Add option to enter commands over stdin
49bc7fa Add tests for stdin interface and travis job (Andrew Chow)
0185391 Add --stdin to enter commands and arguments over stdin (Andrew Chow)

Pull request description:

  This PR adds a `--stdin` option which allows arguments to be entered over stdin in a way similar to bitcoin-cli's `--stdin` option.

  Built on #125 and to test the `stdin` interface

Tree-SHA512: 48e04298b3537ac59523e40fab3e1709d2ec4ca50284b0bcbbe9062f284bcfbf0cbc4492bd5b8fa673be35375fe8d9436d4aaec0a304b574ba411ee0fb284c0d
2019-03-14 15:00:24 -04:00
Andrew Chow
49bc7fa5da Add tests for stdin interface and travis job 2019-03-11 10:23:45 -04:00
Andrew Chow
376245ae0f Update tests documentation with new tests 2019-03-09 01:17:05 -05:00
Andrew Chow
8931ae0e90 Run tests using the binary distribution 2019-03-08 00:42:43 -05:00
Andrew Chow
8d738ee31c
Merge #125: Test how the CLI deals with really big transactions
1a2b67d Test how a very large transaction is handled (Andrew Chow)
c69c0ee Add travis job for cli interface test (Andrew Chow)
e594a0b Allow specifiying a different interface for using HWI in tests (Andrew Chow)

Pull request description:

  It was mentioned in the #bitcoin-core-dev IRC channel a few days ago that really big transactions can cause problems if it was entered as an argument in the shell. This PR adds to the test suite the option to run the tests with different interfaces to allow us to test this. It can use the "library" interface which is what we currently do. This interface calls `process_commands` directly. The `cli` interface uses `subprocess` to run the `hwi` command in the shell to test the command line interface. This will emulate entering a command in the shell. This allows us to test the big transaction case which has been added. This case only tests the interface and not whether the transaction is signed. This test should pass when using the `library` interface but not when using the `cli`. Both interfaces will also be tested on travis as separate jobs.

Tree-SHA512: 47c85c3b4df66aaa552dc55028267024ea53a56f8028bc0e161fd390ea3e96166f3d9157f320bbf922c63fd5726f13c3918c75cbd3a1311c1536477c0605dcee
2019-02-28 21:47:56 -05:00
Andrew Chow
6c9964ef84 Fix Digital Bitbox tests for API changes
The Digital Bitbox API changed slightly which broke our tests due to
the ordering of some operations. Normal usage is still fine.
2019-02-25 16:03:50 -05:00
Andrew Chow
1a2b67d1f3 Test how a very large transaction is handled 2019-02-19 10:21:58 -05:00
Andrew Chow
e594a0b4b3 Allow specifiying a different interface for using HWI in tests 2019-02-19 10:21:58 -05:00
Andrew Chow
75a915edba
Merge #130: Implement descriptor checksums
2d62204 Use descriptors with checksums in TestSignTx (Andrew Chow)
c2ff20b Use descriptor class in getkeypool (Andrew Chow)
f2aff4d Add descriptor checksums and tests (Andrew Chow)

Pull request description:

  Adds checksums to the Descriptor class. Checksums are optional, but if provided, must be valid. `getkeypool` is also changed to use the descriptor class to return checksums. Tests are updated so that all descriptors used have checksums.

  Closes #129

Tree-SHA512: f77b44a1edbc02d4dc6130fb4f6a97aadf2f12fef90f4b93e734df7374decb060e5486f0a5a03074aa696f6af3c772a52380bbce3ef045042e00597791aacbd1
2019-02-19 10:19:51 -05:00
Andrew Chow
ff8e257839 travis: fix bitcoind update 2019-02-18 17:17:01 -05:00
Andrew Chow
2d622046ce Use descriptors with checksums in TestSignTx 2019-02-17 18:11:18 -05:00
Andrew Chow
f2aff4d642 Add descriptor checksums and tests 2019-02-17 17:41:45 -05:00
Andrew Chow
dba7acd5ed
Merge #127: Update things now that Bitcoin Core master is usable
aac8243 Update Bitcoin Core usage docs (Andrew Chow)
daa99c7 Change to building from bitcoin master (Andrew Chow)

Pull request description:

  Updates `setup_environment.sh` to build Bitcoin Core master branch instead of my hww branch.

  Updates the Bitcoin Core usage documentation.

Tree-SHA512: f7a9f2c6cb10f67cfc8b4a8a757d37e2ef8c37e26d5297215e6c8612780496b476d41c614106286813141b1278173094149df2b34a02fc64a71aec844fb081dc
2019-02-15 15:06:01 -05:00
Sjors Provoost
a71658cf6d
displayaddress: descriptor support, make --path a named argument 2019-02-15 08:44:41 +01:00
Andrew Chow
daa99c7ea3 Change to building from bitcoin master 2019-02-15 00:36:04 -05:00
Sjors Provoost
163f926d52
Add descriptor class 2019-02-14 09:35:17 +01:00
Andrew Chow
f7d04ff2eb Replace ckcc dependency with our own version of the library itself 2019-02-12 17:26:27 -05:00
Andrew Chow
f0c5aa7d3c Add Keepkey to Trezorlib and have KeepkeyClient use TrezorClient 2019-02-12 17:26:27 -05:00
Andrew Chow
2693ae34f6 Change TrezorClient to do what TrezorNoInit did 2019-02-12 17:26:27 -05:00
Andrew Chow
aa3665c971 Replace trezorlib with our own stripped down version 2019-02-12 17:26:27 -05:00
Andrew Chow
a38e993607 Tests and fixes for remaining Ledger commands
Tests and fixes for promptpin, sendpin, setup, wipe, restore, backup,
and signmessage commands
2019-02-10 10:45:29 -05:00
Andrew Chow
d627634ce6 Tests and fixes for remainig Keepkey commands.
Tests for setup, wipe, restore, backup, promptpin, sendpin
2019-02-10 10:45:29 -05:00
Andrew Chow
cf152b709a Tests and fixes for remaining Trezor commands
Tests and fixes for Trezor signmessage, setup, wipe, backup, promptpin, and sendpin
2019-02-10 10:45:29 -05:00
Andrew Chow
40abbc2927 Tests and fixes for remaining Digital Bitbox commands
Adds tests for setup, wipe, backup, restore, displayaddress,
promptpin, and sendpin.
2019-02-10 10:45:29 -05:00
Andrew Chow
0085b8fd2c Tests and fixes remaining commands for Coldcard
Tests and fixes for promptpin, sendpin, and restore and backup commands on Coldcard
2019-02-10 10:45:29 -05:00
Andrew Chow
5c54c0f6ee Add tests and fixes for invalid paths 2019-02-10 10:45:29 -05:00
Andrew Chow
a7d0121c7b Tests for nonexistent fingerprints and device types 2019-02-10 10:45:29 -05:00
Andrew Chow
cd0c994d6d Test signtx with all three output types as tx outputs 2019-02-10 10:45:29 -05:00
Andrew Chow
4c3a6df1b7 Use HWWErrors instead of built-ins 2019-02-04 10:04:30 -05:00
Andrew Chow
5ea8831d55 Document Keepkey emulator build instructions 2019-01-24 20:52:09 -05:00
Andrew Chow
af52908206 Use Digital Bitbox's repo for simulator 2019-01-24 20:47:28 -05:00
Andrew Chow
2ddd4ed41a Refactor to make hwilib more like a library
Moves the command argument parsing to hwi.py. Instead of each function
taking args and client, they now take client and whatever else they
need. hwi.py handles the conversion from args and client to the actual
arguments.
2019-01-19 16:58:31 -05:00
Andrew Chow
0b870d8673 Document how to build the simulator 2019-01-14 17:31:16 -05:00
Andrew Chow
8f1dff2f04 Change Digital Bitbox test to use simulator 2019-01-14 17:31:16 -05:00
Andrew Chow
07c97716e7 Build digital bitbox simulator in setup_environment.sh 2019-01-14 17:31:16 -05:00
Andrew Chow
b404a5050d Include the device type in test case output 2019-01-14 15:42:27 -05:00
Andrew Chow
a0fa20888a Show full test case names in output 2019-01-14 15:00:41 -05:00