mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 11:18:03 +00:00
lf_check.py : added COL_NAMES for tests, updated lf_check_config.ini to support
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
@@ -80,6 +80,8 @@ class lf_check():
|
|||||||
self.ssid_pw = ""
|
self.ssid_pw = ""
|
||||||
self.security = ""
|
self.security = ""
|
||||||
self.num_sta = ""
|
self.num_sta = ""
|
||||||
|
self.col_names = ""
|
||||||
|
self.upstream_port = ""
|
||||||
|
|
||||||
def get_html_results(self):
|
def get_html_results(self):
|
||||||
return self.html_results
|
return self.html_results
|
||||||
@@ -145,6 +147,11 @@ class lf_check():
|
|||||||
print("secruity {}".format(self.security))
|
print("secruity {}".format(self.security))
|
||||||
self.num_sta = section['NUM_STA']
|
self.num_sta = section['NUM_STA']
|
||||||
print("num_sta {}".format(self.num_sta))
|
print("num_sta {}".format(self.num_sta))
|
||||||
|
self.col_names = section['COL_NAMES']
|
||||||
|
print("col_names {}".format(self.col_names))
|
||||||
|
self.upstream_port = section['UPSTREAM_PORT']
|
||||||
|
print("upstream_port {}".format(self.upstream_port))
|
||||||
|
|
||||||
|
|
||||||
if 'RADIO_DICTIONARY' in config_file.sections():
|
if 'RADIO_DICTIONARY' in config_file.sections():
|
||||||
section = config_file['RADIO_DICTIONARY']
|
section = config_file['RADIO_DICTIONARY']
|
||||||
@@ -193,13 +200,15 @@ class lf_check():
|
|||||||
print("test: {} skipped".format(test))
|
print("test: {} skipped".format(test))
|
||||||
# load the default database
|
# load the default database
|
||||||
elif self.test_dict[test]['enabled'] == "TRUE":
|
elif self.test_dict[test]['enabled'] == "TRUE":
|
||||||
|
# Make the command replace ment a separate method call.
|
||||||
# loop through radios
|
# loop through radios
|
||||||
for radio in self.radio_dict:
|
for radio in self.radio_dict:
|
||||||
# Replace RADIO, SSID, PASSWD, SECURITY with actual config values (e.g. RADIO_0_CFG to values)
|
# Replace RADIO, SSID, PASSWD, SECURITY with actual config values (e.g. RADIO_0_CFG to values)
|
||||||
# not "KEY" is just a word to refer to the RADIO define (e.g. RADIO_0_CFG) to get the vlaues
|
# not "KEY" is just a word to refer to the RADIO define (e.g. RADIO_0_CFG) to get the vlaues
|
||||||
|
# --num_stations needs to be int not string (no double quotes)
|
||||||
if self.radio_dict[radio]["KEY"] in self.test_dict[test]['args']:
|
if self.radio_dict[radio]["KEY"] in self.test_dict[test]['args']:
|
||||||
self.test_dict[test]['args'] = self.test_dict[test]['args'].replace(self.radio_dict[radio]["KEY"],'--radio "{}" --ssid "{}" --passwd "{}" --security "{}"'
|
self.test_dict[test]['args'] = self.test_dict[test]['args'].replace(self.radio_dict[radio]["KEY"],'--radio "{}" --ssid "{}" --passwd "{}" --security "{}" --num_stations {}'
|
||||||
.format(self.radio_dict[radio]['RADIO'],self.radio_dict[radio]['SSID'],self.radio_dict[radio]['PASSWD'],self.radio_dict[radio]['SECURITY']))
|
.format(self.radio_dict[radio]['RADIO'],self.radio_dict[radio]['SSID'],self.radio_dict[radio]['PASSWD'],self.radio_dict[radio]['SECURITY'],self.radio_dict[radio]['STATIONS']))
|
||||||
|
|
||||||
if 'HTTP_TEST_IP' in self.test_dict[test]['args']:
|
if 'HTTP_TEST_IP' in self.test_dict[test]['args']:
|
||||||
self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('HTTP_TEST_IP',self.http_test_ip)
|
self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('HTTP_TEST_IP',self.http_test_ip)
|
||||||
@@ -218,12 +227,15 @@ class lf_check():
|
|||||||
self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SECURITY_USED',self.security)
|
self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('SECURITY_USED',self.security)
|
||||||
if 'NUM_STA' in self.test_dict[test]['args']:
|
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.test_dict[test]['args'] = self.test_dict[test]['args'].replace('NUM_STA',self.num_sta)
|
||||||
|
if 'COL_NAMES' in self.test_dict[test]['args']:
|
||||||
|
self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('COL_NAMES',self.col_names)
|
||||||
|
if 'UPSTREAM_PORT' in self.test_dict[test]['args']:
|
||||||
|
self.test_dict[test]['args'] = self.test_dict[test]['args'].replace('UPSTREAM_PORT',self.col_names)
|
||||||
|
|
||||||
|
|
||||||
self.load_factory_default_db()
|
self.load_factory_default_db()
|
||||||
sleep(5) # the sleep is to allow for the database to stablize
|
sleep(5) # the sleep is to allow for the database to stablize
|
||||||
|
|
||||||
# this is just to get the directory with the scripts to run.
|
|
||||||
#print("file_wd {}".format(self.scripts_wd))
|
|
||||||
try:
|
try:
|
||||||
os.chdir(self.scripts_wd)
|
os.chdir(self.scripts_wd)
|
||||||
#print("Current Working Directory {}".format(os.getcwd()))
|
#print("Current Working Directory {}".format(os.getcwd()))
|
||||||
@@ -234,8 +246,6 @@ class lf_check():
|
|||||||
print("command: {}".format(command))
|
print("command: {}".format(command))
|
||||||
print("cmd_args {}".format(cmd_args))
|
print("cmd_args {}".format(cmd_args))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if self.outfile is not None:
|
if self.outfile is not None:
|
||||||
stdout_log_txt = self.outfile
|
stdout_log_txt = self.outfile
|
||||||
stdout_log_txt = stdout_log_txt + "-{}-stdout.txt".format(test)
|
stdout_log_txt = stdout_log_txt + "-{}-stdout.txt".format(test)
|
||||||
@@ -245,6 +255,7 @@ class lf_check():
|
|||||||
stderr_log_txt = stderr_log_txt + "-{}-stderr.txt".format(test)
|
stderr_log_txt = stderr_log_txt + "-{}-stderr.txt".format(test)
|
||||||
#print("stderr_log_txt: {}".format(stderr_log_txt))
|
#print("stderr_log_txt: {}".format(stderr_log_txt))
|
||||||
stderr_log = open(stderr_log_txt, 'a')
|
stderr_log = open(stderr_log_txt, 'a')
|
||||||
|
|
||||||
process = subprocess.Popen((command).split(' '), shell=False, stdout=stdout_log, stderr=stderr_log, universal_newlines=True)
|
process = subprocess.Popen((command).split(' '), shell=False, stdout=stdout_log, stderr=stderr_log, universal_newlines=True)
|
||||||
try:
|
try:
|
||||||
out, err = process.communicate(timeout=20)
|
out, err = process.communicate(timeout=20)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ SSID_USED = "jedway-wpa2-x2048-4-1"
|
|||||||
SSID_PW_USED = "jedway-wpa2-x2048-4-1"
|
SSID_PW_USED = "jedway-wpa2-x2048-4-1"
|
||||||
SECURITY_USED = "wpa2"
|
SECURITY_USED = "wpa2"
|
||||||
NUM_STA = "3"
|
NUM_STA = "3"
|
||||||
|
COL_NAMES = "name,tx_bytes,rx_bytes,dropped"
|
||||||
|
|
||||||
|
|
||||||
[LF_MGR]
|
[LF_MGR]
|
||||||
@@ -37,23 +38,28 @@ LF_MGR_PORT=8080
|
|||||||
REPORT_DIR="/home/lanforge/html-reports"
|
REPORT_DIR="/home/lanforge/html-reports"
|
||||||
REPORT_DATA="/home/lanforge/report-data"
|
REPORT_DATA="/home/lanforge/report-data"
|
||||||
|
|
||||||
|
[TEST_PARAMETERS]
|
||||||
|
TEST_TIMEOUT = "120"
|
||||||
|
|
||||||
# NOTE: the
|
# NOTE: the
|
||||||
[TEST_DICTIONARY]
|
[TEST_DICTIONARY]
|
||||||
TEST_DICT: {
|
TEST_DICT: {
|
||||||
"example_security_connection0":{"enabled":"FALSE","command":"example_security_connection.py","args":"RADIO_0_CFG --debug"},
|
"example_security_connection0":{"enabled":"TRUE","command":"example_security_connection.py","args":"RADIO_0_CFG --debug"},
|
||||||
"example_security_connection1":{"enabled":"FALSE","command":"example_security_connection.py","args":"RADIO_2_CFG --debug"},
|
"example_security_connection1":{"enabled":"TRUE","command":"example_security_connection.py","args":"RADIO_2_CFG --debug"},
|
||||||
"example_security_connection2":{"enabled":"FALSE","command":"example_security_connection.py","args":"RADIO_3_CFG --debug"},
|
"example_security_connection2":{"enabled":"TRUE","command":"example_security_connection.py","args":"RADIO_3_CFG --debug"},
|
||||||
"example_security_connection3":{"enabled":"FALSE","command":"example_security_connection.py","args":"RADIO_4_CFG --debug"},
|
"example_security_connection3":{"enabled":"TRUE","command":"example_security_connection.py","args":"RADIO_4_CFG --debug"},
|
||||||
"sta_connect2":{"enabled":"TRUE","FALSE":"sta_connect2.py","args":"--dut_ssid jedway-wpa2-x2048-5-3 --dut_passwd jedway-wpa2-x2048-5-3 --dut_security wpa2"},
|
"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_generic0":{"enabled":"FALSE","command":"test_generic.py","args":"RADIO_1_CFG --type lfping --dest TEST_IP --debug"},
|
"sta_connect_example":{"enabled":"TRUE","command":"sta_connect_example.py"},
|
||||||
|
"test_generic0":{"enabled":"TRUE","command":"test_generic.py","args":"RADIO_1_CFG --type lfping --dest TEST_IP --debug"},
|
||||||
"test_generic1":{"enabled":"TRUE","command":"test_generic.py","args":"RADIO_1_CFG --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --debug"},
|
"test_generic1":{"enabled":"TRUE","command":"test_generic.py","args":"RADIO_1_CFG --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --debug"},
|
||||||
"test_generic2":{"enabled":"TRUE","command":"test_generic.py","args":"RADIO_1_CFG --type lfping --dest TEST_IP --debug"},
|
"test_generic2":{"enabled":"TRUE","command":"test_generic.py","args":"RADIO_1_CFG --type lfping --dest TEST_IP --debug"},
|
||||||
"test_generic3":{"enabled":"TRUE","command":"test_generic.py","args":"RADIO_1_CFG --type lfping --dest TEST_IP --debug"},
|
"test_generic3":{"enabled":"TRUE","command":"test_generic.py","args":"RADIO_1_CFG --type lfping --dest TEST_IP --debug"},
|
||||||
"test_ipv4_connection":{"enabled":"TRUE","command":"test_ipv4_connection.py","args":"RADIO_0_CFG --debug"},
|
"test_ipv4_connection":{"enabled":"TRUE","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_urls_per_ten":{"enabled":"TRUE","command":"test_ipv4_l4_urls_per_ten.py","args":"RADIO_0_CFG --num_tests 1 --requests_per_ten 600 --target_per_ten 600 --debug"},
|
||||||
"test_ipv4_l4_wifi":{"enabled":"FALSE","command":"test_ipv4_l4_wifi.py","args":""},
|
"test_ipv4_l4_wifi":{"enabled":"TRUE","command":"test_ipv4_l4_wifi.py","args":"RADIO_0_CFG --test_duration 15s --debug"},
|
||||||
"test_ipv4_l4":{"enabled":"FALSE","command":"test_ipv4_l4.py","args":""},
|
"test_ipv4_l4":{"enabled":"TRUE","command":"test_ipv4_l4.py","args":"RADIO_0_CFG --test_duration 15s --debug"},
|
||||||
"test_ipv4_variable_time":{"enabled":"FALSE","command":"test_ipv4_variable_time.py","args":""},
|
"test_ipv4_variable_time0":{"enabled":"TRUE","command":"test_ipv4_variable_time.py","args":"RADIO_0_CFG --test_duration 15s --output_format excel --layer3_cols COL_NAMES --traffic_type lf_udp --debug"},
|
||||||
|
"test_ipv4_variable_time1":{"enabled":"TRUE","command":"test_ipv4_variable_time.py","args":"RADIO_0_CFG --test_duration 15s --output_format csv --layer3_cols COL_NAMES --traffic_type lf_udp --debug"},
|
||||||
"create_bridge":{"enabled":"FALSE","command":"create_bridge.py","args":""},
|
"create_bridge":{"enabled":"FALSE","command":"create_bridge.py","args":""},
|
||||||
"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"},
|
||||||
|
|||||||
Reference in New Issue
Block a user