lf_check.py lf_check_config.ini : added lf mgr ip and lf mgr port

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-05-10 05:57:51 -06:00
parent 627219a98d
commit d797a60cc7
2 changed files with 17 additions and 4 deletions

View File

@@ -28,6 +28,7 @@ import json
from json import load from json import load
import configparser import configparser
from pprint import * from pprint import *
import subprocess
CONFIG_FILE = os.getcwd() + '/py-scripts/sandbox/lf_check_config.ini' CONFIG_FILE = os.getcwd() + '/py-scripts/sandbox/lf_check_config.ini'
@@ -48,6 +49,8 @@ class FileAdapter(object):
class lf_check(): class lf_check():
def __init__(self): def __init__(self):
self.lf_mgr_ip = ""
self.lf_mgr_port = ""
self.radio_dict = {} self.radio_dict = {}
self.test_dict = {} self.test_dict = {}
@@ -59,6 +62,13 @@ class lf_check():
print("{}".format(success)) print("{}".format(success))
print("{}".format(config_file)) 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 # NOTE: this may need to be a list for ssi
if 'RADIO_DICTIONARY' in config_file.sections(): if 'RADIO_DICTIONARY' in config_file.sections():
section = config_file['RADIO_DICTIONARY'] section = config_file['RADIO_DICTIONARY']
@@ -71,6 +81,7 @@ class lf_check():
def run_script_test(self): def run_script_test(self):
for test in self.test_dict: for test in self.test_dict:
# load the default database
if self.test_dict[test]['enabled'] == "TRUE": 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'])) # 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'])) #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']) command = "./{} {}".format(self.test_dict[test]['command'],self.test_dict[test]['args'])
print("command: {}".format(command)) print("command: {}".format(command))
process = subprocess.run([command], check= True, stdout=subprocess.PIPE, universal_newlines=True)
def main(): def main():
check = lf_check() check = lf_check()
#check.parse_ap_stats() #check.parse_ap_stats()

View File

@@ -15,8 +15,8 @@ RADIO_DICT: {
HTTP_TEST_IP = "10.40.0.1" HTTP_TEST_IP = "10.40.0.1"
FTP_TEST_IP = "10.40.0.1" FTP_TEST_IP = "10.40.0.1"
[LF_GUI] [LF_MGR]
LF_MG= localhost LF_MGR_IP= localhost
LF_MGR_PORT=8080 LF_MGR_PORT=8080
[REPORTS] [REPORTS]
@@ -33,8 +33,6 @@ TEST_DICT: {
"test_ipv4_l4":{"enabled":"FALSE","command":"test_ipv4_l4.py","args":""}, "test_ipv4_l4":{"enabled":"FALSE","command":"test_ipv4_l4.py","args":""},
"test_ipv4_variable_time":{"enabled":"FALSE","command":"test_ipv4_variable_time.py","args":""}, "test_ipv4_variable_time":{"enabled":"FALSE","command":"test_ipv4_variable_time.py","args":""},
"create_bridge":{"enabled":"FALSE","command":"create_bridge.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_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_l4":{"enabled":"TRUE","command":"create_l4.py","args":"RADIO_1_CFG --debug"},
"create_macvlan":{"enabled":"FALSE","command":"create_macvlan.py","args":""}, "create_macvlan":{"enabled":"FALSE","command":"create_macvlan.py","args":""},