From 39ad1f54bb2c1e828e19193fd8772f17731973f9 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Mon, 10 Dec 2018 14:44:39 +0000 Subject: Provide access to the status of a Nitrokey Storage This patch adds a `get_status` method to the `Storage` structure. The returned structure `StorageStatus` is based on the structure provided by libnitrokey. --- src/tests/device.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/tests/device.rs') diff --git a/src/tests/device.rs b/src/tests/device.rs index c2c5336..fed465d 100644 --- a/src/tests/device.rs +++ b/src/tests/device.rs @@ -292,3 +292,13 @@ fn lock() { assert!(device.lock().is_ok()); assert_eq!(1, count_nitrokey_block_devices()); } + +#[test] +#[cfg_attr(not(feature = "test-storage"), ignore)] +fn get_storage_status() { + let device = Storage::connect().unwrap(); + let status = device.get_status().unwrap(); + + assert!(status.serial_number_sd_card > 0); + assert!(status.serial_number_smart_card > 0); +} -- cgit v1.2.1