b3074dc dyndns-tests: Simulate job in wrapped execv

1 file Authored by lslebodn 8 years ago, Committed by jhrozek 8 years ago,
    dyndns-tests: Simulate job in wrapped execv
    
    The function be_nsupdate_send fork a child for execution of the utility
    nsupdate.
    
    The child process builds nsupdate args in the function
    be_nsupdate_args and then execute the utility.
    
    Meanwhile the parent process register handlers for child and timeout
    for canceling the long lasting child.
       nsupdate_child_send -> child_handler_setup
    
    You can see in following log file that the wrapped version of execv
    function might be very fast and therefore parent can register handlers
    after finishing child. This is a reason why there is a child timeout.
    
    (10:18:48:556001 2015) [sssd] [be_nsupdate_args] (0x0200): nsupdate auth type: GSS-TSIG
    (10:18:48:556126 2015) [sssd] [__wrap_execv] (0x0200): nsupdate success test case
    (10:18:48:556200 2015) [sssd] [__wrap_execv] (0x1000): Child exiting with status 0
    (10:18:48:557218 2015) [sssd] [child_handler_setup] (0x2000): Setting up signal handler up for pid [3957]
    (10:18:48:560987 2015) [sssd] [child_handler_setup] (0x2000): Signal handler set up for pid [3957]
    (10:18:50:608520 2015) [sssd] [nsupdate_child_timeout] (0x0020): Timeout reached for dynamic DNS update
    (10:18:50:681525 2015) [sssd] [be_nsupdate_done] (0x0040): nsupdate child execution failed [1432158233]: Dynamic DNS update timed out
    (10:18:50:687031 2015) [sssd] [dyndns_test_ok] (0x1000): Child request returned [1432158233]: Unknown error 1432158233
    
    The patch simulate a work in wrapped function with small delay.
    It should be enough time for the parent process to registering a child.
    
    Based on patch from Jurica Stanojkovic <jurica.stanojkovic@rt-rk.com>
    Thank you.
    
    Resolves:
    https://fedorahosted.org/sssd/ticket/2283
    
    Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>