8d52922 nss: make nss responder tests work with new code

4 files Authored by pbrezina 7 years ago, Committed by lslebodn 7 years ago,
    nss: make nss responder tests work with new code
    
    There were few type of changes that were require for tests to work:
    
    1) When calling "get by name" commands, a name is parsed with
    sss_parse_inp. Returned value is now mocked.
    
    2) When calling "get by upn" commands, a name is parsed with
    sss_parse_inp and negative cache is not hit in the first run
    since cache_req knows it may be upn since it is not equal
    to any known domain. Returned value of sss_parse_inp is now
    mocked to return ERR_DOMAIN_NOT_FOUND and negative cache hits
    are checked to be 0.
    
    3) Lookups by certificate or sid do not require name parsing so
    those have separate mock functions.
    
    4) Sometime the test fail since different number of mocked functions
    is called due to changes in the code. Where possible, will_return_always()
    is used, otherwise number of mocked values was fixed.
    
    5) In SID by name lookups, we set nss_test_ctx->tctx->done to false on
    the beggining of for cycle, since the code now contains tevent calls
    and withough it only a first request proceed into tevent_loop in
    test_ev_loop() because the first finished request sets it to true.
    
    Resolves:
    https://fedorahosted.org/sssd/ticket/3151
    
    Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
    
        
file modified
+10 -3
file modified
+93 -61