summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2018-02-27 16:05:41 +0100
committerDaiki Ueno <ueno@gnu.org>2018-02-27 16:33:59 +0100
commitbcf2c4e0a24303f976dbedc0ef0a564b9808a989 (patch)
treecdbb82b1e1149d1d16eedc4a52b2a34cab745e00
parentfb8bf5a5f82e5b4f0afe72e247255f37fc0dedc8 (diff)
test: Improve temporary directory handling
-rw-r--r--p11-kit/test-transport.c6
-rw-r--r--trust/test-module.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/p11-kit/test-transport.c b/p11-kit/test-transport.c
index c128e54..40e5903 100644
--- a/p11-kit/test-transport.c
+++ b/p11-kit/test-transport.c
@@ -69,7 +69,7 @@ setup_remote (void *unused)
{
const char *data;
- test.directory = p11_test_directory ("p11-test-config");
+ test.directory = p11_test_directory ("p11-test-transport");
test.user_modules = p11_path_build (test.directory, "modules", NULL);
#ifdef OS_UNIX
if (mkdir (test.user_modules, 0700) < 0)
@@ -206,7 +206,7 @@ setup_remote_unix (void *unused)
char *path;
pid_t pid;
- test.directory = p11_test_directory ("p11-test-config");
+ test.directory = p11_test_directory ("p11-test-transport");
test.user_modules = p11_path_build (test.directory, "modules", NULL);
if (mkdir (test.user_modules, 0700) < 0)
assert_not_reached ();
@@ -251,6 +251,8 @@ static void
teardown_remote_unix (void *unused)
{
kill (test.pid, SIGKILL);
+ p11_test_directory_delete (test.directory);
+ free (test.directory);
}
#endif /* OS_UNIX */
diff --git a/trust/test-module.c b/trust/test-module.c
index e05ea22..1e8d812 100644
--- a/trust/test-module.c
+++ b/trust/test-module.c
@@ -119,6 +119,8 @@ teardown (void *unused)
rv = test.module->C_Finalize (NULL);
assert (rv == CKR_OK);
+ if (test.directory)
+ p11_test_directory_delete (test.directory);
free (test.directory);
memset (&test, 0, sizeof (test));