[SSSD] [PATCH] nested groups unit test

Pavel Březina pbrezina at redhat.com
Thu Jul 18 13:45:35 UTC 2013


On 07/18/2013 02:38 PM, Pavel Březina wrote:
> Hi,
> this is the first unit test for nested groups. It covers only the most
> basic situation when we are trying to resolve one group with no members.
>
> Even though it is only one test, the patch set is quite big. This is
> because it creates the possibility to mock providers related modules.
> Most of the patches are just a preparation for unit testing providers.
>
> Patches 1-5
> Moves the code around to reduce number of dependencies. (E.g. you do not
> want to load fail over when you are testing nested groups.)
>
> Patch 6
> Mocks basic SDAP interface.
>
> Patch 7
> Mocks sysdb objects - currently user and rfc2307bis group. You can
> decide what set of attributes the object should posses. For example,
> creating a user requires only basedn and name parameter, to construct
> originalDN and name attributes. The rest is provided by (attrname,
> value) pairs via variadic function.
>
> E.g.:
> mock_sysdb_user(mem_ctx, basedn, name, SYSDB_UIDNUM, uid, ...)
>
> get_attr_type() translates the sysdb attribute name to proper data type.
> This should be extended as needed.
>
> Patch 8
> Adds provider tests related common object files and cflags in makefile
>
> Patch 9
> New macro sss_will_return_always(fn, value). This can be used to mock
> function data in such way that any call of mock() will return the value.
>
> It was just pushed also to cmocka upstream as will_return_always().
>
> Patch 10-11
> Unit test.
>
> Patch 12
> Removes a noisy debug message.
>
> I would like to get this reviewed before I continue with more test
> cases, so the framework is tuned enough.
>
> Off topic:
> I also created new macro called fail_msg, which will make the test fail
> printing a message. I didn't use this macro in the end, but it made its
> way to cmocka upstream.

Oops, I did some reorganization while writing this mail but sent patches 
generated sooner, so the numbers does not match. Reordered patches are 
attached.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-sdap-move-non-async-functions-from-sdap_async.c-to-s.patch
Type: text/x-patch
Size: 8821 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-sdap-move-non-async-functions-from-sdap_async_connec.patch
Type: text/x-patch
Size: 2372 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-sdap-move-sdap_get_id_specific_filter-to-sdap_utils..patch
Type: text/x-patch
Size: 2556 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-ldap-move-options-related-content-from-ldap_common.c.patch
Type: text/x-patch
Size: 59604 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-ldap_options.c-do-not-call-krb5_try_kdcip-when-unit-.patch
Type: text/x-patch
Size: 1186 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-tests-mock-SDAP.patch
Type: text/x-patch
Size: 6934 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-tests-mock-sysdb-users-and-groups.patch
Type: text/x-patch
Size: 8097 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-tests-prepare-makefile-for-provider-related-unit-tes.patch
Type: text/x-patch
Size: 1160 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-tests-new-macro-sss_will_return_always.patch
Type: text/x-patch
Size: 851 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-tests-add-confdb_path-to-sss_test_ctx.patch
Type: text/x-patch
Size: 1967 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment-0009.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0011-tests-nested-groups-unit-test.patch
Type: text/x-patch
Size: 8547 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment-0010.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0012-tests-don-t-print-debug-message-when-test-dir-does-n.patch
Type: text/x-patch
Size: 1075 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130718/3de0ddef/attachment-0011.bin>


More information about the sssd-devel mailing list