- fixup testbound so it exits cleanly.
       - cleanup the caches on a reload, so that rrsetID numbers won't clash.


git-svn-id: file:///svn/unbound/trunk@740 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2007-11-12 13:58:34 +00:00
parent 0ee5532396
commit a6ae1d6194
10 changed files with 40 additions and 21 deletions
+9 -3
View File
@@ -56,6 +56,7 @@
#include "testcode/replay.h"
#include "testcode/ldns-testpkts.h"
#include "util/log.h"
#include <signal.h>
/** Global variable: the scenario. Saved here for when event_init is done. */
static struct replay_scenario* saved_scenario = NULL;
@@ -522,6 +523,7 @@ run_scenario(struct replay_runtime* runtime)
fatal_exit("testbound: there are unmatched answers.");
}
log_info("testbound: exiting fake runloop.");
runtime->exit_cleanly = 1;
}
/*********** Dummy routines ***********/
@@ -595,13 +597,17 @@ comm_base_dispatch(struct comm_base* b)
{
struct replay_runtime* runtime = (struct replay_runtime*)b;
run_scenario(runtime);
(*runtime->sig_cb)(SIGTERM, runtime->sig_cb_arg);
}
void
comm_base_exit(struct comm_base* ATTR_UNUSED(b))
comm_base_exit(struct comm_base* b)
{
/* some sort of failure */
fatal_exit("testbound: comm_base_exit was called.");
struct replay_runtime* runtime = (struct replay_runtime*)b;
if(!runtime->exit_cleanly) {
/* some sort of failure */
fatal_exit("testbound: comm_base_exit was called.");
}
}
struct comm_signal*
+2
View File
@@ -228,6 +228,8 @@ struct replay_runtime {
void (*sig_cb)(int, void*);
/** signal handler user arg */
void *sig_cb_arg;
/** time to exit cleanly */
int exit_cleanly;
/** size of buffers */
size_t bufsize;