aboutsummaryrefslogtreecommitdiff
path: root/tests/torture.c
diff options
context:
space:
mode:
authorSahana Prasad <sahana@redhat.com>2019-12-10 21:06:55 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-12-20 16:18:23 +0100
commitcc1175a9af8d745f2f7e9ead09276857d19153f9 (patch)
treef89dabe259ab3f8d0bb184f97a0387e6dc6d7723 /tests/torture.c
parent4ea09256f67c381bed44af54d8cbfa42d81df314 (diff)
downloadlibssh-cc1175a9af8d745f2f7e9ead09276857d19153f9.tar.gz
libssh-cc1175a9af8d745f2f7e9ead09276857d19153f9.tar.xz
libssh-cc1175a9af8d745f2f7e9ead09276857d19153f9.zip
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>
Diffstat (limited to 'tests/torture.c')
-rw-r--r--tests/torture.c18
1 files changed, 18 insertions, 0 deletions
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;