[SSSD] [PATCH] Add a unit test for sss_parse_name_for_domains

Jakub Hrozek jhrozek at redhat.com
Thu Apr 17 12:03:49 UTC 2014


On Thu, Apr 17, 2014 at 01:53:03PM +0200, Pavel Březina wrote:
> On 04/16/2014 04:29 PM, Jakub Hrozek wrote:
> >Hi,
> >
> >I was working on a reusable request to split a raw name into
> >(name,domain) component instead of copying sss_parse_name_for_domains
> >along with subdomain refresh all around the responder code and noticed
> >that the sss_parse_name_for_domains() code is really complex and hard to
> >follow. To understand the code better and validate my assumptions, I
> >wrote a unit test and did a couple of very small fixes in the
> >sss_parse_name_for_domains function itself. Kindly see the commit
> >message for explanation of the small fixes.
> 
> Ack to both.

master: f424902e9e6c0fb6cae309bef0ce208b13733fb6

As Lukas reminded me, I should also condier adding a test for the
name_mismatch case that is executed when multiple domain regexes match
but the resulting match is different. But the point of the unit test was
to validate when is EAGAIN returned to make sure the next patches (which
will start an async request on EAGAIN) behave correctly.



More information about the sssd-devel mailing list