From 5fd5ed43c748879a666f17f2489de1c42bc1836f Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Fri, 27 Sep 2024 12:06:21 +0200 Subject: [PATCH] CI: Adjust regex patterns for Iperf3 UDP log parsing Update the regex for both sender and receiver data to allow optional bitrate unit prefixes - accepts also no prefix. Modify the patterns for lost and total packets to accept negative values (`-?\d+`). --- ci-scripts/cls_oaicitest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index b321de40f4..fdc049be5d 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -144,8 +144,8 @@ def Iperf_analyzeV3UDP(filename, iperf_bitrate_threshold, iperf_packetloss_thres receiver_bitrate = None with open(filename, 'r') as server_file: for line in server_file.readlines(): - res_sender = re.search(r'(?P[0-9\.]+)\s+(?P[KMG]bits\/sec)\s+(?P[0-9\.]+\s+ms)\s+(?P\d+)/(?P\d+) \((?P[0-9\.]+).*?\s+(sender)', line) - res_receiver = re.search(r'(?P[0-9\.]+)\s+(?P[KMG]bits\/sec)\s+(?P[0-9\.]+\s+ms)\s+(?P-?\d+)/(?P\d+)\s+\((?P[0-9\.]+)%\).*?(receiver)', line) + res_sender = re.search(r'(?P[0-9\.]+)\s+(?P[KMG]?bits\/sec)\s+(?P[0-9\.]+\s+ms)\s+(?P-?\d+)/(?P-?\d+) \((?P[0-9\.]+).*?\s+(sender)', line) + res_receiver = re.search(r'(?P[0-9\.]+)\s+(?P[KMG]?bits\/sec)\s+(?P[0-9\.]+\s+ms)\s+(?P-?\d+)/(?P-?\d+)\s+\((?P[0-9\.]+)%\).*?(receiver)', line) if res_sender is not None: sender_bitrate = res_sender.group('bitrate') sender_unit = res_sender.group('unit')