diff options
| author | Robin Krahl <robin.krahl@ireas.org> | 2018-05-31 11:49:12 +0200 | 
|---|---|---|
| committer | Robin Krahl <robin.krahl@ireas.org> | 2018-05-31 11:50:34 +0200 | 
| commit | e7e9ee25eb0ed798558848714408404ef2163ac7 (patch) | |
| tree | fc8afbdd06df4263bc3987fc0ed71b2f17272de3 | |
| parent | bdb5ba7157ad93461bb1deea4b232178d16ef4c9 (diff) | |
| download | nitrokey-rs-e7e9ee25eb0ed798558848714408404ef2163ac7.tar.gz nitrokey-rs-e7e9ee25eb0ed798558848714408404ef2163ac7.tar.bz2 | |
Update test documentation in the readme
| -rw-r--r-- | Cargo.toml | 1 | ||||
| -rw-r--r-- | README.md | 32 | 
2 files changed, 24 insertions, 9 deletions
| @@ -12,7 +12,6 @@ readme = "README.md"  license = "MIT"  [features] -default = ["test-no-device"]  test-no-device = []  test-pro = []  test-storage = [] @@ -31,16 +31,32 @@ supported by `nitrokey-rs`:  ## Tests -The default test suite assumes that no Nitrokey device is connected and only -performs minor sanity checks.  There is another test suite that assumes that a -Nitrokey Pro is connected (admin password `12345678`, user password `123456`). -To execute this test suite, run `cargo test --no-default-features --features  -test-pro -- --test-threads 1`.  Note that this test suite might lock your stick -if you have different passwords! +This crate has three test suites that can be selected using features.  One test +suite (feature `test-no-device`) assumes that no Nitrokey device is connected. +The two other test suites require a Nitrokey Pro (feature `test-pro`) or a +Nitrokey Storage (feature `test-storage`) to be connected. + +Use the `--features` option for Cargo to select one of the test suites.  You +cannot select more than one of the test suites at the same time.  Note that the +test suites that require a Nitrokey device assume that the device’s passwords +are the factory defaults (admin password `12345678` and user password +`123456`).  Running the test suite with a device with different passwords might +lock your device!  Also note that the test suite might delete or overwrite data +on all connected devices. + +As the tests currently are not synchronized, you have to make sure that they +are not executed in parallel.  To do so, pass the option `--test-threads 1` to +the test executable. + +In conclusion, you can use these commands to run the test suites: + +``` +$ cargo test --features test-no-device -- --test-threads 1 +$ cargo test --features test-pro -- --test-threads 1 +$ cargo test --features test-storage -- --test-threads 1 +```  The `totp_no_pin` and `totp_pin` tests can occasionally fail due to bad timing. -Also make sure to run the tests sequentially (`--test-threads 1`), otherwise -they might interfere.  ## Contact | 
