1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

torture: Add a helper function to setup tokens using softhsm.

Signed-off-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Sahana Prasad
2019-12-10 21:06:55 +01:00
committed by Andreas Schneider
parent 4ea09256f6
commit cc1175a9af
2 changed files with 19 additions and 0 deletions

View File

@@ -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;

View File

@@ -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);