summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/pro.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/tests/pro.rs b/src/tests/pro.rs
index feadcbc..9cdc586 100644
--- a/src/tests/pro.rs
+++ b/src/tests/pro.rs
@@ -44,11 +44,7 @@ fn connect() {
assert!(::connect_model(Model::Storage).is_err());
}
-#[test]
-#[cfg_attr(not(feature = "test-pro"), ignore)]
-fn disconnect() {
- set_debug(false);
- ::connect().unwrap();
+fn assert_empty_serial_number() {
unsafe {
let ptr = ::nitrokey_sys::NK_device_serial_number();
assert!(!ptr.is_null());
@@ -59,6 +55,18 @@ fn disconnect() {
#[test]
#[cfg_attr(not(feature = "test-pro"), ignore)]
+fn disconnect() {
+ set_debug(false);
+ ::connect().unwrap();
+ assert_empty_serial_number();
+ ::connect().unwrap().authenticate_admin(ADMIN_PASSWORD).unwrap();
+ assert_empty_serial_number();
+ ::connect().unwrap().authenticate_user(USER_PASSWORD).unwrap();
+ assert_empty_serial_number();
+}
+
+#[test]
+#[cfg_attr(not(feature = "test-pro"), ignore)]
fn get_serial_number() {
let device = get_test_device();
let result = device.get_serial_number();