Handle metadata command not being supported in test (#516)
Some YubiKeys don't support this command. Instead of failing the test when it happens, log a warning message instead.
This commit is contained in:
committed by
GitHub
parent
78313360a1
commit
75ce24a3ea
@@ -303,9 +303,14 @@ fn test_read_metadata() {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let metadata = piv::metadata(&mut yubikey, slot).unwrap();
|
match piv::metadata(&mut yubikey, slot) {
|
||||||
|
Ok(metadata) => assert_eq!(metadata.public, Some(generated)),
|
||||||
assert_eq!(metadata.public, Some(generated));
|
Err(Error::NotSupported) => {
|
||||||
|
// Some YubiKeys don't support metadata
|
||||||
|
eprintln!("metadata not supported by this YubiKey");
|
||||||
|
}
|
||||||
|
Err(err) => panic!("{}", err),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user