From: Eileen Donlon Date: Wed, 14 Mar 2012 16:43:38 +0000 (-0400) Subject: disallow-use-of-configuration-file-with-unittests X-Git-Tag: suricata-1.3beta1~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85c364da09b4c968a783fc04e00b54d7f831ef4b;p=thirdparty%2Fsuricata.git disallow-use-of-configuration-file-with-unittests --- diff --git a/src/suricata.c b/src/suricata.c index 6d65905b30..933becbddc 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -1183,6 +1183,12 @@ int main(int argc, char **argv) /* Load yaml configuration file if provided. */ if (conf_filename != NULL) { +#ifdef UNITTESTS + if (run_mode == RUNMODE_UNITTEST) { + SCLogError(SC_ERR_CMD_LINE, "ERROR: Should not use a configuration file with unittests.\n"); + exit(EXIT_FAILURE); + } +#endif if (ConfYamlLoadFile(conf_filename) != 0) { /* Error already displayed. */ exit(EXIT_FAILURE);