mirror of
https://github.com/trussed-dev/piv-authenticator.git
synced 2026-06-20 04:16:15 -07:00
Add basic opensc test
This commit is contained in:
@@ -51,6 +51,8 @@ default = []
|
||||
strict-pin = []
|
||||
std = []
|
||||
virtual = ["std", "vpicc","trussed/virt"]
|
||||
pivy-tests = []
|
||||
opensc-tests = []
|
||||
|
||||
log-all = []
|
||||
log-none = []
|
||||
|
||||
@@ -11,7 +11,7 @@ build-cortex-m4:
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
cargo test --features virtual
|
||||
cargo test --features virtual,pivy-tests,opensc-tests
|
||||
|
||||
.PHONY: check
|
||||
check:
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2022 Nitrokey GmbH
|
||||
// SPDX-License-Identifier: LGPL-3.0-only
|
||||
|
||||
#![cfg(all(feature = "virtual", feature = "opensc-tests"))]
|
||||
|
||||
mod card;
|
||||
|
||||
use card::with_vsc;
|
||||
|
||||
use expectrl::{spawn, Eof, Regex, WaitStatus};
|
||||
|
||||
#[test]
|
||||
fn list() {
|
||||
with_vsc(|| {
|
||||
let mut p = spawn("piv-tool -n").unwrap();
|
||||
p.check("Using reader with a card: Virtual PCD 00 00")
|
||||
.unwrap();
|
||||
p.check("Personal Identity Verification Card").unwrap();
|
||||
p.check(Eof).unwrap();
|
||||
assert_eq!(p.wait().unwrap(), WaitStatus::Exited(p.pid(), 0));
|
||||
});
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Copyright (C) 2022 Nitrokey GmbH
|
||||
// SPDX-License-Identifier: LGPL-3.0-only
|
||||
|
||||
#![cfg(feature = "virtual")]
|
||||
#![cfg(all(feature = "virtual", feature = "pivy-tests"))]
|
||||
|
||||
mod card;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user