diff --git a/tests/server/torture_server_auth_kbdint.c b/tests/server/torture_server_auth_kbdint.c index ca490edf..8a746c99 100644 --- a/tests/server/torture_server_auth_kbdint.c +++ b/tests/server/torture_server_auth_kbdint.c @@ -605,8 +605,8 @@ static int setup_kbdint_server(void **state) setenv("SOCKET_WRAPPER_DEFAULT_IFACE", "21", 1); unsetenv("PAM_WRAPPER"); - /* Wait 200ms */ - usleep(200 * 1000); + rc = torture_wait_for_daemon(15); + assert_int_equal(rc, 0); tss->state = s; tss->ss = ss; diff --git a/tests/torture.c b/tests/torture.c index c07a0b2e..3b700a4e 100644 --- a/tests/torture.c +++ b/tests/torture.c @@ -905,7 +905,7 @@ static void torture_setup_create_sshd_config(void **state, bool pam) torture_write_file(s->srv_config, sshd_config); } -static int torture_wait_for_daemon(unsigned int seconds) +int torture_wait_for_daemon(unsigned int seconds) { struct ssh_timestamp start; int rc; diff --git a/tests/torture.h b/tests/torture.h index 36f28f38..d7d85389 100644 --- a/tests/torture.h +++ b/tests/torture.h @@ -120,6 +120,8 @@ void _torture_filter_tests(struct CMUnitTest *tests, size_t ntests); const char *torture_server_address(int domain); int torture_server_port(void); +int torture_wait_for_daemon(unsigned int seconds); + #ifdef SSHD_EXECUTABLE void torture_setup_socket_dir(void **state); void torture_setup_sshd_server(void **state, bool pam);