From 85c364da09b4c968a783fc04e00b54d7f831ef4b Mon Sep 17 00:00:00 2001 From: Eileen Donlon Date: Wed, 14 Mar 2012 12:43:38 -0400 Subject: [PATCH] disallow-use-of-configuration-file-with-unittests --- src/suricata.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.47.2