diff --git a/py-scripts/sandbox/lf_check.py b/py-scripts/sandbox/lf_check.py index acf1e4ea..1d6c420a 100755 --- a/py-scripts/sandbox/lf_check.py +++ b/py-scripts/sandbox/lf_check.py @@ -28,6 +28,7 @@ import json from json import load import configparser from pprint import * +import subprocess CONFIG_FILE = os.getcwd() + '/py-scripts/sandbox/lf_check_config.ini' @@ -48,6 +49,8 @@ class FileAdapter(object): class lf_check(): def __init__(self): + self.lf_mgr_ip = "" + self.lf_mgr_port = "" self.radio_dict = {} self.test_dict = {} @@ -59,6 +62,13 @@ class lf_check(): print("{}".format(success)) print("{}".format(config_file)) + if 'LF_MGR' in config_file.sections(): + section = config_file['LF_MGR'] + self.lf_mgr_ip = section['LF_MGR_IP'] + self.lf_mgr_port = section['LF_MGR_PORT'] + print("lf_mgr_ip {}".format(self.lf_mgr_ip)) + print("lf_mgr_port {}".format(self.lf_mgr_port)) + # NOTE: this may need to be a list for ssi if 'RADIO_DICTIONARY' in config_file.sections(): section = config_file['RADIO_DICTIONARY'] @@ -71,6 +81,7 @@ class lf_check(): def run_script_test(self): for test in self.test_dict: + # load the default database if self.test_dict[test]['enabled'] == "TRUE": # print("test: {} enable: {} command: {} args: {}".format(self.test_dict[test],self.test_dict[test]['enabled'],self.test_dict[test]['command'],self.test_dict[test]['args'])) @@ -87,6 +98,10 @@ class lf_check(): #print("enable: {} command: {} args: {}".format(self.test_dict[test]['enabled'],self.test_dict[test]['command'],self.test_dict[test]['args'])) command = "./{} {}".format(self.test_dict[test]['command'],self.test_dict[test]['args']) print("command: {}".format(command)) + + process = subprocess.run([command], check= True, stdout=subprocess.PIPE, universal_newlines=True) + + def main(): check = lf_check() #check.parse_ap_stats() diff --git a/py-scripts/sandbox/lf_check_config.ini b/py-scripts/sandbox/lf_check_config.ini index a2ddc890..5e76e6d2 100755 --- a/py-scripts/sandbox/lf_check_config.ini +++ b/py-scripts/sandbox/lf_check_config.ini @@ -15,8 +15,8 @@ RADIO_DICT: { HTTP_TEST_IP = "10.40.0.1" FTP_TEST_IP = "10.40.0.1" -[LF_GUI] -LF_MG= localhost +[LF_MGR] +LF_MGR_IP= localhost LF_MGR_PORT=8080 [REPORTS] @@ -33,8 +33,6 @@ TEST_DICT: { "test_ipv4_l4":{"enabled":"FALSE","command":"test_ipv4_l4.py","args":""}, "test_ipv4_variable_time":{"enabled":"FALSE","command":"test_ipv4_variable_time.py","args":""}, "create_bridge":{"enabled":"FALSE","command":"create_bridge.py","args":""}, - # replace RADIO_0 with args from above, - # "create_l3":{"enabled":"TRUE","command":"create_l3.py","args":" --radio RADIO_0 --ssid RADIO_0_SSID --passwd RADIO_0 --security RADIO_0 --debug"}, "create_l3":{"enabled":"TRUE","command":"create_l3.py","args":"RADIO_0_CFG --debug"}, "create_l4":{"enabled":"TRUE","command":"create_l4.py","args":"RADIO_1_CFG --debug"}, "create_macvlan":{"enabled":"FALSE","command":"create_macvlan.py","args":""},