aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-14 17:34:34 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-01-14 18:37:07 +0100
commitc34b56b2b4c317947fd8fd3ae6c1fa3a773ee775 (patch)
treee152045fe0cb067af5724c6bb7ac23c721793700 /tests
parent0262ed2e614e9222b69970289a32ddb3683b3535 (diff)
downloadnitrokey-rs-c34b56b2b4c317947fd8fd3ae6c1fa3a773ee775.tar.gz
nitrokey-rs-c34b56b2b4c317947fd8fd3ae6c1fa3a773ee775.tar.bz2
Add the clear_new_sd_card_warning method to Storage
The clear_new_sd_card_warning method calls the libnitrokey NK_clear_new_sd_card_warning function to reset the corresponding flag in the Storage status.
Diffstat (limited to 'tests')
-rw-r--r--tests/device.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/device.rs b/tests/device.rs
index 915bd3a..9e2bba2 100644
--- a/tests/device.rs
+++ b/tests/device.rs
@@ -460,6 +460,22 @@ fn get_production_info(device: Storage) {
}
#[test_device]
+fn clear_new_sd_card_warning(device: Storage) {
+ assert_eq!(Ok(()), device.factory_reset(ADMIN_PASSWORD));
+
+ // We have to perform an SD card operation to reset the new_sd_card_found field
+ assert_eq!(Ok(()), device.lock());
+
+ let status = device.get_status().unwrap();
+ assert!(status.new_sd_card_found);
+
+ assert_eq!(Ok(()), device.clear_new_sd_card_warning(ADMIN_PASSWORD));
+
+ let status = device.get_status().unwrap();
+ assert!(!status.new_sd_card_found);
+}
+
+#[test_device]
fn export_firmware(device: Storage) {
assert_eq!(
Err(CommandError::WrongPassword),