提交 8feec44a 编写于 作者: E Eric Blake

tests: simplify storage test cleanup

No need to spawn a child 'rm' process when we can do it ourselves.

* tests/virstoragetest.c (testCleanupImages): Use dedicated
helper.
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 138e65c3
...@@ -62,8 +62,6 @@ static char *abslink2; ...@@ -62,8 +62,6 @@ static char *abslink2;
static void static void
testCleanupImages(void) testCleanupImages(void)
{ {
virCommandPtr cmd;
VIR_FREE(qemuimg); VIR_FREE(qemuimg);
VIR_FREE(absraw); VIR_FREE(absraw);
VIR_FREE(canonraw); VIR_FREE(canonraw);
...@@ -79,9 +77,7 @@ testCleanupImages(void) ...@@ -79,9 +77,7 @@ testCleanupImages(void)
return; return;
} }
cmd = virCommandNewArgList("rm", "-rf", datadir, NULL); virFileDeleteTree(datadir);
ignore_value(virCommandRun(cmd, NULL));
virCommandFree(cmd);
} }
static int static int
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册