diff options
Diffstat (limited to 'tests/torture.h')
-rw-r--r-- | tests/torture.h | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/tests/torture.h b/tests/torture.h index 599b53ea..eb2765da 100644 --- a/tests/torture.h +++ b/tests/torture.h @@ -24,10 +24,6 @@ #ifndef _TORTURE_H #define _TORTURE_H -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - #include <stdio.h> #include <stdlib.h> #include <stdarg.h> @@ -50,6 +46,7 @@ #endif /* assert_return_code */ #define TORTURE_SSH_SERVER "127.0.0.10" +#define TORTURE_SSH_SERVER_IP6 "fd00::5357:5f0a" #define TORTURE_SSH_USER_BOB "bob" #define TORTURE_SSH_USER_BOB_PASSWORD "secret" @@ -124,17 +121,25 @@ 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); -void torture_setup_tokens(const char *temp_dir, - const char *filename, - const char object_name[], - const char *load_public); void torture_teardown_socket_dir(void **state); void torture_teardown_sshd_server(void **state); int torture_update_sshd_config(void **state, const char *config); +#endif /* SSHD_EXECUTABLE */ + +#ifdef WITH_PKCS11_URI +void torture_setup_tokens(const char *temp_dir, + const char *filename, + const char object_name[], + const char *load_public); +void torture_cleanup_tokens(const char *temp_dir); +#endif /* WITH_PKCS11_URI */ void torture_reset_config(ssh_session session); @@ -142,15 +147,17 @@ void torture_setup_create_libssh_config(void **state); void torture_setup_libssh_server(void **state, const char *server_path); +#if defined(HAVE_WEAK_ATTRIBUTE) && defined(TORTURE_SHARED) +__attribute__((weak)) int torture_run_tests(void); +#else /* * This function must be defined in every unit test file. */ -#if ((defined _WIN32) || (defined _WIN64)) && (defined USE_ATTRIBUTE_WEAK) -__attribute__((weak)) int torture_run_tests(void); -#else int torture_run_tests(void); #endif +void torture_free_state(struct torture_state *s); + char *torture_make_temp_dir(const char *template); char *torture_create_temp_file(const char *template); |