Test Key::list
Adds a live-against-the-device test which ensures keys can be successfully listed.
This commit is contained in:
+10
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use std::{env, sync::Mutex};
|
||||
use yubikey_piv::YubiKey;
|
||||
use yubikey_piv::{key::Key, YubiKey};
|
||||
|
||||
lazy_static! {
|
||||
/// Provide thread-safe access to a YubiKey
|
||||
@@ -29,3 +29,12 @@ fn test_verify_pin() {
|
||||
assert!(yubikey.verify_pin(b"000000").is_err());
|
||||
assert!(yubikey.verify_pin(b"123456").is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn test_list_keys() {
|
||||
let mut yubikey = YUBIKEY.lock().unwrap();
|
||||
let keys_result = Key::list(&mut yubikey);
|
||||
assert!(keys_result.is_ok());
|
||||
dbg!(keys_result.unwrap());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user