summaryrefslogtreecommitdiffstats
path: root/src/slave
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2012-10-12 16:12:48 -0400
committerGreg Hudson <ghudson@mit.edu>2012-10-12 16:45:34 -0400
commit97cb96b4d1944e99ecf98a5b5bf60bc66b501609 (patch)
tree8c88510a0bd425611eee28a2fe9bd6be4da42dd0 /src/slave
parentf1daa467cf8b126da2d66094b1b56b3733272928 (diff)
downloadkrb5-97cb96b4d1944e99ecf98a5b5bf60bc66b501609.tar.gz
krb5-97cb96b4d1944e99ecf98a5b5bf60bc66b501609.tar.xz
krb5-97cb96b4d1944e99ecf98a5b5bf60bc66b501609.zip
Make t_iprop.py faster and more robust
Catch SIGUSR1 in iprop-mode kpropd so that we can use it to interrupt sleeps and make kpropd do an iprop request immediately. In k5test.py, add prod_kpropd and read_from_kpropd methods to allow test scripts to send a SIGUSR1 to kpropd and to read its stdout/stderr output; also allow the test script to specify additional arguments when starting kpropd. In t_iprop.py, start kpropd with -d and, instead of sleeping, read kpropd output until we see an indication that kpropd is in sync with the master. To avoid delays, prod kpropd before waiting for sync and after a completed full prop.
Diffstat (limited to 'src/slave')
-rw-r--r--src/slave/kpropd.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c
index afa02f4387..627230232a 100644
--- a/src/slave/kpropd.c
+++ b/src/slave/kpropd.c
@@ -198,6 +198,12 @@ alarm_handler(int sig)
}
static void
+usr1_handler(int sig)
+{
+ /* Nothing to do, just let the signal interrupt sleep(). */
+}
+
+static void
kill_do_standalone(int sig)
{
if (fullprop_child > 0) {
@@ -288,15 +294,17 @@ main(argc, argv)
}
/*
- * This is the iprop case. We'll fork a child to run do_standalone().
- * The parent will run do_iprop(). We try to kill the child if we
- * get killed.
+ * This is the iprop case. We'll fork a child to run do_standalone(). The
+ * parent will run do_iprop(). We try to kill the child if we get killed.
+ * Catch SIGUSR1 so tests can use it to interrupt the sleep timer and force
+ * an iprop request.
*/
signal_wrapper(SIGHUP, kill_do_standalone);
signal_wrapper(SIGINT, kill_do_standalone);
signal_wrapper(SIGQUIT, kill_do_standalone);
signal_wrapper(SIGTERM, kill_do_standalone);
signal_wrapper(SIGSEGV, kill_do_standalone);
+ signal_wrapper(SIGUSR1, usr1_handler);
atexit(atexit_kill_do_standalone);
fullprop_child = fork();
switch (fullprop_child) {