diff --git a/tests/torture.c b/tests/torture.c index 907f45b3..4e03972d 100644 --- a/tests/torture.c +++ b/tests/torture.c @@ -881,6 +881,24 @@ void torture_setup_sshd_server(void **state, bool pam) assert_int_equal(rc, 0); } +void torture_setup_tokens(const char *temp_dir, + const char *filename, + const char object_name[]) +{ + char token_setup_start_cmd[1024] = {0}; + int rc; + + snprintf(token_setup_start_cmd, sizeof(token_setup_start_cmd), + "%s/tests/pkcs11/setup-softhsm-tokens.sh %s %s %s", + BINARYDIR, + temp_dir, + filename, object_name); + + rc = system(token_setup_start_cmd); + assert_return_code(rc, errno); +} + + /* Set the default interface for the server */ void torture_teardown_socket_dir(void **state) { struct torture_state *s = *state; diff --git a/tests/torture.h b/tests/torture.h index 9455e06d..771130fb 100644 --- a/tests/torture.h +++ b/tests/torture.h @@ -123,6 +123,7 @@ int torture_server_port(void); 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[]); void torture_teardown_socket_dir(void **state); void torture_teardown_sshd_server(void **state);