From d72641832a6c8622cf6468987b5b0aa5bd4c1c39 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Wed, 16 Jan 2019 20:20:31 +0000 Subject: 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 --- CHANGELOG.md | 1 + tests/device.rs | 1 + 2 files changed, 2 insertions(+) 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) { #[test_device] 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 -- cgit v1.2.3