1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2024-11-29 00:24:11 +01:00

sql: test failure cases

This commit is contained in:
Klas Lindfors 2021-04-08 10:33:54 +02:00
parent 26b310cda9
commit 60eba4fbac
No known key found for this signature in database
GPG Key ID: BCA00FD4B2168C0A

View File

@ -346,6 +346,10 @@ static int test_fail_authenticate_mysql1(void) {
return pam_sm_authenticate((pam_handle_t *)1, 0, sizeof(mysql_cfg) / sizeof(char*), mysql_cfg);
}
static int test_fail_authenticate_mysql2(void) {
return pam_sm_authenticate((pam_handle_t *)5, 0, sizeof(mysql_cfg) / sizeof(char*), mysql_cfg);
}
static pid_t run_mock(const char *port, const char *type) {
pid_t pid = fork();
if(pid == 0) {
@ -452,6 +456,10 @@ int main(void) {
ret = 2002;
goto out;
}
if(test_fail_authenticate_mysql2() != PAM_AUTH_ERR) {
ret = 2003;
goto out;
}
#endif
out: