]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
shell check: raise error if missing args
authorJason Ish <jason.ish@oisf.net>
Tue, 18 Feb 2020 17:22:57 +0000 (11:22 -0600)
committerJason Ish <jason.ish@oisf.net>
Tue, 18 Feb 2020 17:22:57 +0000 (11:22 -0600)
In a shell check, the args parameter is required. Fail the test
with a nicer error if the args field is missing.

run.py

diff --git a/run.py b/run.py
index b6716ef845ede6b7c9959a892133622c811d0bde..bbfd269ec0e6244e712f19ea4f8b8955ef288c91 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -255,6 +255,8 @@ class ShellCheck:
         self.config = config
 
     def run(self):
+        if not self.config or "args" not in self.config:
+            raise TestError("shell check missing args")
         try:
             output = subprocess.check_output(self.config["args"], shell=True)
             if "expect" in self.config: