]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
run: allow an empty test.yaml
authorJason Ish <jason.ish@oisf.net>
Wed, 20 Nov 2019 21:36:56 +0000 (15:36 -0600)
committerJason Ish <jason.ish@oisf.net>
Thu, 21 Nov 2019 17:09:24 +0000 (11:09 -0600)
On an empty test.yaml, make sure the config object is an
empty dict, and not None.

run.py

diff --git a/run.py b/run.py
index 6d5043c76e65c48f35e0131eef778e0814c5cfee..b4bbe88ac97f14665ea658aec33fa1fe66a8e391 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -356,6 +356,7 @@ class TestRunner:
         self.readers = []
 
         # Load the test configuration.
+        self.config = None
         self.load_config()
 
         self.suricata_config.load_config(self.get_suricata_yaml_path())
@@ -364,7 +365,7 @@ class TestRunner:
         if os.path.exists(os.path.join(self.directory, "test.yaml")):
             self.config = yaml.safe_load(
                 open(os.path.join(self.directory, "test.yaml"), "rb"))
-        else:
+        if self.config is None:
             self.config = {}
 
     def setup(self):