summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel P. Berrange2016-04-26 11:59:09 +0200
committerDaniel P. Berrange2016-06-13 13:41:17 +0200
commite7ed11f083015bf34a121cfff31540cf9c2bae23 (patch)
treec4bbfa218255ebd58ac0f3d7b2c3cd9abaef61ac
parentTLS: provide slightly more information when TLS certificate loading fails (diff)
downloadqemu-e7ed11f083015bf34a121cfff31540cf9c2bae23.tar.gz
qemu-e7ed11f083015bf34a121cfff31540cf9c2bae23.tar.xz
qemu-e7ed11f083015bf34a121cfff31540cf9c2bae23.zip
crypto: remove temp files on completion of secrets test
The secret object tests left some temporary files on disk when completing. Ensure they are unlink, and rename them to make it more obvious where they come from. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
-rw-r--r--tests/test-crypto-secret.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test-crypto-secret.c b/tests/test-crypto-secret.c
index 0b1fe8dd37..13fc6c4c75 100644
--- a/tests/test-crypto-secret.c
+++ b/tests/test-crypto-secret.c
@@ -49,7 +49,7 @@ static void test_secret_indirect_good(void)
{
Object *sec;
char *fname = NULL;
- int fd = g_file_open_tmp("secretXXXXXX",
+ int fd = g_file_open_tmp("qemu-test-crypto-secret-XXXXXX",
&fname,
NULL);
@@ -74,6 +74,7 @@ static void test_secret_indirect_good(void)
object_unparent(sec);
g_free(pw);
close(fd);
+ unlink(fname);
g_free(fname);
}
@@ -96,7 +97,7 @@ static void test_secret_indirect_emptyfile(void)
{
Object *sec;
char *fname = NULL;
- int fd = g_file_open_tmp("secretXXXXXX",
+ int fd = g_file_open_tmp("qemu-test-crypto-secretXXXXXX",
&fname,
NULL);
@@ -119,6 +120,7 @@ static void test_secret_indirect_emptyfile(void)
object_unparent(sec);
g_free(pw);
close(fd);
+ unlink(fname);
g_free(fname);
}