From: Shivani Bhardwaj Date: Thu, 5 Sep 2019 11:43:17 +0000 (+0530) Subject: Fix output in cmdline file for specified command X-Git-Tag: suricata-6.0.4~400 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F119%2Fhead;p=thirdparty%2Fsuricata-verify.git Fix output in cmdline file for specified command So far if a command was specified in test.yaml, it showed up unusable in cmdline file. Fix it with appropriate environment handling. --- diff --git a/run.py b/run.py index 334ef4b24..976e9dc5f 100755 --- a/run.py +++ b/run.py @@ -30,6 +30,7 @@ import os.path import subprocess import threading import shutil +import string import argparse import yaml import glob @@ -553,8 +554,13 @@ class TestRunner: stdout = open(os.path.join(self.output, "stdout"), "w") stderr = open(os.path.join(self.output, "stderr"), "w") - open(os.path.join(self.output, "cmdline"), "w").write( - " ".join(args) + "\n") + if shell: + template = string.Template(args) + cmdline = template.substitute(env) + else: + cmdline = " ".join(args) + "\n" + + open(os.path.join(self.output, "cmdline"), "w").write(cmdline) p = subprocess.Popen( args, shell=shell, cwd=self.directory, env=env,