From 3cdfe5af1a00e371464f853a0a06bee45d019d11 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 8 Feb 2019 13:25:42 -0500 Subject: [PATCH] suppress loading of default config file for auto tests Change-Id: I018de8dc31781756ef69738706531ad5f3dfb2af --- README.md | 2 ++ lib/auxlib.c | 2 ++ t/auto-daemon-tests.pl | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0408f7ecd..f6b8f7f83 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,8 @@ The options are described in more detail below. multiple times on the command line must be given only once in the config file, with the multiple values separated by semicolons (see section *Interfaces configuration* below for an example). + As a special value, `none` can be passed here to suppress loading of the default config file. + * --config-section Specifies the *.ini* style section to be used in the config file. Multiple sections can be diff --git a/lib/auxlib.c b/lib/auxlib.c index 485dece91..ceedad0b7 100644 --- a/lib/auxlib.c +++ b/lib/auxlib.c @@ -129,6 +129,8 @@ void config_load(int *argc, char ***argv, GOptionEntry *app_entries, const char use_config = default_config; if (rtpe_common_config_ptr->config_file) { use_config = rtpe_common_config_ptr->config_file; + if (!strcmp(use_config, "none")) + goto out; fatal = 1; } diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index d85331e53..f69782b83 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -16,7 +16,8 @@ ok -x $ENV{RTPE_BIN}, 'RTPE_BIN points to executable'; my $rtpe_stdout = File::Temp::tempfile() or die; my $rtpe_stderr = File::Temp::tempfile() or die; my $rtpe_pid = open3(undef, '>&'.fileno($rtpe_stdout), '>&'.fileno($rtpe_stderr), - $ENV{RTPE_BIN}, qw(-t -1 -i 203.0.113.1 -i 2001:db8:4321::1 -n 2223 -c 12345 -f -L 7 -E -u 2222)); + $ENV{RTPE_BIN}, qw(--config-file=none -t -1 -i 203.0.113.1 -i 2001:db8:4321::1 + -n 2223 -c 12345 -f -L 7 -E -u 2222)); ok $rtpe_pid, 'daemon launched in background'; # keep trying to connect to the control socket while daemon is starting up