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

Pallavi Jha pallavikumarijha at gmail.com
Tue Feb 25 20:29:56 UTC 2014


Hi,

Updated patch is attached. All tests are passing. Please see the attachment
and let me know if any further changes are to be made.

Thanks!
Pallavi



On 25 February 2014 21:25, Jakub Hrozek <jhrozek at redhat.com> wrote:

> On Mon, Feb 17, 2014 at 04:47:09PM +0100, Lukas Slebodnik wrote:
> > The test(s) don't pass because they cannot pass.
> > You used function create_dom_test_ctx and param with filter_groups and
> > filter_users and result of this is configuration:
> >
> > [domain/nss_test]
> > filter_users = testuser1
> > filter_groups = testgroup1
> >
> > But negative cache reads configuration options from [nss] section.
>
> No, it reads from both actually and domain takes precedence.
>
> >
> > [nss]
> > filter_users = testuser1
> > filter_groups = testgroup1
>
> There was two different bugs in the test. Because the domain structure
> was created with talloc, the ->next pointer was random data and a for
> loop that walked through the list of domains crashed.
>
> The second bug was that the test used different domain name for the
> domain structure (NAME) and a different name when generating the
> configuration (TEST_DOM_NAME) so the config was never read actually.
>
> Attached is a snippet that I used to fix the test. Pallavi, if you
> agree, please resubmit your patch with the snippet squashed in.
>
> btw I didn't know what was test_sss_ncache_reset_permanent() about, so I
> removed it during my testing..feel free to retain it in the final patch,
> but please don't leave if-ed code in the resulting test.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20140226/c7dc9b3c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Unit-test-for-negcache-module-added.patch
Type: text/x-patch
Size: 20967 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20140226/c7dc9b3c/attachment.bin>


More information about the sssd-devel mailing list