summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2015-09-10 10:42:02 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-09-14 15:57:21 +0200
commitb3074dca3acebd91437ef13d3329d6d65d655215 (patch)
treee7dcd44c7dfcc3faaf5ee3322b67116d9e6140f2
parent9a847b5d7dfea403d838274950402cccc36659d0 (diff)
downloadsssd-b3074dca3acebd91437ef13d3329d6d65d655215.tar.gz
sssd-b3074dca3acebd91437ef13d3329d6d65d655215.tar.xz
sssd-b3074dca3acebd91437ef13d3329d6d65d655215.zip
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>
-rw-r--r--src/tests/cmocka/test_dyndns.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tests/cmocka/test_dyndns.c b/src/tests/cmocka/test_dyndns.c
index 691378ee6..22526e532 100644
--- a/src/tests/cmocka/test_dyndns.c
+++ b/src/tests/cmocka/test_dyndns.c
@@ -70,6 +70,7 @@ void __wrap_execv(const char *path, char *const argv[])
case MOCK_NSUPDATE_OK:
DEBUG(SSSDBG_FUNC_DATA, "nsupdate success test case\n");
err = 0;
+ usleep(50000); /* 50 miliseconds */
break;
case MOCK_NSUPDATE_ERR:
DEBUG(SSSDBG_FUNC_DATA, "nsupdate error test case\n");