From 39c78df7575d24a92f275a798dc1f8ef6fe1bd36 Mon Sep 17 00:00:00 2001 From: Sreejith Sreekumaran <60534136+sreejithsreekumaran@users.noreply.github.com> Date: Tue, 8 Oct 2024 03:19:47 -0700 Subject: [PATCH] Add logfile suffix if a suffix format is provided --- tests/qos/qos_sai_base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/qos/qos_sai_base.py b/tests/qos/qos_sai_base.py index 5f0d14ab6b6..af2d7c539d4 100644 --- a/tests/qos/qos_sai_base.py +++ b/tests/qos/qos_sai_base.py @@ -132,13 +132,17 @@ def runPtfTest(self, ptfhost, testCase='', testParams={}, relax=False, pdb=False """ custom_options = " --disable-ipv6 --disable-vxlan --disable-geneve" \ " --disable-erspan --disable-mpls --disable-nvgre" + # Append a suffix to the logfile name if log_suffix is present in testParams + log_suffix = testParams.get("log_suffix", "") + logfile_suffix = "_{0}".format(log_suffix) if log_suffix else "" + ptf_runner( ptfhost, "saitests", testCase, platform_dir="ptftests", params=testParams, - log_file="/tmp/{0}.log".format(testCase), + log_file="/tmp/{0}{1}.log".format(testCase, logfile_suffix), # Include suffix in the logfile name, qlen=10000, is_python3=True, relax=relax,