mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-04 04:38:02 +00:00 
			
		
		
		
	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 <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
		@@ -56,6 +56,7 @@ import argparse
 | 
				
			|||||||
import time
 | 
					import time
 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
import csv
 | 
					import csv
 | 
				
			||||||
 | 
					import random
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if sys.version_info[0] != 3:
 | 
					if sys.version_info[0] != 3:
 | 
				
			||||||
    print("This script requires Python 3")
 | 
					    print("This script requires Python 3")
 | 
				
			||||||
@@ -415,6 +416,27 @@ class L3VariableTime(Realm):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        #print("total-dl: ", total_dl, " total-ul: ", total_ul, "\n")
 | 
					        #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
 | 
					        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.
 | 
					    # Common code to generate timestamp for CSV files.
 | 
				
			||||||
    def time_stamp(self):
 | 
					    def time_stamp(self):
 | 
				
			||||||
@@ -752,6 +774,7 @@ class L3VariableTime(Realm):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                        while cur_time < interval_time:
 | 
					                        while cur_time < interval_time:
 | 
				
			||||||
                            cur_time = datetime.datetime.now()
 | 
					                            cur_time = datetime.datetime.now()
 | 
				
			||||||
 | 
					                            self.reset_port_check()
 | 
				
			||||||
                            time.sleep(.2)
 | 
					                            time.sleep(.2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        self.epoch_time = int(time.time())
 | 
					                        self.epoch_time = int(time.time())
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,7 +23,7 @@
 | 
				
			|||||||
                "command":"test_l3_longevity.py",
 | 
					                "command":"test_l3_longevity.py",
 | 
				
			||||||
                "args":"",
 | 
					                "args":"",
 | 
				
			||||||
                "args_list":[
 | 
					                "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' ",
 | 
					                    " 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"
 | 
					                    " --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":{
 | 
					        "suite_wc_dp_shorter":{
 | 
				
			||||||
            "create_chamberview_dut_mt7915e_wc":{
 | 
					            "create_chamberview_dut_mt7915e_wc":{
 | 
				
			||||||
                "enabled":"TRUE",
 | 
					                "enabled":"TRUE",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user