From a243e95707a1f4e8bc98317b208f318911f9d22c Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 14 Oct 2021 15:24:14 -0600 Subject: [PATCH] test_l3_longevity.py : added back in the port reset code there will be another commit after more testing to add help ct_us_001_tests.json updated to run reset test in test_l3_longevity.py Signed-off-by: Chuck SmileyRekiere --- py-scripts/test_l3_longevity.py | 23 +++++++++++++++++++++++ py-scripts/tools/ct_us_001_tests.json | 15 ++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/py-scripts/test_l3_longevity.py b/py-scripts/test_l3_longevity.py index 02c595fd..f2a262d7 100755 --- a/py-scripts/test_l3_longevity.py +++ b/py-scripts/test_l3_longevity.py @@ -56,6 +56,7 @@ import argparse import time import datetime import csv +import random if sys.version_info[0] != 3: print("This script requires Python 3") @@ -415,6 +416,27 @@ class L3VariableTime(Realm): #print("total-dl: ", total_dl, " total-ul: ", total_ul, "\n") return endp_rx_map, endp_rx_drop_map, endps, total_dl, total_ul, total_dl_ll, total_ul_ll + # This script supports resetting ports, allowing one to test AP/controller under data load + # while bouncing wifi stations. Check here to see if we should reset ports. + def reset_port_check(self): + for station_profile in self.station_profiles: + if station_profile.reset_port_extra_data['reset_port_enable']: + if station_profile.reset_port_extra_data['reset_port_timer_started'] == False: + print("reset_port_time_min: {}".format(station_profile.reset_port_extra_data['reset_port_time_min'])) + print("reset_port_time_max: {}".format(station_profile.reset_port_extra_data['reset_port_time_max'])) + station_profile.reset_port_extra_data['seconds_till_reset'] = \ + random.randint(station_profile.reset_port_extra_data['reset_port_time_min'],\ + station_profile.reset_port_extra_data['reset_port_time_max']) + station_profile.reset_port_extra_data['reset_port_timer_started'] = True + print("on radio {} seconds_till_reset {}".format(station_profile.add_sta_data['radio'],station_profile.reset_port_extra_data['seconds_till_reset'])) + else: + station_profile.reset_port_extra_data['seconds_till_reset'] = station_profile.reset_port_extra_data['seconds_till_reset'] - 1 + if self.debug: print("radio: {} countdown seconds_till_reset {}".format(station_profile.add_sta_data['radio'] ,station_profile.reset_port_extra_data['seconds_till_reset'])) + if ((station_profile.reset_port_extra_data['seconds_till_reset'] <= 0)): + station_profile.reset_port_extra_data['reset_port_timer_started'] = False + port_to_reset = random.randint(0,len(station_profile.station_names)-1) + print("reset on radio {} station: {}".format(station_profile.add_sta_data['radio'],station_profile.station_names[port_to_reset])) + self.reset_port(station_profile.station_names[port_to_reset]) # Common code to generate timestamp for CSV files. def time_stamp(self): @@ -752,6 +774,7 @@ class L3VariableTime(Realm): while cur_time < interval_time: cur_time = datetime.datetime.now() + self.reset_port_check() time.sleep(.2) self.epoch_time = int(time.time()) diff --git a/py-scripts/tools/ct_us_001_tests.json b/py-scripts/tools/ct_us_001_tests.json index 7dc241d5..4016ecf9 100644 --- a/py-scripts/tools/ct_us_001_tests.json +++ b/py-scripts/tools/ct_us_001_tests.json @@ -23,7 +23,7 @@ "command":"test_l3_longevity.py", "args":"", "args_list":[ - " --lfmgr LF_MGR_IP --test_duration 15s --polling_interval 5s --upstream_port eth2 ", + " --lfmgr LF_MGR_IP --test_duration 90s --polling_interval 10s --upstream_port eth2 ", " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED' ", " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000" ] @@ -43,6 +43,19 @@ ] } }, + "suite_l3_reset":{ + "test_l3_longevity":{ + "enabled":"TRUE", + "load_db":"skip", + "command":"test_l3_longevity.py", + "args":"", + "args_list":[ + " --lfmgr LF_MGR_IP --test_duration 90s --polling_interval 10s --upstream_port eth2 ", + " use_ssid_idx=1 --radio 'radio==wiphy1,stations==4,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,reset_port_enable==TRUE,reset_port_time_min==1s,reset_port_time_max==5s' ", + " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000" + ] + } + }, "suite_wc_dp_shorter":{ "create_chamberview_dut_mt7915e_wc":{ "enabled":"TRUE",