From 9d69c05084176602c2c0969e51d6a81ed32974ca Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Tue, 16 Jun 2015 14:47:57 +0200 Subject: test_ipa_subdomains_server: Run clean-up after success MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Michal Židek --- src/tests/cmocka/test_ipa_subdomains_server.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tests/cmocka/test_ipa_subdomains_server.c b/src/tests/cmocka/test_ipa_subdomains_server.c index 3f62107a2..84b52534d 100644 --- a/src/tests/cmocka/test_ipa_subdomains_server.c +++ b/src/tests/cmocka/test_ipa_subdomains_server.c @@ -729,11 +729,14 @@ static void test_ipa_trust_dir2str(void **state) int main(int argc, const char *argv[]) { int rv; + int no_cleanup = 0; poptContext pc; int opt; struct poptOption long_options[] = { POPT_AUTOHELP SSSD_DEBUG_OPTS + { "no-cleanup", 'n', POPT_ARG_NONE, &no_cleanup, 0, + _("Do not delete the test database after a test run"), NULL }, POPT_TABLEEND }; @@ -798,5 +801,9 @@ int main(int argc, const char *argv[]) test_dom_suite_setup(TESTS_PATH); rv = cmocka_run_group_tests(tests, NULL, NULL); + if (rv == 0 && !no_cleanup) { + test_dom_suite_cleanup(TESTS_PATH, TEST_CONF_DB, TEST_DOM_NAME); + } + return rv; } -- cgit