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: Eric Blake <eblake@redhat.com>
This commit is contained in:
Eric Blake 2014-04-02 15:52:18 -06:00
parent 138e65c3be
commit 8feec44a09

View File

@ -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)
return; return;
} }
cmd = virCommandNewArgList("rm", "-rf", datadir, NULL); virFileDeleteTree(datadir);
ignore_value(virCommandRun(cmd, NULL));
virCommandFree(cmd);
} }
static int static int