]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: avoid littering /tmp
authorEric Blake <eblake@redhat.com>
Fri, 28 Feb 2014 00:48:23 +0000 (17:48 -0700)
committerEric Blake <eblake@redhat.com>
Fri, 28 Feb 2014 01:10:13 +0000 (18:10 -0700)
Running 'make -C tests check TESTS=qemuagenttest' left a directory
/tmp/libvirt_XXXXXX/ behind.  The culprit was failure to cleanup
when short-circuiting an expensive test.

* tests/qemuagenttest.c (testQemuAgentTimeout): Free resources
when skipping expensive test.

Signed-off-by: Eric Blake <eblake@redhat.com>
tests/qemuagenttest.c

index 7a49b0bc8b1be6d2155040924954d063561a9b0d..b5bcbe3cedb86749948891d786f306e0ebe8f6ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Red Hat, Inc.
+ * Copyright (C) 2013, 2014 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -538,8 +538,10 @@ testQemuAgentTimeout(const void *data)
     if (!test)
         return -1;
 
-    if (virTestGetExpensive() == 0)
-        return EXIT_AM_SKIP;
+    if (virTestGetExpensive() == 0) {
+        ret = EXIT_AM_SKIP;
+        goto cleanup;
+    }
 
     if (qemuMonitorTestAddHandler(test, qemuAgentTimeoutTestMonitorHandler,
                                   NULL, NULL) < 0)