From a74376ab8dcd52a409c49ea9a352c2d8e5e37d34 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 24 Aug 2021 17:34:58 -0600 Subject: [PATCH] test_l3_longevity.py : ul and dl per port Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 52 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 0296a405..53f05aaa 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -289,12 +289,12 @@ class L3VariableTime(Realm): def get_endp_stats_for_port(self, eid_name, endps): lat = 0 jit = 0 - total_dl_rx_rate = 0 - total_dl_rx_rate_ll = 0 - total_dl_rx_pkts_ll = 0 - total_ul_rx_rate = 0 - total_ul_rx_rate_ll = 0 - total_ul_rx_pkts_ll = 0 + total_dl_rate = 0 + total_dl_rate_ll = 0 + total_dl_pkts_ll = 0 + total_ul_rate = 0 + total_ul_rate_ll = 0 + total_ul_pkts_ll = 0 count = 0 #print("endp-stats-for-port, port-eid: {}".format(eid_name)) @@ -322,14 +322,12 @@ class L3VariableTime(Realm): print("endp name {name}".format(name=name)) if name.endswith("-A"): print("name has -A") - total_dl_rx_rate += int(endp["rx rate"]) - total_dl_rx_rate_ll += int(endp["rx rate ll"]) - total_dl_rx_pkts_ll += int(endp["rx pkts ll"]) - else: - print("name has -B") - total_ul_rx_rate += int(endp["rx rate"]) - total_ul_rx_rate_ll += int(endp["rx rate ll"]) - total_ul_rx_pkts_ll += int(endp["rx pkts ll"]) + total_dl_rate += int(endp["rx rate"]) + total_dl_rate_ll += int(endp["rx rate ll"]) + total_dl_pkts_ll += int(endp["rx pkts ll"]) + total_ul_rate += int(endp["tx rate"]) + total_ul_rate_ll += int(endp["tx rate ll"]) + total_ul_pkts_ll += int(endp["tx pkts ll"]) count += 1 print("Matched: name: {name} eid:{eid} to endp-id {eid_endp}".format(name=name,eid=eid,eid_endp=eid_endp)) @@ -341,7 +339,7 @@ class L3VariableTime(Realm): lat = int(lat / count) jit = int(jit / count) - return lat, jit, total_dl_rx_rate, total_dl_rx_rate_ll, total_dl_rx_pkts_ll, total_ul_rx_rate, total_ul_rx_rate_ll, total_ul_rx_pkts_ll + return lat, jit, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll # Query all endpoints to generate rx and other stats, returned # as an array of objects. @@ -782,7 +780,7 @@ class L3VariableTime(Realm): print("selected ap_row (from split_row): {}".format(ap_row)) # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rx_rate, total_ul_rx_rate_ll, total_ul_rx_pkts_ll, total_dl_rx_rate, total_dl_rx_rate_ll, total_dl_rx_pkts_ll = self.get_endp_stats_for_port(p["port"], endps) + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port(p["port"], endps) # now report the ap_chanim_stats along side of the ap_stats_5g xtop_reported = False @@ -810,8 +808,8 @@ class L3VariableTime(Realm): ap_stats_5g_col_titles = ['Station Address','PHY Mbps','Data Mbps','Air Use','Data Use','Retries','bw','mcs','Nss','ofdma','mu-mimo','channel_utilization'] self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rx_rate, total_ul_rx_rate_ll, total_ul_rx_pkts_ll, - total_dl_rx_rate, total_dl_rx_rate_ll, total_dl_rx_pkts_ll , ap_row, ap_stats_5g_col_titles) #ap_stats_5g_col_titles used as a length + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll , ap_row, ap_stats_5g_col_titles) #ap_stats_5g_col_titles used as a length if self.ap_test_mode: # Create the test data as a continuous string ap_stats_2g="{}{}{}{}{}{}".format("root@Docsis-Gateway:~# wl -i wl1 bs_data\n", @@ -884,7 +882,7 @@ class L3VariableTime(Realm): print("selected ap_row (from split_row): {}".format(ap_row)) # Find latency, jitter for connections using this port. - latency, jitter, total_ul_rx_rate, total_ul_rx_rate_ll, total_ul_rx_pkts_ll, total_dl_rx_rate, total_dl_rx_rate_ll, total_dl_rx_pkts_ll = self.get_endp_stats_for_port(p["port"], endps) + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll = self.get_endp_stats_for_port(p["port"], endps) # now report the ap_chanim_stats along side of the ap_stats_2g xtop_reported = False @@ -912,8 +910,8 @@ class L3VariableTime(Realm): ap_stats_2g_col_titles = ['Station Address','PHY Mbps','Data Mbps','Air Use','Data Use','Retries','bw','mcs','Nss','ofdma','mu-mimo','channel_utilization'] self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rx_rate, total_ul_rx_rate_ll, total_ul_rx_pkts_ll, - total_dl_rx_rate, total_dl_rx_rate_ll, total_dl_rx_pkts_ll, ap_row, ap_stats_2g_col_titles) #ap_stats_2g_col_titles used as a length + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row, ap_stats_2g_col_titles) #ap_stats_2g_col_titles used as a length else: @@ -929,11 +927,11 @@ class L3VariableTime(Realm): pprint(response) else: p = response['interface'] - latency, jitter, total_ul_rx_rate, total_ul_rx_rate_ll, total_ul_rx_pkts_ll, total_dl_rx_rate, total_dl_rx_rate_ll, total_dl_rx_pkts_ll= self.get_endp_stats_for_port(p["port"], endps) + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll= self.get_endp_stats_for_port(p["port"], endps) self.write_port_csv(len(temp_stations_list), ul, dl, ul_pdu_str, dl_pdu_str, atten_val, eid_name, p, - latency, jitter, total_ul_rx_rate, total_ul_rx_rate_ll, total_ul_rx_pkts_ll, - total_dl_rx_rate, total_dl_rx_rate_ll, total_dl_rx_pkts_ll, ap_row, ap_stats_col_titles) #ap_stats_col_titles used as a length + latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row, ap_stats_col_titles) #ap_stats_col_titles used as a length # At end of test step, record KPI information. This is different the kpi.csv @@ -962,15 +960,15 @@ class L3VariableTime(Realm): if passes == expected_passes: self._pass("PASS: Requested-Rate: %s <-> %s PDU: %s <-> %s All tests passed" % (ul, dl, ul_pdu, dl_pdu), print_pass) - def write_port_csv(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, eid_name, port_data, latency, jitter, total_ul_rx_rate, total_ul_rx_rate_ll, total_ul_rx_pkts_ll, - total_dl_rx_rate, total_dl_rx_rate_ll, total_dl_rx_pkts_ll, ap_row, ap_stats_col_titles): + def write_port_csv(self, sta_count, ul, dl, ul_pdu, dl_pdu, atten, eid_name, port_data, latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, + total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll, ap_row, ap_stats_col_titles): row = [self.epoch_time, self.time_stamp(), sta_count, ul, ul, dl, dl, dl_pdu, dl_pdu, ul_pdu, ul_pdu, atten, eid_name ] row = row + [port_data['bps rx'], port_data['bps tx'], port_data['rx-rate'], port_data['tx-rate'], - port_data['signal'], port_data['ap'], port_data['mode'], latency, jitter, total_ul_rx_rate, total_ul_rx_rate_ll, total_ul_rx_pkts_ll, total_dl_rx_rate, total_dl_rx_rate_ll, total_dl_rx_pkts_ll] + port_data['signal'], port_data['ap'], port_data['mode'], latency, jitter, total_ul_rate, total_ul_rate_ll, total_ul_pkts_ll, total_dl_rate, total_dl_rate_ll, total_dl_pkts_ll] #Add in info queried from AP. NOTE: do not need to pass in the ap_stats_col_titles #print("ap_row length {} col_titles length {}".format(len(ap_row),len(self.ap_stats_col_titles)))