From: Eric Blake Date: Fri, 28 Feb 2014 00:48:23 +0000 (-0700) Subject: tests: avoid littering /tmp X-Git-Tag: v1.2.2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8277211300369b9ea0ced9592c29d07488fe3749;p=thirdparty%2Flibvirt.git tests: avoid littering /tmp 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 --- diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index 7a49b0bc8b..b5bcbe3ced 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -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)