mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user