diff options
authorRobin Krahl <robin.krahl@ireas.org>2019-01-16 20:20:31 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-01-16 21:22:48 +0100
commitd72641832a6c8622cf6468987b5b0aa5bd4c1c39 (patch)
parent3a8669cea4aa4b32fee3336cb9be4ec66d3dc2c2 (diff)
Add delay between factory reset and building AES key in tests
There seems to be a bug in libnitrokey or the Nitrokey Storage firmware that causes problems when chaining factory reset and build_AES_keys without delay (upstream issue [0]). [0] https://github.com/Nitrokey/nitrokey-storage-firmware/issues/80
2 files changed, 2 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bae77e0..89c9d9a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
- (Re-)add `CommandError::RngError` variant.
- Account for the possibility that an empty string returned by libnitrokey can
not only indicate an error but also be a valid return value.
+- Make test cases more robust and avoid side effects on other test cases.
# v0.3.2 (2019-01-12)
- Make three additional error codes known: `CommandError::StringTooLong`,
diff --git a/tests/device.rs b/tests/device.rs
index 8efaace..849d2ff 100644
--- a/tests/device.rs
+++ b/tests/device.rs
@@ -462,6 +462,7 @@ fn get_production_info(device: Storage) {
fn clear_new_sd_card_warning(device: Storage) {
assert_eq!(Ok(()), device.factory_reset(ADMIN_PASSWORD));
+ thread::sleep(time::Duration::from_secs(3));
assert_eq!(Ok(()), device.build_aes_key(ADMIN_PASSWORD));
// We have to perform an SD card operation to reset the new_sd_card_found field