[SSSD] [PATCH] test_ipa_subdomains_server: Run clean-up after success
Lukas Slebodnik
lslebodn at redhat.com
Tue Jun 16 13:29:47 UTC 2015
ehlo,
The directory tests_ipa_subdom_server was not removed after succesfull test
Simple patch is attached.
LS
-------------- next part --------------
>From b5802864a69c66cebb8e423ac0a47caf976d7c63 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Tue, 16 Jun 2015 14:47:57 +0200
Subject: [PATCH] test_ipa_subdomains_server: Run clean-up after success
---
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 3f62107a2f3ba660f32947dc7273e6dded6d6de3..84b52534d2c90104d44162f3816a82c88d24769a 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;
}
--
2.4.3
More information about the sssd-devel
mailing list