#include "config.h"
#include "testcode/ldns-testpkts.h"
#include "testcode/replay.h"
#include "testcode/fake_event.h"
#include "daemon/unbound.c"
Defines | |
| #define | main daemon_main |
| include the main program from the unbound daemon. | |
| #define | MAX_LINE_LEN 1024 |
| maximum line length for lines in the replay file. | |
| #define | MAXARG 100 |
| Max number of arguments to pass to unbound. | |
Functions | |
| static void | testbound_usage () |
| give commandline usage for testbound. | |
| static void | add_opts (char *optarg, int *pass_argc, char *pass_argv[]) |
| Add options from string to passed argc. | |
| static void | echo_cmdline (int argc, char *argv[]) |
| pretty print commandline for unbound in this test | |
| static void | setup_config (FILE *in, char *configfile, int *lineno, int *pass_argc, char *pass_argv[]) |
| process config elements | |
| static struct replay_scenario * | setup_playback (const char *filename, char *configfile, int *pass_argc, char *pass_argv[]) |
| read playback file | |
| void | remove_configfile (void) |
| remove config file at exit | |
| int | main (int argc, char *argv[]) |
| Main fake event test program. | |
Variables | |
| static char | cfgfile [MAX_LINE_LEN] |
| the config file (removed at exit) | |
0 if all unit tests are successfull.
| #define main daemon_main |
include the main program from the unbound daemon.
rename main to daemon_main to call it
| #define MAX_LINE_LEN 1024 |
maximum line length for lines in the replay file.
| #define MAXARG 100 |
| static void testbound_usage | ( | ) | [static] |
| static void add_opts | ( | char * | optarg, | |
| int * | pass_argc, | |||
| char * | pass_argv[] | |||
| ) | [static] |
Add options from string to passed argc.
splits on whitespace.
| optarg,: | the option argument, "-v -p 12345" or so. | |
| pass_argc,: | ptr to the argc for unbound. Modified. | |
| pass_argv,: | the argv to pass to unbound. Modified. |
References fatal_exit(), and MAXARG.
Referenced by main(), and setup_config().
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Main fake event test program.
Setup, teardown and report errors.
| argc,: | arg count. | |
| argv,: | array of commandline arguments. |
References add_opts(), cfgfile, echo_cmdline(), fake_event_cleanup(), fake_event_init(), fatal_exit(), log_info(), log_init(), MAXARG, optarg, optind, remove_configfile(), setup_playback(), and testbound_usage().
1.5.6