diff options
Diffstat (limited to 'src/test.rs')
| -rw-r--r-- | src/test.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test.rs b/src/test.rs index ee9bc03..bdc66dc 100644 --- a/src/test.rs +++ b/src/test.rs @@ -20,7 +20,6 @@ #[cfg(test)] mod core { - use std::borrow::BorrowMut; use crate::datastructures::{rand_str, Config, TestSuite}; use crate::{cmd_add_user, cmd_authenticate_cookie, cmd_init, cmd_repo_user_control}; use crate::{get_arg_matches, IOModule}; @@ -29,6 +28,7 @@ mod core { Argon2, }; use redis::AsyncCommands; + use std::borrow::BorrowMut; use std::io::{Read, Write}; use std::path::Path; use std::path::PathBuf; @@ -370,12 +370,14 @@ mod core { #[test] fn test_pam() { - let service = "system-login"; + let service = option_env!("pam_service").unwrap_or("system-auth"); let user = option_env!("pam_user").unwrap_or("user"); let password = option_env!("pam_password").unwrap_or("password"); let mut auth = pam::Authenticator::with_password(service).unwrap(); - auth.get_handler().borrow_mut().set_credentials(user, password); + auth.get_handler() + .borrow_mut() + .set_credentials(user, password); assert!(auth.authenticate().is_ok() && auth.open_session().is_ok()) } } |
