From 5ba832e47dc70ff83c64b6ae622e5db68cd0635d Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 15 May 2021 08:08:00 -0600 Subject: [PATCH] lf_check.py lf_check_config.ini : support for additional configuration in lf_check_config.ini, Signed-off-by: Chuck SmileyRekiere --- py-scripts/sandbox/lf_check.py | 43 ++++++++++++++++++++++++-- py-scripts/sandbox/lf_check_config.ini | 6 +++- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/py-scripts/sandbox/lf_check.py b/py-scripts/sandbox/lf_check.py index cdd1d151..7f6c9049 100755 --- a/py-scripts/sandbox/lf_check.py +++ b/py-scripts/sandbox/lf_check.py @@ -71,6 +71,16 @@ class lf_check(): self.background_red = "background-color:red" self.background_purple = "background-color:purple" + self.http_test_ip = "" + self.ftp_test_ip = "" + self.test_ip = "" + + self.radio_lf = "" + self.ssdi = "" + self.ssid_pw = "" + self.security = "" + self.num_sta = "" + def get_html_results(self): return self.html_results @@ -114,14 +124,28 @@ class lf_check(): print("lf_mgr_ip {}".format(self.lf_mgr_ip)) print("lf_mgr_port {}".format(self.lf_mgr_port)) - if 'TEST_IP' in config_file.sections(): - section = config_file['TEST_IP'] + if 'TEST_NETWORK' in config_file.sections(): + section = config_file['TEST_NETWORK'] self.http_test_ip = section['HTTP_TEST_IP'] print("http_test_ip {}".format(self.http_test_ip)) self.ftp_test_ip = section['FTP_TEST_IP'] print("ftp_test_ip {}".format(self.ftp_test_ip)) + self.test_ip = section['TEST_IP'] + print("test_ip {}".format(self.test_ip)) + + if 'TEST_GENERIC' in config_file.sections(): + section = config_file['TEST_GENERIC'] + self.radio_lf = section['RADIO_USED'] + print("radio_lf {}".format(self.radio_lf)) + self.ssid = section['SSID_USED'] + print("ssid {}".format(self.ssid)) + self.ssid_pw = section['SSID_PW_USED'] + print("ssid_pw {}".format(self.ssid_pw)) + self.security = section['SECURITY_USED'] + print("secruity {}".format(self.security)) + self.num_sta = section['NUM_STA'] + print("num_sta {}".format(self.num_sta)) - # NOTE: this may need to be a list for ssi if 'RADIO_DICTIONARY' in config_file.sections(): section = config_file['RADIO_DICTIONARY'] self.radio_dict = json.loads(section.get('RADIO_DICT', self.radio_dict)) @@ -181,6 +205,19 @@ class lf_check(): self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('HTTP_TEST_IP',self.http_test_ip) if 'FTP_TEST_IP' in self.test_dict[test]['args']: self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('FTP_TEST_IP',self.ftp_test_ip) + if 'TEST_IP' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('TEST_IP',self.test_ip) + + if 'RADIO_USED' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('RADIO_USED',self.radio_lf) + if 'SSID_USED' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SSID_USED',self.ssid) + if 'SSID_PW_USED' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SSID_PW_USED',self.ssid_pw) + if 'SECURITY_USED' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SECURITY_USED',self.security) + if 'NUM_STA' in self.test_dict[test]['args']: + self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('NUM_STA',self.num_sta) self.load_factory_default_db() sleep(5) # the sleep is to allow for the database to stablize diff --git a/py-scripts/sandbox/lf_check_config.ini b/py-scripts/sandbox/lf_check_config.ini index cde63e6c..56268ec2 100755 --- a/py-scripts/sandbox/lf_check_config.ini +++ b/py-scripts/sandbox/lf_check_config.ini @@ -19,6 +19,7 @@ RADIO_DICT: { [TEST_IP] HTTP_TEST_IP = "10.40.0.1" FTP_TEST_IP = "10.40.0.1" +TEST_IP = "10.40.0.1" [LF_MGR] LF_MGR_IP= localhost @@ -36,7 +37,10 @@ TEST_DICT: { "example_security_connection2":{"enabled":"TRUE","command":"example_security_connection.py","args":"RADIO_3_CFG --debug"}, "example_security_connection3":{"enabled":"TRUE","command":"example_security_connection.py","args":"RADIO_4_CFG --debug"}, "sta_connect2":{"enabled":"TRUE","command":"sta_connect2.py","args":"--dut_ssid jedway-wpa2-x2048-5-3 --dut_passwd jedway-wpa2-x2048-5-3 --dut_security wpa2"}, - "test_generic":{"enabled":"FALSE","command":"test_generic.py","args":"RADIO_0_CFG --type lfping --dest 10.40.0.1 --debug"}, + "test_generic0":{"enabled":"TRUE","command":"test_generic.py","args":"RADIO_0_CFG --type lfping --dest TEST_IP --debug"}, + "test_generic1":{"enabled":"TRUE","command":"test_generic.py","args":"RADIO_0_CFG --type speedtest --speedtest_min_up --speedtest_min_dl 20 --speedtest_max_ping 150 --debug"}, + "test_generic2":{"enabled":"TRUE","command":"test_generic.py","args":"RADIO_0_CFG --type lfping --dest TEST_IP --debug"}, + "test_generic3":{"enabled":"TRUE","command":"test_generic.py","args":"RADIO_0_CFG --type lfping --dest TEST_IP --debug"}, "test_ipv4_connection":{"enabled":"FALSE","command":"test_ipv4_connection.py","args":"RADIO_0_CFG --debug"}, "test_ipv4_l4_urls_per_ten":{"enabled":"FALSE","command":"test_ipv4_l4_urls_per_ten.py","args":""}, "test_ipv4_l4_wifi":{"enabled":"FALSE","command":"test_ipv4_l4_wifi.py","args":""},