]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
framework: allow to use env variables in args
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 22 Oct 2021 10:16:42 +0000 (12:16 +0200)
committerJason Ish <jason.ish@oisf.net>
Fri, 12 Nov 2021 21:47:10 +0000 (15:47 -0600)
such as OUTPUT_DIR for datasets

run.py
tests/datasets-pcrexform/test.yaml

diff --git a/run.py b/run.py
index 3b7ae08cc77b2b7750e96a6b62e9923861d6d93e..a6739b0898c866018624abf4fd0c5962e1ca9673 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -625,6 +625,8 @@ class TestRunner:
                 template = string.Template(args)
                 cmdline = template.substitute(env)
             else:
+                for a in range(len(args)):
+                    args[a] = string.Template(args[a]).substitute(env)
                 cmdline = " ".join(args) + "\n"
 
             open(os.path.join(self.output, "cmdline"), "w").write(cmdline)
index 5e4560f13826214838761aec046a5a22bc0e4fc6..28966a64178813953d77991f7de970c4a8bf61b8 100644 (file)
@@ -6,7 +6,7 @@ requires:
     - src/datasets.c
 
 args:
- - -k none --data-dir=output
+ - -k none --data-dir=${OUTPUT_DIR}
 
 checks:
   - file-compare: