[SSSD] [Patch] Cmocka unit test for negcache.c module

Lukas Slebodnik lslebodn at redhat.com
Thu Mar 6 12:24:24 UTC 2014


On (06/03/14 09:50), Jakub Hrozek wrote:
>On Thu, Mar 06, 2014 at 09:26:40AM +0100, Lukas Slebodnik wrote:
>> On (05/03/14 22:33), Jakub Hrozek wrote:
>> >On Wed, Mar 05, 2014 at 04:24:19PM +0545, Pallavi Jha wrote:
>> >> Hi,
>> >> 
>> >> 
>> >> Few changes mentioned in earlier mail are added and the required comment is
>> >> also added for mock_rctx(), as was discussed with Jakub. Kindly review the
>> >> patch.
>> >> 
>> >> 
>> >> Thanks!
>> >> Pallavi
>> >
>> >The patch now looks good and the test passes, so I'll ACK it.
>> >
>> >Please note that when I applied the patch, the test failed, complaining
>> >about a failure on line 603, which would mean create_dom_test_ctx()
>> >failed. But I haven't been able to reproduce the error again, subsequent
>> >runs went OK for me. If someone else sees the failure, please holler.
>> 
>> I don't know why, but I am able to reproduce it :-(
>> 
>> (Thu Mar  6 09:23:04:051345 2014) [sssd] [ldb] (0x0020): Unable to open tdb 'tests_nss/test_nss_conf.ldb'
>> (Thu Mar  6 09:23:04:051412 2014) [sssd] [ldb] (0x0020): Failed to connect to 'tests_nss/test_nss_conf.ldb' with backend 'tdb': Unable to open tdb 'tests_nss/test_nss_conf.ldb'
>> (Thu Mar  6 09:23:04:051425 2014) [sssd] [confdb_init] (0x0010): Unable to open config database [tests_nss/test_nss_conf.ldb]
>> (Thu Mar  6 09:23:04:051446 2014) [sssd] [create_dom_test_ctx] (0x0020): confdb_init failed: 5
>> tc
>> ../sssd/src/tests/cmocka/test_negcache.c:603: error: Failure!
>> [  FAILED  ] test_sss_ncache_prepopulate
>> 
>> 
>> 
>> BTW The test will not fail if I run "make rpms"
>> 
>> LS
>
>I was actually hoping you could reproduce this, you have a way with
>strange bugs :-)
>
>But on my machine, all tests still pass. Provided you can reproduce
>this, can you also send a patch?

done.

LS
-------------- next part --------------
>From be225dc8b4cbec157f51d68df91504b2025eec5e Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Thu, 6 Mar 2014 13:00:32 +0100
Subject: [PATCH] TEST: Use unique directory for negcache test

nss-srv-tests and test-negcache wrote temporary files to the same subdirectory
'tests_nss'. There could be a race condition when tests ran in parallel.
The first test could remove directory which the second one wanted to use.

[ldb] (0x0020): Unable to open tdb 'tests_nss/test_nss_conf.ldb'
[ldb] (0x0020): Failed to connect to 'tests_nss/test_nss_conf.ldb'
    with backend 'tdb': Unable to open tdb 'tests_nss/test_nss_conf.ldb'
[confdb_init] (0x0010): Unable to open config database
    [tests_nss/test_nss_conf.ldb]
[create_dom_test_ctx] (0x0020): confdb_init failed: 5
---
 src/tests/cmocka/test_negcache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tests/cmocka/test_negcache.c b/src/tests/cmocka/test_negcache.c
index 38324b567930891ac221982b036ab330eae8b95e..605e27f04741449ffa8ada48a31b63358db34f6a 100644
--- a/src/tests/cmocka/test_negcache.c
+++ b/src/tests/cmocka/test_negcache.c
@@ -50,7 +50,7 @@
 #define SHORTSPAN 1
 #define NAME "foo_name"
 #define UID "U-1-2-3-4-5"
-#define TESTS_PATH "tests_nss"
+#define TESTS_PATH "tests_ncache"
 #define TEST_CONF_DB "test_nss_conf.ldb"
 #define TEST_SYSDB_FILE "cache_nss_test.ldb"
 #define TEST_DOM_NAME "nss_test"
-- 
1.8.5.3



More information about the sssd-devel mailing list