mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-04 04:38:02 +00:00 
			
		
		
		
	lf_check.py : added check for IndexError. Comment where to check the script
output. ct_us_001_tests.json : updated for test_l3.py Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
		
				
					committed by
					
						
						shivam
					
				
			
			
				
	
			
			
			
						parent
						
							d13bea8f51
						
					
				
				
					commit
					cabed1cea7
				
			@@ -18,6 +18,29 @@
 | 
				
			|||||||
                    " "
 | 
					                    " "
 | 
				
			||||||
                ]
 | 
					                ]
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
 | 
					            "clean_up_cxs_5g":{
 | 
				
			||||||
 | 
					                "enabled":"TRUE",
 | 
				
			||||||
 | 
					                "command":"lf_cleanup.py",
 | 
				
			||||||
 | 
					                "args":"",
 | 
				
			||||||
 | 
					                "args_list":[
 | 
				
			||||||
 | 
					                    " --mgr LF_MGR_IP --cxs --sta"
 | 
				
			||||||
 | 
					            ]},
 | 
				
			||||||
 | 
					            "test_l3_5g":{
 | 
				
			||||||
 | 
					                "enabled":"TRUE",
 | 
				
			||||||
 | 
					                "load_db":"NONE",
 | 
				
			||||||
 | 
					                "command":"test_l3.py",
 | 
				
			||||||
 | 
					                "args":"",
 | 
				
			||||||
 | 
					                "args_list":[
 | 
				
			||||||
 | 
					                    " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ",
 | 
				
			||||||
 | 
					                    " use_ssid_idx=1 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'",
 | 
				
			||||||
 | 
					                    " use_ssid_idx=1 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'",
 | 
				
			||||||
 | 
					                    " use_ssid_idx=1 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'",
 | 
				
			||||||
 | 
					                    " use_ssid_idx=1 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'",
 | 
				
			||||||
 | 
					                    " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000",
 | 
				
			||||||
 | 
					                    " --test_rig TEST_RIG --test_tag 'test_l3'",
 | 
				
			||||||
 | 
					                    " --dut_model_num  USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN"
 | 
				
			||||||
 | 
					                ]
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
            "clean_up_cxs_endp_sta_flags_AX200_5g":{
 | 
					            "clean_up_cxs_endp_sta_flags_AX200_5g":{
 | 
				
			||||||
                "enabled":"TRUE",
 | 
					                "enabled":"TRUE",
 | 
				
			||||||
                "command":"lf_cleanup.py",
 | 
					                "command":"lf_cleanup.py",
 | 
				
			||||||
@@ -64,6 +87,30 @@
 | 
				
			|||||||
                    " --dut_model_num  USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN"
 | 
					                    " --dut_model_num  USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN"
 | 
				
			||||||
                ]
 | 
					                ]
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
 | 
					            "clean_up_cxs_endp_sta_2g":{
 | 
				
			||||||
 | 
					                "enabled":"TRUE",
 | 
				
			||||||
 | 
					                "command":"lf_cleanup.py",
 | 
				
			||||||
 | 
					                "args":"",
 | 
				
			||||||
 | 
					                "args_list":[
 | 
				
			||||||
 | 
					                    " --mgr LF_MGR_IP --cxs --sta"
 | 
				
			||||||
 | 
					            ]},
 | 
				
			||||||
 | 
					            "test_l3_2g":{
 | 
				
			||||||
 | 
					                "enabled":"TRUE",
 | 
				
			||||||
 | 
					                "load_db":"NONE",
 | 
				
			||||||
 | 
					                "command":"test_l3.py",
 | 
				
			||||||
 | 
					                "args":"",
 | 
				
			||||||
 | 
					                "args_list":[
 | 
				
			||||||
 | 
					                    " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ",
 | 
				
			||||||
 | 
					                    " use_ssid_idx=0 --radio 'radio==wiphy4,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'",
 | 
				
			||||||
 | 
					                    " use_ssid_idx=0 --radio 'radio==wiphy5,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'",
 | 
				
			||||||
 | 
					                    " use_ssid_idx=0 --radio 'radio==wiphy6,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'",
 | 
				
			||||||
 | 
					                    " use_ssid_idx=0 --radio 'radio==wiphy7,stations==1,ssid==SSID_USED,ssid_pw==SSID_PW_USED,security==SECURITY_USED,wifi_mode==0,wifi_settings==wifi_settings,enable_flags==(ht160_enable|wpa2_enable|80211u_enable|create_admin_down)'",
 | 
				
			||||||
 | 
					                    " --endp_type lf_udp --rates_are_totals --side_a_min_bps=20000 --side_b_min_bps=300000000",
 | 
				
			||||||
 | 
					                    " --test_rig TEST_RIG --test_tag 'test_l3'",
 | 
				
			||||||
 | 
					                    " --dut_model_num  USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN"
 | 
				
			||||||
 | 
					                ]
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            "clean_up_cxs_endp_sta_flags_5q_all":{
 | 
					            "clean_up_cxs_endp_sta_flags_5q_all":{
 | 
				
			||||||
                "enabled":"TRUE",
 | 
					                "enabled":"TRUE",
 | 
				
			||||||
                "command":"lf_cleanup.py",
 | 
					                "command":"lf_cleanup.py",
 | 
				
			||||||
@@ -807,6 +854,33 @@
 | 
				
			|||||||
                ]
 | 
					                ]
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					        "suite_test_l3":{
 | 
				
			||||||
 | 
					            "test_l3":{
 | 
				
			||||||
 | 
					                "enabled":"TRUE",
 | 
				
			||||||
 | 
					                "load_db":"skip",
 | 
				
			||||||
 | 
					                "command":"test_l3.py",
 | 
				
			||||||
 | 
					                "args":"",
 | 
				
			||||||
 | 
					                "args_list":[
 | 
				
			||||||
 | 
					                    " --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 15s --polling_interval 5s --upstream_port UPSTREAM_PORT ",
 | 
				
			||||||
 | 
					                    " 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",
 | 
				
			||||||
 | 
					                    " --test_rig TEST_RIG --test_tag 'test_l3'",
 | 
				
			||||||
 | 
					                    " --ap_read --ap_test_mode"
 | 
				
			||||||
 | 
					                ]
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            "lf_qa":{
 | 
				
			||||||
 | 
					                "enabled":"TRUE",
 | 
				
			||||||
 | 
					                "timeout":"600",
 | 
				
			||||||
 | 
					                "load_db":"skip",
 | 
				
			||||||
 | 
					                "command":"./tools/lf_qa.py",
 | 
				
			||||||
 | 
					                "args":"",
 | 
				
			||||||
 | 
					                "args_list":[
 | 
				
			||||||
 | 
					                    " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE"
 | 
				
			||||||
 | 
					                ]
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        "suite_l3_ap":{
 | 
					        "suite_l3_ap":{
 | 
				
			||||||
            "test_l3_longevity":{
 | 
					            "test_l3_longevity":{
 | 
				
			||||||
                "enabled":"TRUE",
 | 
					                "enabled":"TRUE",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -965,7 +965,7 @@ QA Report Dashboard: lf_qa.py was not run as last script of test suite"""
 | 
				
			|||||||
        try:
 | 
					        try:
 | 
				
			||||||
            summary = subprocess.Popen(command_to_run, shell=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
 | 
					            summary = subprocess.Popen(command_to_run, shell=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
 | 
				
			||||||
                                       universal_newlines=True)
 | 
					                                       universal_newlines=True)
 | 
				
			||||||
 | 
					        # TODO the looks one directory higher,  there needs to be a way to execute from higher directory.
 | 
				
			||||||
        except FileNotFoundError:
 | 
					        except FileNotFoundError:
 | 
				
			||||||
            # TODO tx_power is one directory up from py-scripts
 | 
					            # TODO tx_power is one directory up from py-scripts
 | 
				
			||||||
            self.logger.info("FileNotFoundError will try to execute from lanforge Top directory")
 | 
					            self.logger.info("FileNotFoundError will try to execute from lanforge Top directory")
 | 
				
			||||||
@@ -980,6 +980,7 @@ QA Report Dashboard: lf_qa.py was not run as last script of test suite"""
 | 
				
			|||||||
        except IsADirectoryError:
 | 
					        except IsADirectoryError:
 | 
				
			||||||
            self.logger.info("IsADirectoryError on execution of {command}".format(command=command_to_run))
 | 
					            self.logger.info("IsADirectoryError on execution of {command}".format(command=command_to_run))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # This code will read the output as the script is running and log 
 | 
				
			||||||
        for line in iter(summary.stdout.readline, ''):
 | 
					        for line in iter(summary.stdout.readline, ''):
 | 
				
			||||||
            self.logger.info(line)
 | 
					            self.logger.info(line)
 | 
				
			||||||
            summary_output += line
 | 
					            summary_output += line
 | 
				
			||||||
@@ -996,6 +997,8 @@ QA Report Dashboard: lf_qa.py was not run as last script of test suite"""
 | 
				
			|||||||
        os.chdir(self.scripts_wd)
 | 
					        os.chdir(self.scripts_wd)
 | 
				
			||||||
        self.logger.info("Current Working Directory {}".format(os.getcwd()))
 | 
					        self.logger.info("Current Working Directory {}".format(os.getcwd()))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Since using "wait" above the return code will be set. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.logger.info(summary_output)
 | 
					        self.logger.info(summary_output)
 | 
				
			||||||
        stdout_log.write(summary_output)
 | 
					        stdout_log.write(summary_output)
 | 
				
			||||||
        stdout_log.close()
 | 
					        stdout_log.close()
 | 
				
			||||||
@@ -1114,6 +1117,9 @@ QA Report Dashboard: lf_qa.py was not run as last script of test suite"""
 | 
				
			|||||||
                    else:
 | 
					                    else:
 | 
				
			||||||
                        self.test_result = "Some Tests Failed"
 | 
					                        self.test_result = "Some Tests Failed"
 | 
				
			||||||
                        background = self.background_orange
 | 
					                        background = self.background_orange
 | 
				
			||||||
 | 
					                elif 'IndexError: list index out of range' in text:
 | 
				
			||||||
 | 
					                    self.test_result = "Test Errors"
 | 
				
			||||||
 | 
					                    background = self.background_red
 | 
				
			||||||
                elif 'ERROR: FAILED ' in text:
 | 
					                elif 'ERROR: FAILED ' in text:
 | 
				
			||||||
                    self.test_result = "Some Tests Failed"
 | 
					                    self.test_result = "Some Tests Failed"
 | 
				
			||||||
                    background = self.background_orange
 | 
					                    background = self.background_orange
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user