mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +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:
committed by
Andreas Schneider
parent
4ea09256f6
commit
cc1175a9af
@@ -881,6 +881,24 @@ void torture_setup_sshd_server(void **state, bool pam)
|
|||||||
assert_int_equal(rc, 0);
|
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)
|
void torture_teardown_socket_dir(void **state)
|
||||||
{
|
{
|
||||||
struct torture_state *s = *state;
|
struct torture_state *s = *state;
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ int torture_server_port(void);
|
|||||||
|
|
||||||
void torture_setup_socket_dir(void **state);
|
void torture_setup_socket_dir(void **state);
|
||||||
void torture_setup_sshd_server(void **state, bool pam);
|
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_socket_dir(void **state);
|
||||||
void torture_teardown_sshd_server(void **state);
|
void torture_teardown_sshd_server(void **state);
|
||||||
|
|||||||
Reference in New Issue
Block a user