mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 13:14:32 +02:00
ci: iperf: recognize report results from newer iperf versions
The iperf version used in older version of CI docker images had the following output format: [ 3] 0.0-10.0 sec 1.25 MBytes 1.05 Mbits/sec 0.000 ms 0/ 892 (0%) The newer iperf version which was recently included in the container prints more digits after the decimal point: [ 3] 0.0000-10.0148 sec 1.25 MBytes 1.05 Mbits/sec 0.002 ms 0/ 895 (0%) The regular expression to match this line expected a single zero after the decimal point, so the new format no longer matches. The fix is to expect any number of digits in the fractional part.
This commit is contained in:
@@ -29,7 +29,7 @@ PC_IPERF_TEMP_LOG_FILE = '.tmp_iperf.log'
|
|||||||
class TestResult(object):
|
class TestResult(object):
|
||||||
""" record, analysis test result and convert data to output format """
|
""" record, analysis test result and convert data to output format """
|
||||||
|
|
||||||
PC_BANDWIDTH_LOG_PATTERN = re.compile(r'(\d+).0\s*-\s*(\d+).0\s+sec\s+[\d.]+\s+MBytes\s+([\d.]+)\s+Mbits/sec')
|
PC_BANDWIDTH_LOG_PATTERN = re.compile(r'(\d+\.\d+)\s*-\s*(\d+.\d+)\s+sec\s+[\d.]+\s+MBytes\s+([\d.]+)\s+Mbits\/sec')
|
||||||
DUT_BANDWIDTH_LOG_PATTERN = re.compile(r'(\d+)-\s+(\d+)\s+sec\s+([\d.]+)\s+Mbits/sec')
|
DUT_BANDWIDTH_LOG_PATTERN = re.compile(r'(\d+)-\s+(\d+)\s+sec\s+([\d.]+)\s+Mbits/sec')
|
||||||
|
|
||||||
ZERO_POINT_THRESHOLD = -88 # RSSI, dbm
|
ZERO_POINT_THRESHOLD = -88 # RSSI, dbm
|
||||||
@@ -96,19 +96,22 @@ class TestResult(object):
|
|||||||
"""
|
"""
|
||||||
fall_to_0_recorded = 0
|
fall_to_0_recorded = 0
|
||||||
throughput_list = []
|
throughput_list = []
|
||||||
throughput = 0.0
|
max_throughput = 0.0
|
||||||
result_list = self.PC_BANDWIDTH_LOG_PATTERN.findall(raw_data)
|
result_list = self.PC_BANDWIDTH_LOG_PATTERN.findall(raw_data)
|
||||||
if not result_list:
|
if not result_list:
|
||||||
# failed to find raw data by PC pattern, it might be DUT pattern
|
# failed to find raw data by PC pattern, it might be DUT pattern
|
||||||
result_list = self.DUT_BANDWIDTH_LOG_PATTERN.findall(raw_data)
|
result_list = self.DUT_BANDWIDTH_LOG_PATTERN.findall(raw_data)
|
||||||
|
|
||||||
for result in result_list:
|
for result in result_list:
|
||||||
if int(result[1]) - int(result[0]) != 1:
|
t_start = float(result[0])
|
||||||
|
t_end = float(result[1])
|
||||||
|
throughput = float(result[2])
|
||||||
|
if int(t_end - t_start) != 1:
|
||||||
# this could be summary, ignore this
|
# this could be summary, ignore this
|
||||||
continue
|
continue
|
||||||
throughput_list.append(float(result[2]))
|
throughput_list.append(throughput)
|
||||||
throughput = (throughput if (throughput > float(result[2])) else float(result[2]))
|
max_throughput = max(max_throughput, throughput)
|
||||||
if float(result[2]) == 0 and rssi > self.ZERO_POINT_THRESHOLD \
|
if throughput == 0 and rssi > self.ZERO_POINT_THRESHOLD \
|
||||||
and fall_to_0_recorded < 1:
|
and fall_to_0_recorded < 1:
|
||||||
# throughput fall to 0 error. we only record 1 records for one test
|
# throughput fall to 0 error. we only record 1 records for one test
|
||||||
self.error_list.append('[Error][fall to 0][{}][att: {}][rssi: {}]: 0 throughput interval: {}-{}'
|
self.error_list.append('[Error][fall to 0][{}][att: {}][rssi: {}]: 0 throughput interval: {}-{}'
|
||||||
@@ -116,15 +119,17 @@ class TestResult(object):
|
|||||||
fall_to_0_recorded += 1
|
fall_to_0_recorded += 1
|
||||||
|
|
||||||
if len(throughput_list) < self.THROUGHPUT_QUALIFY_COUNT:
|
if len(throughput_list) < self.THROUGHPUT_QUALIFY_COUNT:
|
||||||
throughput = 0.0
|
self.error_list.append('[Error][Fatal][{}][att: {}][rssi: {}]: Only {} throughput values found, expected at least {}'
|
||||||
|
.format(ap_ssid, att, rssi, len(throughput_list), self.THROUGHPUT_QUALIFY_COUNT))
|
||||||
|
max_throughput = 0.0
|
||||||
|
|
||||||
if throughput == 0 and rssi > self.ZERO_THROUGHPUT_THRESHOLD:
|
if max_throughput == 0 and rssi > self.ZERO_THROUGHPUT_THRESHOLD:
|
||||||
self.error_list.append('[Error][Fatal][{}][att: {}][rssi: {}]: No throughput data found'
|
self.error_list.append('[Error][Fatal][{}][att: {}][rssi: {}]: No throughput data found'
|
||||||
.format(ap_ssid, att, rssi))
|
.format(ap_ssid, att, rssi))
|
||||||
|
|
||||||
self._save_result(throughput, ap_ssid, att, rssi, heap_size)
|
self._save_result(max_throughput, ap_ssid, att, rssi, heap_size)
|
||||||
|
|
||||||
return throughput
|
return max_throughput
|
||||||
|
|
||||||
def post_analysis(self): # type: () -> None
|
def post_analysis(self): # type: () -> None
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user