]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: simplify storage test cleanup
authorEric Blake <eblake@redhat.com>
Wed, 2 Apr 2014 21:52:18 +0000 (15:52 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 2 Apr 2014 22:14:38 +0000 (16:14 -0600)
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>
tests/virstoragetest.c

index 3089d70919a10056aee09a1773ee8626bc76c291..9ec39c78ebd850d1eed147d197003441486e2ec5 100644 (file)
@@ -62,8 +62,6 @@ static char *abslink2;
 static void
 testCleanupImages(void)
 {
-    virCommandPtr cmd;
-
     VIR_FREE(qemuimg);
     VIR_FREE(absraw);
     VIR_FREE(canonraw);
@@ -79,9 +77,7 @@ testCleanupImages(void)
         return;
     }
 
-    cmd = virCommandNewArgList("rm", "-rf", datadir, NULL);
-    ignore_value(virCommandRun(cmd, NULL));
-    virCommandFree(cmd);
+    virFileDeleteTree(datadir);
 }
 
 static int