[SSSD] [PATCH] TEST: simple_access cleanup

Lukas Slebodnik lslebodn at redhat.com
Wed May 28 13:30:33 UTC 2014


On (27/05/14 22:22), Pavel Reichl wrote:
>Hello,
>
>since_access-test failed for me it didn't pass ever again - even after I
>removed my changes. 
>
>Please see attached patch that seems to fix the issue for me.
>
>Thanks,
>
>Pavel Reichl

>From b9f1bdabfc8cddd91571f3ecc0eabb48ee5b0a6c Mon Sep 17 00:00:00 2001
>From: Pavel Reichl <preichl at redhat.com>
>Date: Tue, 27 May 2014 21:13:48 +0100
>Subject: [PATCH] TEST: simple_access-tests - cleanup before running
>
>---
> src/tests/simple_access-tests.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/src/tests/simple_access-tests.c b/src/tests/simple_access-tests.c
>index 0fa5d049ff98c3cc5ff24961f542ce12356a598e..999277340e436431f14d7710c05c66823e0ebf9e 100644
>--- a/src/tests/simple_access-tests.c
>+++ b/src/tests/simple_access-tests.c
>@@ -661,6 +661,7 @@ int main(int argc, const char *argv[])
>     DEBUG_INIT(debug_level);
> 
>     tests_set_cwd();
>+    test_dom_suite_cleanup(TESTS_PATH, TEST_CONF_FILE, LOCAL_SYSDB_FILE);
> 
>     Suite *s = access_simple_suite();
>     SRunner *sr = srunner_create(s);

I agree.
I checked other tests and they use test_dom_suite_cleanup
before execution of test suite.

Could you also change cleanup before running tests in sysdb-tests.c?

sh-4.2$ grep -A8 tests_set_cwd src/tests/sysdb-tests.c
    tests_set_cwd();

    ret = unlink(TESTS_PATH"/"LOCAL_SYSDB_FILE);
    if (ret != EOK && errno != ENOENT) {
        fprintf(stderr, "Could not delete the test ldb file (%d) (%s)\n",
                errno, strerror(errno));
        return EXIT_FAILURE;
    }
    ^^^^^^^^^
It can be replaced with test_dom_suite_cleanup
and with this change, TEST_CONF_FILE will removed
before execution of tests as well.

LS




More information about the sssd-devel mailing list