diff options
author | Yulong Pei <yulong.pei@intel.com> | 2023-02-06 08:09:02 +0000 |
---|---|---|
committer | Peter Mikus <peter.mikus@protonmail.ch> | 2023-02-13 10:47:03 +0000 |
commit | 9a0d6a86aadb5dfcc9fb55af2a8efc4881540579 (patch) | |
tree | a4c910c56fe79c64e952d677b07b2c7cb36d4d04 /resources/tools | |
parent | 72aba98d0d6325c34cc4412401f9020497688388 (diff) |
Fix issue in csit hoststack test
1. ABTool.py, fix error in parsing the return result of ab
2. DUTSetup.py, add sleep to wait for the program to start
Signed-off-by: Peng Lu <pengx.lu@intel.com>
Signed-off-by: Xinfeng Zhao <xinfengx.zhao@intel.com>
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
Change-Id: I1cffa28d8492bcc27ae188f1e084b80afad60502
Diffstat (limited to 'resources/tools')
-rw-r--r-- | resources/tools/ab/ABTools.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/resources/tools/ab/ABTools.py b/resources/tools/ab/ABTools.py index bb21ea351f..b929b49fdd 100644 --- a/resources/tools/ab/ABTools.py +++ b/resources/tools/ab/ABTools.py @@ -13,6 +13,7 @@ """ab implementation into CSIT framework.""" +from re import search from resources.libraries.python.Constants import Constants from resources.libraries.python.model.ExportResult import ( export_hoststack_results @@ -167,15 +168,16 @@ class ABTools: failed_requests = None for line in stdout.splitlines(): if f"Connection {rps_cps} rate:" in line: - rate = float(line.split(" ")[3]) + rate = float(search(r":\s*(\d+\.?\d+)", line).group(1)) elif "Transfer Rate:" in line: - bandwidth = float(line.split(" ")[2]) * 8000 + bandwidth = \ + float(search(r":\s*(\d+\.?\d+)", line).group(1)) * 8000 elif "Latency:" in line: - latency = float(line.split(" ")[1]) + latency = float(search(r":\s*(\d+\.?\d+)", line).group(1)) elif "Completed requests:" in line: - completed_requests = int(line.split(" ")[2]) + completed_requests = int(search(r":\s*(\d+)", line).group(1)) elif "Failed requests" in line: - failed_requests = int(line.split(" ")[2]) + failed_requests = int(search(r":\s*(\d+)", line).group(1)) export_hoststack_results( bandwidth, rate, rate_unit, latency, failed_requests, |