Merge ../lanforge-scripts

This commit is contained in:
shivamcandela
2021-12-17 07:17:29 +05:30
13 changed files with 546 additions and 455 deletions

View File

@@ -339,6 +339,21 @@ clean_old_kernels() {
echo "/lib/modules/$f" echo "/lib/modules/$f"
done | xargs rm -rf done | xargs rm -rf
fi fi
# check to see if there are 50_candela-x files that
# lack a /lib/modules directory
local fifty_files=(`ls /etc/grub.d/50_candela_*`)
local k_v
for file in "${fifty_files[@]}"; do
k_v=${file#/etc/grub.d/50_candela_}
#echo "K_V[$k_v]"
if [ ! -d /lib/modules/$k_v ]; then
echo "/lib/modules/$k_v not found, removing /etc/grub.d/50_candela_$k_v"
rm -f "/etc/grub.d/50_candela_${k_v}"
fi
done
grub2-mkconfig -o /boot/grub2/grub.cfg
if [ -d "/boot2" ]; then if [ -d "/boot2" ]; then
rm -rf /boot2/* rm -rf /boot2/*
rsync -a /boot/. /boot2/ rsync -a /boot/. /boot2/

View File

@@ -5,7 +5,6 @@ import importlib
from pprint import pprint from pprint import pprint
import time import time
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base")
@@ -20,15 +19,16 @@ class MACVLANProfile(LFCliBase):
local_realm, local_realm,
macvlan_parent="eth1", macvlan_parent="eth1",
num_macvlans=1, num_macvlans=1,
admin_down=False, shelf=1,
resource=1,
dhcp=False, dhcp=False,
debug_=False): debug_=False):
super().__init__(lfclient_host, lfclient_port, debug_) super().__init__(lfclient_host, lfclient_port, debug_)
self.local_realm = local_realm self.local_realm = local_realm
self.num_macvlans = num_macvlans self.num_macvlans = num_macvlans
self.macvlan_parent = macvlan_parent self.macvlan_parent = macvlan_parent
self.resource = 1 self.resource = resource
self.shelf = 1 self.shelf = shelf
self.desired_macvlans = [] self.desired_macvlans = []
self.created_macvlans = [] self.created_macvlans = []
self.dhcp = dhcp self.dhcp = dhcp
@@ -123,7 +123,7 @@ class MACVLANProfile(LFCliBase):
print("Creating MACVLANs...") print("Creating MACVLANs...")
req_url = "/cli-json/add_mvlan" req_url = "/cli-json/add_mvlan"
if not self.dhcp and self.first_ip_addr is not None and self.netmask is not None and self.gateway is not None: if not self.dhcp and self.first_ip_addr and self.netmask and self.gateway:
self.desired_set_port_interest_flags.append("ip_address") self.desired_set_port_interest_flags.append("ip_address")
self.desired_set_port_interest_flags.append("ip_Mask") self.desired_set_port_interest_flags.append("ip_Mask")
self.desired_set_port_interest_flags.append("ip_gateway") self.desired_set_port_interest_flags.append("ip_gateway")
@@ -148,7 +148,7 @@ class MACVLANProfile(LFCliBase):
"mac": "xx:xx:xx:*:*:xx", "mac": "xx:xx:xx:*:*:xx",
"port": self.local_realm.name_to_eid(self.macvlan_parent)[2], "port": self.local_realm.name_to_eid(self.macvlan_parent)[2],
"index": int(self.desired_macvlans[i][self.desired_macvlans[i].index('#') + 1:]), "index": int(self.desired_macvlans[i][self.desired_macvlans[i].index('#') + 1:]),
#"dhcp": self.dhcp, # "dhcp": self.dhcp,
"flags": None "flags": None
} }
if admin_down: if admin_down:
@@ -156,8 +156,9 @@ class MACVLANProfile(LFCliBase):
else: else:
data["flags"] = 0 data["flags"] = 0
self.created_macvlans.append("%s.%s.%s#%d" % (self.shelf, self.resource, self.created_macvlans.append("%s.%s.%s#%d" % (self.shelf, self.resource,
self.macvlan_parent, int( self.macvlan_parent,
self.desired_macvlans[i][self.desired_macvlans[i].index('#') + 1:]))) int(self.desired_macvlans[i][
self.desired_macvlans[i].index('#') + 1:])))
self.local_realm.json_post(req_url, data) self.local_realm.json_post(req_url, data)
time.sleep(sleep_time) time.sleep(sleep_time)
@@ -170,13 +171,12 @@ class MACVLANProfile(LFCliBase):
eid = self.local_realm.name_to_eid(self.created_macvlans[i]) eid = self.local_realm.name_to_eid(self.created_macvlans[i])
name = eid[2] name = eid[2]
self.set_port_data["port"] = name # for set_port calls. self.set_port_data["port"] = name # for set_port calls.
if not self.dhcp and self.first_ip_addr is not None and self.netmask is not None \ if not self.dhcp and self.first_ip_addr and self.netmask and self.gateway:
and self.gateway is not None:
self.set_port_data["ip_addr"] = self.ip_list[i] self.set_port_data["ip_addr"] = self.ip_list[i]
self.set_port_data["netmask"] = self.netmask self.set_port_data["netmask"] = self.netmask
self.set_port_data["gateway"] = self.gateway self.set_port_data["gateway"] = self.gateway
set_port_r.addPostData(self.set_port_data) set_port_r.addPostData(self.set_port_data)
json_response = set_port_r.jsonPost(debug) set_port_r.jsonPost(debug)
time.sleep(sleep_time) time.sleep(sleep_time)
def cleanup(self): def cleanup(self):

View File

@@ -557,7 +557,8 @@ class StationProfile:
station_shelf = station_eid[0] station_shelf = station_eid[0]
station_resource = station_eid[1] station_resource = station_eid[1]
station_port = station_eid[2] station_port = station_eid[2]
self.add_sta_data["radio"] = radio radio_eid = self.local_realm.name_to_eid(radio)
self.add_sta_data["radio"] = radio_eid[2]
self.add_sta_data["shelf"] = station_shelf self.add_sta_data["shelf"] = station_shelf
self.add_sta_data["resource"] = station_resource self.add_sta_data["resource"] = station_resource
self.add_sta_data["sta_name"] = station_port self.add_sta_data["sta_name"] = station_port

View File

@@ -55,27 +55,43 @@ class HttpDownload(Realm):
self.port_util = PortUtils(self.local_realm) self.port_util = PortUtils(self.local_realm)
self.http_profile.debug = _debug_on self.http_profile.debug = _debug_on
self.created_cx = {} self.created_cx = {}
self.station_list = []
self.radio = []
def set_values(self): def set_values(self):
# This method will set values according user input # This method will set values according user input
if self.bands == "5G": if self.bands == "5G":
self.radio = [self.fiveg_radio] self.radio = [self.fiveg_radio]
self.station_list = [LFUtils.portNameSeries(prefix_="fiveg_sta", start_id_=self.sta_start_id,
end_id_=self.num_sta - 1, padding_number_=10000,
radio=self.fiveg_radio)]
elif self.bands == "2.4G": elif self.bands == "2.4G":
self.radio = [self.twog_radio] self.radio = [self.twog_radio]
self.station_list = [LFUtils.portNameSeries(prefix_="twog_sta", start_id_=self.sta_start_id,
end_id_=self.num_sta - 1, padding_number_=10000,
radio=self.twog_radio)]
elif self.bands == "Both": elif self.bands == "Both":
self.radio = [self.fiveg_radio, self.twog_radio] self.radio = [self.fiveg_radio, self.twog_radio]
print(self.radio) print(self.radio)
self.num_sta = self.num_sta // 2 # self.num_sta = self.num_sta // 2
self.station_list = [
LFUtils.portNameSeries(prefix_="fiveg_sta", start_id_=self.sta_start_id,
end_id_=self.num_sta - 1, padding_number_=10000,
radio=self.fiveg_radio),
LFUtils.portNameSeries(prefix_="twog_sta", start_id_=self.sta_start_id,
end_id_=self.num_sta - 1, padding_number_=10000,
radio=self.twog_radio)
]
def precleanup(self): def precleanup(self):
self.count = 0 self.count = 0
for rad in self.radio: for rad in range(len(self.radio)):
print("radio", rad) print("radio", self.radio[rad])
if rad == self.fiveg_radio: if self.radio[rad] == self.fiveg_radio:
# select an mode # select an mode
self.station_profile.mode = 10 self.station_profile.mode = 10
self.count = self.count + 1 self.count = self.count + 1
elif rad == self.twog_radio: elif self.radio[rad] == self.twog_radio:
# select an mode # select an mode
self.station_profile.mode = 6 self.station_profile.mode = 6
self.count = self.count + 1 self.count = self.count + 1
@@ -85,24 +101,19 @@ class HttpDownload(Realm):
self.num_sta = 2 * (self.num_sta) self.num_sta = 2 * (self.num_sta)
self.station_profile.mode = 10 self.station_profile.mode = 10
self.http_profile.cleanup() self.http_profile.cleanup()
self.station_list1 = LFUtils.portNameSeries(prefix_="sta", start_id_=self.sta_start_id,
end_id_=self.num_sta - 1, padding_number_=10000,
radio=rad)
# cleanup station list which started sta_id 20 # cleanup station list which started sta_id 20
self.station_profile.cleanup(self.station_list1, debug_=self.local_realm.debug) self.station_profile.cleanup(self.station_list[rad], debug_=self.local_realm.debug)
LFUtils.wait_until_ports_disappear(base_url=self.local_realm.lfclient_url, LFUtils.wait_until_ports_disappear(base_url=self.local_realm.lfclient_url,
port_list=self.station_list, port_list=self.station_list[rad],
debug=self.local_realm.debug) debug=self.local_realm.debug)
return return
# clean dlayer4 ftp traffic # clean dlayer4 ftp traffic
self.http_profile.cleanup() self.http_profile.cleanup()
self.station_list = LFUtils.portNameSeries(prefix_="sta", start_id_=self.sta_start_id,
end_id_=self.num_sta - 1, padding_number_=10000,
radio=rad)
# cleans stations # cleans stations
self.station_profile.cleanup(self.station_list, delay=1, debug_=self.local_realm.debug) self.station_profile.cleanup(self.station_list[rad], delay=1, debug_=self.local_realm.debug)
LFUtils.wait_until_ports_disappear(base_url=self.local_realm.lfclient_url, LFUtils.wait_until_ports_disappear(base_url=self.local_realm.lfclient_url,
port_list=self.station_list, port_list=self.station_list[rad],
debug=self.local_realm.debug) debug=self.local_realm.debug)
time.sleep(1) time.sleep(1)
print("precleanup done") print("precleanup done")
@@ -110,15 +121,16 @@ class HttpDownload(Realm):
def build(self): def build(self):
# enable http on ethernet # enable http on ethernet
self.port_util.set_http(port_name=self.local_realm.name_to_eid(self.upstream)[2], resource=1, on=True) self.port_util.set_http(port_name=self.local_realm.name_to_eid(self.upstream)[2], resource=1, on=True)
for rad in self.radio: for rad in range(len(self.radio)):
self.station_profile.use_security(self.security, self.ssid, self.password) print(self.station_list[rad])
self.station_profile.use_security(self.security[rad], self.ssid[rad], self.password[rad])
self.station_profile.set_command_flag("add_sta", "create_admin_down", 1) self.station_profile.set_command_flag("add_sta", "create_admin_down", 1)
self.station_profile.set_command_param("set_port", "report_timer", 1500) self.station_profile.set_command_param("set_port", "report_timer", 1500)
self.station_profile.set_command_flag("set_port", "rpt_timer", 1) self.station_profile.set_command_flag("set_port", "rpt_timer", 1)
self.station_profile.create(radio=rad, sta_names_=self.station_list, debug=self.local_realm.debug) self.station_profile.create(radio=self.radio[rad], sta_names_=self.station_list[rad], debug=self.local_realm.debug)
self.local_realm.wait_until_ports_appear(sta_list=self.station_list) self.local_realm.wait_until_ports_appear(sta_list=self.station_list[rad])
self.station_profile.admin_up() self.station_profile.admin_up()
if self.local_realm.wait_for_ip(self.station_list, timeout_sec=60): if self.local_realm.wait_for_ip(self.station_list[rad], timeout_sec=60):
self.local_realm._pass("All stations got IPs") self.local_realm._pass("All stations got IPs")
else: else:
self.local_realm._fail("Stations failed to get IPs") self.local_realm._fail("Stations failed to get IPs")
@@ -138,7 +150,6 @@ class HttpDownload(Realm):
suppress_related_commands_=None, http=True, suppress_related_commands_=None, http=True,
http_ip=ip_upstream + "/webpage.html") http_ip=ip_upstream + "/webpage.html")
if self.count == 2: if self.count == 2:
self.station_list = self.station_list1
self.station_profile.mode = 6 self.station_profile.mode = 6
print("Test Build done") print("Test Build done")
@@ -479,44 +490,60 @@ class HttpDownload(Realm):
# Section commented because graphing breaks two band report generation # Section commented because graphing breaks two band report generation
# TODO: Fix graphing bug with multiple bands being recorded # TODO: Fix graphing bug with multiple bands being recorded
# if bands == "Both":
# report.set_title("WEBPAGE DOWNLOAD TEST") num_stations = num_stations * 2
# report.set_date(date) report.set_title("WEBPAGE DOWNLOAD TEST")
# report.build_banner() report.set_date(date)
# report.set_table_title("Test Setup Information") report.build_banner()
# report.build_table_title() report.set_table_title("Test Setup Information")
# report.build_table_title()
# report.test_setup_table(value="Device under test", test_setup_data=test_setup_info)
# report.test_setup_table(value="Device under test", test_setup_data=test_setup_info)
# report.set_obj_html("Objective", "The Webpage Download Test is designed to test the performance of the
# Access Point.The goal is to check whether the webpage loading time of all the " + str( num_stations) + " report.set_obj_html("Objective", "The Webpage Download Test is designed to test the performance of the "
# clients which are downloading at the same time meets the expectation when clients connected on single radio "Access Point.The goal is to check whether the webpage loading time of all the "
# as well as dual radio") report.build_objective() report.set_obj_html("Download Time Graph", "The below + str(num_stations) +
# graph provides information about the download time taken by each client to download webpage for test "clients which are downloading at the same time meets the expectation when clients"
# duration of " + str( duration) + " min") report.build_objective() graph = self.generate_graph( "connected on single radio as well as dual radio")
# dataset=dataset, lis=lis, bands=bands) report.set_graph_image(graph) report.set_csv_filename(graph) report.build_objective()
# report.move_csv_file() report.move_graph_image() report.build_graph() report.set_obj_html("Download Rate report.set_obj_html("Download Time Graph", "The below graph provides information about the download time taken "
# Graph", "The below graph provides information about the download rate in Mbps of each client to download "by each client to download webpage for test duration of " + str(duration) + " min")
# the webpage for test duration of " + str( duration) + " min") report.build_objective() graph2 = report.build_objective()
# self.graph_2(dataset2, lis=lis, bands=bands) print("graph name {}".format(graph2)) report.set_graph_image(
# graph2) report.set_csv_filename(graph2) report.move_csv_file() report.move_graph_image() graph = self.generate_graph(dataset=dataset, lis=lis, bands=bands)
# report.build_graph() report.set_obj_html("Summary Table Description", "This Table shows you the summary report.set_graph_image(graph)
# result of Webpage Download Test as PASS or FAIL criteria. If the average time taken by " + str( report.set_csv_filename(graph)
# num_stations) + " clients to access the webpage is less than " + str( threshold_2g) + "s it's a PASS report.move_csv_file()
# criteria for 2.4 ghz clients, If the average time taken by " + "" + str( num_stations) + " clients to report.move_graph_image()
# access the webpage is less than " + str( threshold_5g) + "s it's a PASS criteria for 5 ghz clients and If report.build_graph()
# the average time taken by " + str( num_stations) + " clients to access the webpage is less than " + str( report.set_obj_html("Download Rate Graph", "The below graph provides information about the download rate in "
# threshold_both) + "s it's a PASS criteria for 2.4 ghz and 5ghz clients") "Mbps of each client to download the webpage for test duration of " + str(duration) + " min")
# report.build_objective()
# report.build_objective() graph2 = self.graph_2(dataset2, lis=lis, bands=bands)
# test_setup1 = pd.DataFrame(summary_table_value) print("graph name {}".format(graph2))
# report.set_table_dataframe(test_setup1) report.set_graph_image(graph2)
# report.build_table() report.set_csv_filename(graph2)
# report.move_csv_file()
# report.set_obj_html("Download Time Table Description", "This Table will provide you information of the report.move_graph_image()
# minimum, maximum and the average time taken by clients to download a webpage in seconds") report.build_graph()
# report.set_obj_html("Summary Table Description", "This Table shows you the summary "
# report.build_objective() "result of Webpage Download Test as PASS or FAIL criteria. If the average time taken by " +
str(num_stations) + " clients to access the webpage is less than " + str( threshold_2g) +
"s it's a PASS criteria for 2.4 ghz clients, If the average time taken by " + "" +
str( num_stations) + " clients to access the webpage is less than " + str( threshold_5g) +
"s it's a PASS criteria for 5 ghz clients and If the average time taken by " + str( num_stations) +
" clients to access the webpage is less than " + str(threshold_both) +
"s it's a PASS criteria for 2.4 ghz and 5ghz clients")
report.build_objective()
test_setup1 = pd.DataFrame(summary_table_value)
report.set_table_dataframe(test_setup1)
report.build_table()
report.set_obj_html("Download Time Table Description", "This Table will provide you information of the "
"minimum, maximum and the average time taken by clients to download a webpage in seconds")
report.build_objective()
x = [] x = []
for fcc in list(result_data.keys()): for fcc in list(result_data.keys()):
fcc_type = result_data[fcc]["min"] fcc_type = result_data[fcc]["min"]
@@ -612,8 +639,6 @@ class HttpDownload(Realm):
csv_outfile = report.file_add_path(csv_outfile) csv_outfile = report.file_add_path(csv_outfile)
print("csv output file : {}".format(csv_outfile)) print("csv output file : {}".format(csv_outfile))
exit()
test_setup = pd.DataFrame(download_table_value) test_setup = pd.DataFrame(download_table_value)
report.set_table_dataframe(test_setup) report.set_table_dataframe(test_setup)
report.build_table() report.build_table()
@@ -638,9 +663,12 @@ def main():
parser.add_argument('--num_stations', type=int, help='number of stations to create', default=1) parser.add_argument('--num_stations', type=int, help='number of stations to create', default=1)
parser.add_argument('--twog_radio', help='specify radio for 2.4G clients', default='wiphy3') parser.add_argument('--twog_radio', help='specify radio for 2.4G clients', default='wiphy3')
parser.add_argument('--fiveg_radio', help='specify radio for 5 GHz client', default='wiphy0') parser.add_argument('--fiveg_radio', help='specify radio for 5 GHz client', default='wiphy0')
parser.add_argument('--security', help='WiFi Security protocol: {open|wep|wpa2|wpa3') parser.add_argument('--twog_security', help='WiFi Security protocol: {open|wep|wpa2|wpa3} for 2.4G clients')
parser.add_argument('--ssid', help='WiFi SSID for script object to associate to') parser.add_argument('--twog_ssid', help='WiFi SSID for script object to associate for 2.4G clients')
parser.add_argument('--passwd', help='WiFi passphrase/password/key') parser.add_argument('--twog_passwd', help='WiFi passphrase/password/key for 2.4G clients')
parser.add_argument('--fiveg_security', help='WiFi Security protocol: {open|wep|wpa2|wpa3} for 5G clients')
parser.add_argument('--fiveg_ssid', help='WiFi SSID for script object to associate for 5G clients')
parser.add_argument('--fiveg_passwd', help='WiFi passphrase/password/key for 5G clients')
parser.add_argument('--target_per_ten', help='number of request per 10 minutes', default=100) parser.add_argument('--target_per_ten', help='number of request per 10 minutes', default=100)
parser.add_argument('--file_size', type=str, help='specify the size of file you want to download', default='5MB') parser.add_argument('--file_size', type=str, help='specify the size of file you want to download', default='5MB')
parser.add_argument('--bands', nargs="+", help='specify which band testing you want to run eg 5G OR 2.4G OR Both', parser.add_argument('--bands', nargs="+", help='specify which band testing you want to run eg 5G OR 2.4G OR Both',
@@ -699,10 +727,22 @@ def main():
avg_both = [] avg_both = []
for bands in args.bands: for bands in args.bands:
if bands == "2.4G":
security = [args.twog_security]
ssid = [args.twog_ssid]
passwd = [args.twog_passwd]
elif bands == "5G":
security = [args.fiveg_security]
ssid = [args.fiveg_ssid]
passwd = [args.fiveg_passwd]
elif bands == "Both":
security = [args.fiveg_security, args.twog_security]
ssid = [args.fiveg_ssid, args.twog_ssid]
passwd = [args.fiveg_passwd, args.twog_passwd]
http = HttpDownload(lfclient_host=args.mgr, lfclient_port=args.mgr_port, http = HttpDownload(lfclient_host=args.mgr, lfclient_port=args.mgr_port,
upstream=args.upstream_port, num_sta=args.num_stations, upstream=args.upstream_port, num_sta=args.num_stations,
security=args.security, security=security,
ssid=args.ssid, password=args.passwd, ssid=ssid, password=passwd,
target_per_ten=args.target_per_ten, target_per_ten=args.target_per_ten,
file_size=args.file_size, bands=bands, file_size=args.file_size, bands=bands,
twog_radio=args.twog_radio, twog_radio=args.twog_radio,
@@ -786,7 +826,7 @@ def main():
date = str(datetime.now()).split(",")[0].replace(" ", "-").split(".")[0] date = str(datetime.now()).split(",")[0].replace(" ", "-").split(".")[0]
test_setup_info = { test_setup_info = {
"DUT Name": args.ap_name, "DUT Name": args.ap_name,
"SSID": args.ssid, "SSID": ','.join(ssid),
"Test Duration": test_duration, "Test Duration": test_duration,
} }
test_input_infor = { test_input_infor = {
@@ -795,21 +835,25 @@ def main():
"Bands": args.bands, "Bands": args.bands,
"Upstream": args.upstream_port, "Upstream": args.upstream_port,
"Stations": args.num_stations, "Stations": args.num_stations,
"SSID": args.ssid, "SSID": ','.join(ssid),
"Security": args.security, "Security": ','.join(security),
"Duration": args.duration, "Duration": args.duration,
"Contact": "support@candelatech.com" "Contact": "support@candelatech.com"
} }
http1 = HttpDownload(lfclient_host=args.mgr, lfclient_port=args.mgr_port, http1 = HttpDownload(lfclient_host=args.mgr, lfclient_port=args.mgr_port,
upstream=args.upstream_port, num_sta=args.num_stations, upstream=args.upstream_port, num_sta=args.num_stations,
security=args.security, security=security,
ssid=args.ssid, password=args.passwd, ssid=ssid, password=passwd,
target_per_ten=args.target_per_ten, target_per_ten=args.target_per_ten,
file_size=args.file_size, bands=args.bands, file_size=args.file_size, bands=args.bands,
twog_radio=args.twog_radio, twog_radio=args.twog_radio,
fiveg_radio=args.fiveg_radio) fiveg_radio=args.fiveg_radio)
dataset = http1.download_time_in_sec(result_data=result_data) dataset = http1.download_time_in_sec(result_data=result_data)
lis = [] lis = []
if bands == "Both":
for i in range(1, args.num_stations*2 + 1):
lis.append(i)
else:
for i in range(1, args.num_stations + 1): for i in range(1, args.num_stations + 1):
lis.append(i) lis.append(i)

View File

@@ -345,6 +345,7 @@ else
--disable_flag ht160_enable \ --disable_flag ht160_enable \
--debug" --debug"
#recordinflux.py #recordinflux.py
"./run_cv_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test 'WiFi Capacity' --test_profile 'test-20' --cv_scenario ct-us-001"
"./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test Dataplane --test_profile http --cv_scenario ct-us-001" "./rvr_scenario.py --lfmgr $MGR --lanforge_db 'handsets' --cv_test Dataplane --test_profile http --cv_scenario ct-us-001"
#scenario.py #scenario.py
#./sta_connect_bssid_mac.py #./sta_connect_bssid_mac.py
@@ -365,7 +366,7 @@ else
# --b_max 0 # --b_max 0
# --debug" # --debug"
#test_client_admission.py #test_client_admission.py
"./test_fileio.py --macvlan_parent $UPSTREAM --num_ports 3 --use_macvlans --first_mvlan_ip 192.168.92.13 --netmask 255.255.255.0 --gateway 192.168.92.1 --test_duration 30s --mgr $MGR" # Better tested on Kelly, where VRF is turned off "./test_fileio.py --macvlan_parent $UPSTREAM --num_ports 3 --use_macvlans --first_mvlan_ip 10.40.92.13 --netmask 255.255.255.0 --gateway 192.168.92.1 --test_duration 30s --mgr $MGR" # Better tested on Kelly, where VRF is turned off
"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug --mgr $MGR" "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type lfping --dest $TEST_HTTP_IP --debug --mgr $MGR"
"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security $SECURITY --debug --mgr $MGR" "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type speedtest --speedtest_min_up 20 --speedtest_min_dl 20 --speedtest_max_ping 150 --security $SECURITY --debug --mgr $MGR"
"./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type iperf3 --debug --mgr $MGR" "./test_generic.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --num_stations $NUM_STA --type iperf3 --debug --mgr $MGR"

View File

@@ -64,10 +64,8 @@ class StaConnect(Realm):
self.cleanup_on_exit = _cleanup_on_exit self.cleanup_on_exit = _cleanup_on_exit
self.sta_url_map = None # defer construction self.sta_url_map = None # defer construction
self.upstream_url = None # defer construction self.upstream_url = None # defer construction
self.station_names = [] self.station_names = _sta_name
self.cx_names = {} self.cx_names = {}
if _sta_name is not None:
self.station_names = [_sta_name]
self.resulting_stations = {} self.resulting_stations = {}
self.resulting_endpoints = {} self.resulting_endpoints = {}
@@ -83,16 +81,16 @@ class StaConnect(Realm):
self.desired_add_sta_flags_mask = ["wpa2_enable", "80211u_enable", "create_admin_down"] self.desired_add_sta_flags_mask = ["wpa2_enable", "80211u_enable", "create_admin_down"]
def get_station_url(self, sta_name_=None): def get_station_url(self, sta_name_=None):
if sta_name_ is None: if not sta_name_:
raise ValueError("get_station_url wants a station name") raise ValueError("get_station_url wants a station name")
if self.sta_url_map is None: if not self.sta_url_map:
self.sta_url_map = {} self.sta_url_map = {}
for sta_name in self.station_names: for sta_name in self.station_names:
self.sta_url_map[sta_name] = "port/1/%s/%s" % (self.resource, sta_name) self.sta_url_map[sta_name] = "port/1/%s/%s" % (self.resource, sta_name)
return self.sta_url_map[sta_name_] return self.sta_url_map[sta_name_]
def get_upstream_url(self): def get_upstream_url(self):
if self.upstream_url is None: if not self.upstream_url:
self.upstream_url = "port/1/%s/%s" % (self.upstream_resource, self.upstream_port) self.upstream_url = "port/1/%s/%s" % (self.upstream_resource, self.upstream_port)
return self.upstream_url return self.upstream_url
@@ -111,7 +109,7 @@ class StaConnect(Realm):
def num_associated(self, bssid): def num_associated(self, bssid):
counter = 0 counter = 0
# print("there are %d results" % len(self.station_results)) # print("there are %d results" % len(self.station_results))
if (self.station_results is None) or (len(self.station_results) < 1): if not self.station_results or (len(self.station_results) < 1):
self.get_failed_result_list() self.get_failed_result_list()
for eid, record in self.station_results.items(): for eid, record in self.station_results.items():
# print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ")
@@ -147,17 +145,16 @@ class StaConnect(Realm):
@staticmethod @staticmethod
def add_named_flags(desired_list, command_ref): def add_named_flags(desired_list, command_ref):
if desired_list is None: if not desired_list:
raise ValueError("addNamedFlags wants a list of desired flag names") raise ValueError("addNamedFlags wants a list of desired flag names")
if len(desired_list) < 1: if len(desired_list) < 1:
print("addNamedFlags: empty desired list") raise ValueError("addNamedFlags: empty desired list")
return 0 if not command_ref or (len(command_ref) < 1):
if (command_ref is None) or (len(command_ref) < 1):
raise ValueError("addNamedFlags wants a maps of flag values") raise ValueError("addNamedFlags wants a maps of flag values")
result = 0 result = 0
for name in desired_list: for name in desired_list:
if (name is None) or (name == ""): if not name:
continue continue
if name not in command_ref: if name not in command_ref:
raise ValueError("flag %s not in map" % name) raise ValueError("flag %s not in map" % name)
@@ -169,7 +166,7 @@ class StaConnect(Realm):
self.clear_test_results() self.clear_test_results()
self.check_connect() self.check_connect()
eth1IP = self.json_get(self.get_upstream_url()) eth1IP = self.json_get(self.get_upstream_url())
if eth1IP is None: if not eth1IP:
self._fail("Unable to query %s, bye" % self.upstream_port, True) self._fail("Unable to query %s, bye" % self.upstream_port, True)
return False return False
if eth1IP['interface']['ip'] == "0.0.0.0": if eth1IP['interface']['ip'] == "0.0.0.0":
@@ -177,13 +174,8 @@ class StaConnect(Realm):
return False return False
for sta_name in self.station_names: for sta_name in self.station_names:
sta_url = self.get_station_url(sta_name) if self.port_exists(sta_name, debug=False):
response = self.json_get(sta_url) self.rm_port(sta_name, debug_=False)
if response is not None:
if response["interface"] is not None:
print("removing old station")
if self.port_exists(sta_name):
self.rm_port(sta_name)
self.wait_until_ports_disappear(self.station_names) self.wait_until_ports_disappear(self.station_names)
# Create stations and turn dhcp on # Create stations and turn dhcp on
@@ -246,7 +238,7 @@ class StaConnect(Realm):
station_info = self.json_get(sta_url + "?fields=port,ip,ap") station_info = self.json_get(sta_url + "?fields=port,ip,ap")
# LFUtils.debug_printer.pprint(station_info) # LFUtils.debug_printer.pprint(station_info)
if (station_info is not None) and ("interface" in station_info): if station_info and "interface" in station_info:
if "ip" in station_info["interface"]: if "ip" in station_info["interface"]:
ip = station_info["interface"]["ip"] ip = station_info["interface"]["ip"]
if "ap" in station_info["interface"]: if "ap" in station_info["interface"]:
@@ -491,8 +483,6 @@ class StaConnect(Realm):
def main(): def main():
lfjson_host = "localhost"
lfjson_port = 8080
parser = Realm.create_basic_argparse( parser = Realm.create_basic_argparse(
prog="sta_connect.py", prog="sta_connect.py",
formatter_class=argparse.RawTextHelpFormatter, formatter_class=argparse.RawTextHelpFormatter,
@@ -500,39 +490,22 @@ def main():
Example: Example:
./sta_connect.py --mgr 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C ./sta_connect.py --mgr 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C
""") """)
parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)", default=8080)
parser.add_argument("--resource", type=str, help="LANforge Station resource ID to use, default is 1") parser.add_argument("--resource", type=str, help="LANforge Station resource ID to use, default is 1", default=1)
parser.add_argument("--upstream_resource", type=str, help="LANforge Ethernet port resource ID to use, default is 1") parser.add_argument("--upstream_resource", type=str, help="LANforge Ethernet port resource ID to use, default is 1", default=1)
parser.add_argument("--sta_mode", type=str, parser.add_argument("--sta_mode", type=str,
help="LANforge station-mode setting (see add_sta LANforge CLI documentation, default is 0 (auto))") help="LANforge station-mode setting (see add_sta LANforge CLI documentation, default is 0 (auto))", default=0)
parser.add_argument("--dut_bssid", type=str, help="DUT BSSID to which we expect to connect.") parser.add_argument("--dut_bssid", type=str, help="DUT BSSID to which we expect to connect.", default="MyAP")
parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m") parser.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m")
args = parser.parse_args() args = parser.parse_args()
monitor_interval = Realm.parse_time(args.test_duration).total_seconds() monitor_interval = Realm.parse_time(args.test_duration).total_seconds()
if args.mgr is not None:
lfjson_host = args.mgr
if args.port is not None:
lfjson_port = args.port
staConnect = StaConnect(lfjson_host, lfjson_port, _upstream_port=args.upstream_port, _runtime_sec=monitor_interval) staConnect = StaConnect(args.mgr, args.port, _upstream_port=args.upstream_port, _runtime_sec=monitor_interval,
staConnect.station_names = ["sta0000"] _sta_mode=args.sta_mode, _upstream_resource=args.upstream_resource,
if args.sta_mode is not None: _radio=args.radio, _resource=args.resource, _passwd=args.passwd, _dut_passwd=args.passwd,
staConnect.sta_mode = args.sta_mode _dut_bssid=args.dut_bssid, _dut_ssid=args.ssid, _dut_security=args.security,
if args.upstream_resource is not None: _sta_name=["sta0000"])
staConnect.upstream_resource = args.upstream_resource
if args.radio is not None:
staConnect.radio = args.radio
if args.resource is not None:
staConnect.resource = args.resource
if args.passwd is not None:
staConnect.dut_passwd = args.passwd
if args.dut_bssid is not None:
staConnect.dut_bssid = args.dut_bssid
if args.ssid is not None:
staConnect.dut_ssid = args.ssid
if args.security is not None:
staConnect.dut_security = args.security
staConnect.run() staConnect.run()

View File

@@ -66,7 +66,7 @@ class StaConnect2(Realm):
self.sta_url_map = None # defer construction self.sta_url_map = None # defer construction
self.upstream_url = None # defer construction self.upstream_url = None # defer construction
self.station_names = [] self.station_names = []
if _sta_name is not None: if _sta_name:
self.station_names = [_sta_name] self.station_names = [_sta_name]
self.sta_prefix = _sta_prefix self.sta_prefix = _sta_prefix
self.bringup_time_sec = _bringup_time_sec self.bringup_time_sec = _bringup_time_sec
@@ -162,7 +162,7 @@ class StaConnect2(Realm):
for sta_name in self.station_names: for sta_name in self.station_names:
sta_url = self.get_station_url(sta_name) sta_url = self.get_station_url(sta_name)
response = self.json_get(sta_url) response = self.json_get(sta_url)
if (response is not None) and (response["interface"] is not None): if (response) and (response["interface"]):
for station in self.station_names: for station in self.station_names:
LFUtils.removePort(self.resource, station, self.lfclient_url) LFUtils.removePort(self.resource, station, self.lfclient_url)
LFUtils.wait_until_ports_disappear(self.lfclient_url, self.station_names) LFUtils.wait_until_ports_disappear(self.lfclient_url, self.station_names)
@@ -257,7 +257,7 @@ class StaConnect2(Realm):
station_info = self.json_get(sta_url + "?fields=port,ip,ap") station_info = self.json_get(sta_url + "?fields=port,ip,ap")
# LFUtils.debug_printer.pprint(station_info) # LFUtils.debug_printer.pprint(station_info)
if (station_info is not None) and ("interface" in station_info): if (station_info) and ("interface" in station_info):
if "ip" in station_info["interface"]: if "ip" in station_info["interface"]:
ip = station_info["interface"]["ip"] ip = station_info["interface"]["ip"]
if "ap" in station_info["interface"]: if "ap" in station_info["interface"]:
@@ -415,16 +415,16 @@ def main():
Example: Example:
./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C ./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C
""") """)
parser.add_argument("-d", "--dest", type=str, help="address of the LANforge GUI machine (localhost is default)") parser.add_argument("-d", "--dest", type=str, help="address of the LANforge GUI machine (localhost is default)", default='localhost')
parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)") parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)", default=8080)
parser.add_argument("-u", "--user", type=str, help="TBD: credential login/username") parser.add_argument("-u", "--user", type=str, help="TBD: credential login/username")
parser.add_argument("-p", "--passwd", type=str, help="TBD: credential password") parser.add_argument("-p", "--passwd", type=str, help="TBD: credential password")
parser.add_argument("--resource", type=str, help="LANforge Station resource ID to use, default is 1") parser.add_argument("--resource", type=str, help="LANforge Station resource ID to use, default is 1", default=1)
parser.add_argument("--upstream_resource", type=str, help="LANforge Ethernet port resource ID to use, default is 1") parser.add_argument("--upstream_resource", type=str, help="LANforge Ethernet port resource ID to use, default is 1", default=None)
parser.add_argument("--upstream_port", type=str, help="LANforge Ethernet port name, default is eth2") parser.add_argument("--upstream_port", type=str, help="LANforge Ethernet port name, default is eth2", default='1.1.eth2')
parser.add_argument("--radio", type=str, help="LANforge radio to use, default is wiphy0") parser.add_argument("--radio", type=str, help="LANforge radio to use, default is wiphy0", default='wiphy0')
parser.add_argument("--sta_mode", type=str, parser.add_argument("--sta_mode", type=str,
help="LANforge station-mode setting (see add_sta LANforge CLI documentation, default is 0 (auto))") help="LANforge station-mode setting (see add_sta LANforge CLI documentation, default is 0 (auto))", default=0)
parser.add_argument("--dut_ssid", type=str, help="DUT SSID") parser.add_argument("--dut_ssid", type=str, help="DUT SSID")
parser.add_argument("--dut_security", type=str, help="DUT security: openLF, wpa, wpa2, wpa3") parser.add_argument("--dut_security", type=str, help="DUT security: openLF, wpa, wpa2, wpa3")
parser.add_argument("--dut_passwd", type=str, help="DUT PSK password. Do not set for OPEN auth") parser.add_argument("--dut_passwd", type=str, help="DUT PSK password. Do not set for OPEN auth")
@@ -442,12 +442,18 @@ Example:
parser.add_argument('--monitor_interval', help='How frequently you want to append to your database', default='5s') parser.add_argument('--monitor_interval', help='How frequently you want to append to your database', default='5s')
args = parser.parse_args() args = parser.parse_args()
if args.dest is not None: upstream_port = LFUtils.name_to_eid(args.upstream_port)
lfjson_host = args.dest if args.upstream_resource:
if args.port is not None: upstream_resource = args.upstream_resource
lfjson_port = args.port else:
upstream_resource = upstream_port[1]
staConnect = StaConnect2(lfjson_host, lfjson_port, staConnect = StaConnect2(args.dest, args.port,
_resource=args.resource,
_upstream_resource=upstream_resource,
_upstream_port=upstream_port[2],
_radio=args.radio,
_sta_mode=args.sta_mode,
debug_=True, debug_=True,
_influx_db=args.influx_db, _influx_db=args.influx_db,
_influx_passwd=args.influx_passwd, _influx_passwd=args.influx_passwd,
@@ -456,29 +462,19 @@ Example:
_exit_on_fail=True, _exit_on_fail=True,
_exit_on_error=False) _exit_on_error=False)
if args.user is not None: if args.user:
staConnect.user = args.user staConnect.user = args.user
if args.passwd is not None: if args.passwd:
staConnect.passwd = args.passwd staConnect.passwd = args.passwd
if args.sta_mode is not None: if args.dut_ssid:
staConnect.sta_mode = args.sta_mode
if args.upstream_resource is not None:
staConnect.upstream_resource = args.upstream_resource
if args.upstream_port is not None:
staConnect.upstream_port = args.upstream_port
if args.radio is not None:
staConnect.radio = args.radio
if args.resource is not None:
staConnect.resource = args.resource
if args.dut_ssid is not None:
staConnect.dut_ssid = args.dut_ssid staConnect.dut_ssid = args.dut_ssid
if args.dut_passwd is not None: if args.dut_passwd:
staConnect.dut_passwd = args.dut_passwd staConnect.dut_passwd = args.dut_passwd
if args.dut_bssid is not None: if args.dut_bssid:
staConnect.dut_bssid = args.dut_bssid staConnect.dut_bssid = args.dut_bssid
if args.dut_security is not None: if args.dut_security:
staConnect.dut_security = args.dut_security staConnect.dut_security = args.dut_security
if (args.prefix is not None) or (args.prefix != "sta"): if args.prefix or (args.prefix != "sta"):
staConnect.sta_prefix = args.prefix staConnect.sta_prefix = args.prefix
staConnect.station_names = ["%s0000" % args.prefix] staConnect.station_names = ["%s0000" % args.prefix]
staConnect.bringup_time_sec = args.bringup_time staConnect.bringup_time_sec = args.bringup_time

View File

@@ -126,8 +126,7 @@ class StaScan(Realm):
print("%s\t%s\t%s" % (info['bss'], info['signal'], info['ssid'])) print("%s\t%s\t%s" % (info['bss'], info['signal'], info['ssid']))
def pre_cleanup(self): def pre_cleanup(self):
for sta in self.sta_list: self.station_profile.cleanup(self.sta_list)
self.rm_port(sta, check_exists=True)
def cleanup(self): def cleanup(self):
self.station_profile.cleanup() self.station_profile.cleanup()

View File

@@ -39,8 +39,6 @@ if sys.version_info[0] != 3:
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base")
LFCliBase = lfcli_base.LFCliBase
LFUtils = importlib.import_module("py-json.LANforge.LFUtils") LFUtils = importlib.import_module("py-json.LANforge.LFUtils")
add_file_endp = importlib.import_module("py-json.LANforge.add_file_endp") add_file_endp = importlib.import_module("py-json.LANforge.add_file_endp")
fe_fstype = add_file_endp.fe_fstype fe_fstype = add_file_endp.fe_fstype
@@ -48,7 +46,7 @@ realm = importlib.import_module("py-json.realm")
Realm = realm.Realm Realm = realm.Realm
class FileIOTest(LFCliBase): class FileIOTest(Realm):
def __init__(self, host, port, ssid, security, password, def __init__(self, host, port, ssid, security, password,
number_template="00000", number_template="00000",
radio="wiphy0", radio="wiphy0",
@@ -70,6 +68,8 @@ class FileIOTest(LFCliBase):
first_mvlan_ip=None, first_mvlan_ip=None,
netmask=None, netmask=None,
gateway=None, gateway=None,
shelf=1,
resource=1,
dhcp=True, dhcp=True,
use_macvlans=False, use_macvlans=False,
use_test_groups=False, use_test_groups=False,
@@ -83,7 +83,7 @@ class FileIOTest(LFCliBase):
_debug_on=False, _debug_on=False,
_exit_on_error=False, _exit_on_error=False,
_exit_on_fail=False): _exit_on_fail=False):
super().__init__(host, port, _debug=_debug_on, _exit_on_fail=_exit_on_fail) super().__init__(host, port, debug_=_debug_on, _exit_on_fail=_exit_on_fail)
if port_list is None: if port_list is None:
port_list = [] port_list = []
if update_group_args is None: if update_group_args is None:
@@ -105,7 +105,7 @@ class FileIOTest(LFCliBase):
self.netmask = netmask self.netmask = netmask
self.gateway = gateway self.gateway = gateway
if self.use_macvlans: if self.use_macvlans:
if macvlan_parent is not None: if macvlan_parent:
self.macvlan_parent = macvlan_parent self.macvlan_parent = macvlan_parent
self.port_list = port_list self.port_list = port_list
else: else:
@@ -114,38 +114,28 @@ class FileIOTest(LFCliBase):
self.use_test_groups = use_test_groups self.use_test_groups = use_test_groups
if self.use_test_groups: if self.use_test_groups:
if self.mode == "write": if self.mode == "write":
if write_only_test_group is not None: if write_only_test_group:
self.write_only_test_group = write_only_test_group self.write_only_test_group = write_only_test_group
else: else:
raise ValueError("--write_only_test_group must be used to set test group name") raise ValueError("--write_only_test_group must be used to set test group name")
if self.mode == "read": if self.mode == "read":
if read_only_test_group is not None: if read_only_test_group:
self.read_only_test_group = read_only_test_group self.read_only_test_group = read_only_test_group
else: else:
raise ValueError("--read_only_test_group must be used to set test group name") raise ValueError("--read_only_test_group must be used to set test group name")
if self.mode == "both": if self.mode == "both":
if write_only_test_group is not None and read_only_test_group is not None: if write_only_test_group and read_only_test_group:
self.write_only_test_group = write_only_test_group self.write_only_test_group = write_only_test_group
self.read_only_test_group = read_only_test_group self.read_only_test_group = read_only_test_group
else: else:
raise ValueError("--write_only_test_group and --read_only_test_group " raise ValueError("--write_only_test_group and --read_only_test_group "
"must be used to set test group names") "must be used to set test group names")
# self.min_rw_size = self.parse_size(min_rw_size) self.wo_profile = self.new_fio_endp_profile()
# self.max_rw_size = self.parse_size(max_rw_size) self.mvlan_profile = self.new_mvlan_profile()
# self.min_file_size = self.parse_size(min_file_size)
# self.min_file_size = self.parse_size(min_file_size)
# self.min_read_rate_bps = self.parse_size_bps(min_read_rate_bps)
# self.max_read_rate_bps = self.sisize_bps(max_read_rate_bps)
# self.min_write_rate_bps = self.parse_size_bps(min_write_rate_bps)
# self.max_write_rate_bps = self.parse_size_bps(max_write_rate_bps)
self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port)
self.wo_profile = self.local_realm.new_fio_endp_profile()
self.mvlan_profile = self.local_realm.new_mvlan_profile()
if not self.use_macvlans and len(self.port_list) > 0: if not self.use_macvlans and len(self.port_list) > 0:
self.station_profile = self.local_realm.new_station_profile() self.station_profile = self.new_station_profile()
self.station_profile.lfclient_url = self.lfclient_url self.station_profile.lfclient_url = self.lfclient_url
self.station_profile.ssid = self.ssid self.station_profile.ssid = self.ssid
self.station_profile.ssid_pass = self.password self.station_profile.ssid_pass = self.password
@@ -176,19 +166,21 @@ class FileIOTest(LFCliBase):
self.mvlan_profile.netmask = netmask self.mvlan_profile.netmask = netmask
self.mvlan_profile.first_ip_addr = first_mvlan_ip self.mvlan_profile.first_ip_addr = first_mvlan_ip
self.mvlan_profile.gateway = gateway self.mvlan_profile.gateway = gateway
self.mvlan_profile.shelf = shelf
self.mvlan_profile.resource = resource
self.created_ports = [] self.created_ports = []
if self.use_test_groups: if self.use_test_groups:
if self.mode is not None: if self.mode:
if self.mode == "write": if self.mode == "write":
self.wo_tg_profile = self.local_realm.new_test_group_profile() self.wo_tg_profile = self.new_test_group_profile()
self.wo_tg_profile.group_name = self.write_only_test_group self.wo_tg_profile.group_name = self.write_only_test_group
elif self.mode == "read": elif self.mode == "read":
self.ro_tg_profile = self.local_realm.new_test_group_profile() self.ro_tg_profile = self.new_test_group_profile()
self.ro_tg_profile.group_name = self.read_only_test_group self.ro_tg_profile.group_name = self.read_only_test_group
elif self.mode == "both": elif self.mode == "both":
self.wo_tg_profile = self.local_realm.new_test_group_profile() self.wo_tg_profile = self.new_test_group_profile()
self.ro_tg_profile = self.local_realm.new_test_group_profile() self.ro_tg_profile = self.new_test_group_profile()
self.wo_tg_profile.group_name = self.write_only_test_group self.wo_tg_profile.group_name = self.write_only_test_group
self.ro_tg_profile.group_name = self.read_only_test_group self.ro_tg_profile.group_name = self.read_only_test_group
else: else:
@@ -196,8 +188,8 @@ class FileIOTest(LFCliBase):
else: else:
raise ValueError("Mode ( read, write, or both ) must be specified") raise ValueError("Mode ( read, write, or both ) must be specified")
if update_group_args is not None and update_group_args['name'] is not None: if update_group_args and update_group_args['name']:
temp_tg = self.local_realm.new_test_group_profile() temp_tg = self.new_test_group_profile()
temp_cxs = update_group_args['cxs'].split(',') temp_cxs = update_group_args['cxs'].split(',')
if update_group_args['action'] == "add": if update_group_args['action'] == "add":
temp_tg.group_name = update_group_args['name'] temp_tg.group_name = update_group_args['name']
@@ -243,23 +235,13 @@ class FileIOTest(LFCliBase):
def __compare_vals(self, val_list): def __compare_vals(self, val_list):
passes = 0 passes = 0
expected_passes = 0 expected_passes = 0
# print(val_list)
for item in val_list: for item in val_list:
expected_passes += 1 expected_passes += 1
# print(item)
if item[0] == 'r': if item[0] == 'r':
# print("TEST", item,
# val_list[item]['read-bps'],
# self.ro_profile.min_read_rate_bps,
# val_list[item]['read-bps'] > self.ro_profile.min_read_rate_bps)
if val_list[item]['read-bps'] > self.wo_profile.min_read_rate_bps: if val_list[item]['read-bps'] > self.wo_profile.min_read_rate_bps:
passes += 1 passes += 1
else: else:
# print("TEST", item,
# val_list[item]['write-bps'],
# self.wo_profile.min_write_rate_bps,
# val_list[item]['write-bps'] > self.wo_profile.min_write_rate_bps)
if val_list[item]['write-bps'] > self.wo_profile.min_write_rate_bps: if val_list[item]['write-bps'] > self.wo_profile.min_write_rate_bps:
passes += 1 passes += 1
@@ -282,24 +264,18 @@ class FileIOTest(LFCliBase):
cx_list = self.json_get("fileio/%s,%s?fields=write-bps,read-bps" % ( cx_list = self.json_get("fileio/%s,%s?fields=write-bps,read-bps" % (
','.join(self.wo_profile.created_cx.keys()), ','.join(self.wo_profile.created_cx.keys()),
','.join(self.ro_profile.created_cx.keys())), debug_=self.debug) ','.join(self.ro_profile.created_cx.keys())), debug_=self.debug)
# print(cx_list)
# print("==============\n", cx_list, "\n==============")
cx_map = {} cx_map = {}
# pprint.pprint(cx_list) if cx_list:
if cx_list is not None:
cx_list = cx_list['endpoint'] cx_list = cx_list['endpoint']
for i in cx_list: for i in cx_list:
for item, value in i.items(): for item, value in i.items():
# print(item, value) cx_map[self.name_to_eid(item)[2]] = {"read-bps": value['read-bps'],
cx_map[self.local_realm.name_to_eid(item)[2]] = {"read-bps": value['read-bps'],
"write-bps": value['write-bps']} "write-bps": value['write-bps']}
# print(cx_map)
return cx_map return cx_map
def build(self): def build(self):
# Build stations # Build stations
if self.use_macvlans: if self.use_macvlans:
print("Creating MACVLANs")
self.mvlan_profile.create(admin_down=False, sleep_time=.5, debug=self.debug) self.mvlan_profile.create(admin_down=False, sleep_time=.5, debug=self.debug)
self._pass("PASS: MACVLAN build finished") self._pass("PASS: MACVLAN build finished")
self.created_ports += self.mvlan_profile.created_macvlans self.created_ports += self.mvlan_profile.created_macvlans
@@ -315,13 +291,12 @@ class FileIOTest(LFCliBase):
self.created_ports += self.station_profile.station_names self.created_ports += self.station_profile.station_names
if len(self.ip_list) > 0: if len(self.ip_list) > 0:
# print("++++++++++++++++\n", self.ip_list, "++++++++++++++++\n")
for num_port in range(len(self.port_list)): for num_port in range(len(self.port_list)):
if self.ip_list[num_port] != 0: if self.ip_list[num_port] != 0:
if self.gateway is not None and self.netmask is not None: if self.gateway and self.netmask:
shelf = self.local_realm.name_to_eid(self.port_list[num_port])[0] shelf = self.name_to_eid(self.port_list[num_port])[0]
resource = self.local_realm.name_to_eid(self.port_list[num_port])[1] resource = self.name_to_eid(self.port_list[num_port])[1]
port = self.local_realm.name_to_eid(self.port_list[num_port])[2] port = self.name_to_eid(self.port_list[num_port])[2]
req_url = "/cli-json/set_port" req_url = "/cli-json/set_port"
data = { data = {
"shelf": shelf, "shelf": shelf,
@@ -331,7 +306,7 @@ class FileIOTest(LFCliBase):
"netmask": self.netmask, "netmask": self.netmask,
"gateway": self.gateway "gateway": self.gateway
} }
self.local_realm.json_post(req_url, data) self.json_post(req_url, data)
self.created_ports.append("%s.%s.%s" % (shelf, resource, port)) self.created_ports.append("%s.%s.%s" % (shelf, resource, port))
else: else:
raise ValueError("Netmask and gateway must be specified") raise ValueError("Netmask and gateway must be specified")
@@ -340,7 +315,7 @@ class FileIOTest(LFCliBase):
# if use test groups and test group exists and no cxs, create cxs, assign to test group # if use test groups and test group exists and no cxs, create cxs, assign to test group
# if use test groups and test group exist and cxs exist, do nothing # if use test groups and test group exist and cxs exist, do nothing
# if not use test groups, create cxs # if not use test groups, create cxs
if self.mode is not None: if self.mode:
if self.use_test_groups: if self.use_test_groups:
if self.mode == "write": if self.mode == "write":
if self.wo_tg_exists: if self.wo_tg_exists:
@@ -462,18 +437,17 @@ class FileIOTest(LFCliBase):
def start(self, print_pass=False, print_fail=False): def start(self, print_pass=False, print_fail=False):
temp_ports = self.created_ports.copy() temp_ports = self.created_ports.copy()
# temp_stas.append(self.local_realm.name_to_eid(self.upstream_port)[2])
if not self.use_macvlans: if not self.use_macvlans:
self.station_profile.admin_up() self.station_profile.admin_up()
else: else:
self.mvlan_profile.admin_up() self.mvlan_profile.admin_up()
if self.local_realm.wait_for_ip(temp_ports, debug=self.debug): if self.wait_for_ip(temp_ports, debug=self.debug):
self._pass("All ports got IPs", print_pass) self._pass("All ports got IPs", print_pass)
else: else:
self._fail("Ports failed to get IPs", print_fail) self._fail("Ports failed to get IPs", print_fail)
cur_time = datetime.datetime.now() cur_time = datetime.datetime.now()
# print("Got Values") # print("Got Values")
end_time = self.local_realm.parse_time(self.test_duration) + cur_time end_time = self.parse_time(self.test_duration) + cur_time
if self.use_test_groups: if self.use_test_groups:
if self.mode == "write": if self.mode == "write":
self.wo_tg_profile.start_group() self.wo_tg_profile.start_group()
@@ -590,7 +564,7 @@ class FileIOTest(LFCliBase):
def main(): def main():
parser = LFCliBase.create_bare_argparse( parser = Realm.create_bare_argparse(
prog='test_fileio.py', prog='test_fileio.py',
# formatter_class=argparse.RawDescriptionHelpFormatter, # formatter_class=argparse.RawDescriptionHelpFormatter,
formatter_class=argparse.RawTextHelpFormatter, formatter_class=argparse.RawTextHelpFormatter,
@@ -662,45 +636,51 @@ Generic command layout:
tg_group = parser.add_mutually_exclusive_group() tg_group = parser.add_mutually_exclusive_group()
tg_group.add_argument('--add_to_group', help='name of test group to add cxs to', default=None) tg_group.add_argument('--add_to_group', help='name of test group to add cxs to', default=None)
tg_group.add_argument('--del_from_group', help='name of test group to delete cxs from', default=None) tg_group.add_argument('--del_from_group', help='name of test group to delete cxs from', default=None)
parser.add_argument('--cxs', help='list of cxs to add/remove depending on use of --add_to_group or --del_from_group', default=None) parser.add_argument('--cxs',
help='list of cxs to add/remove depending on use of --add_to_group or --del_from_group',
default=None)
args = parser.parse_args() args = parser.parse_args()
parent = LFUtils.name_to_eid(args.macvlan_parent)
shelf = parent[0]
resource = parent[1]
macvlan_parent = parent[2]
update_group_args = { update_group_args = {
"name": None, "name": None,
"action": None, "action": None,
"cxs": None "cxs": None
} }
if args.add_to_group is not None and args.cxs is not None: if args.add_to_group and args.cxs:
update_group_args['name'] = args.add_to_group update_group_args['name'] = args.add_to_group
update_group_args['action'] = "add" update_group_args['action'] = "add"
update_group_args['cxs'] = args.cxs update_group_args['cxs'] = args.cxs
elif args.del_from_group is not None and args.cxs is not None: elif args.del_from_group and args.cxs:
update_group_args['name'] = args.del_from_group update_group_args['name'] = args.del_from_group
update_group_args['action'] = "del" update_group_args['action'] = "del"
update_group_args['cxs'] = args.cxs update_group_args['cxs'] = args.cxs
port_list = [] port_list = []
ip_list = [] ip_list = []
if args.first_port is not None and args.use_ports is not None: if args.first_port and args.use_ports:
if args.first_port.startswith("sta"): if args.first_port.startswith("sta"):
if (args.num_ports is not None) and (int(args.num_ports) > 0): if args.num_ports and (int(args.num_ports) > 0):
start_num = int(args.first_port[3:]) start_num = int(args.first_port[3:])
num_ports = int(args.num_ports) num_ports = int(args.num_ports)
port_list = LFUtils.port_name_series(prefix="sta", start_id=start_num, end_id=start_num + num_ports - 1, port_list = LFUtils.port_name_series(prefix="sta", start_id=start_num, end_id=start_num + num_ports - 1,
padding_number=10000, padding_number=10000,
radio=args.radio) radio=args.radio)
else: else:
if (args.num_ports is not None) and args.macvlan_parent is not None and (int(args.num_ports) > 0) \ if args.num_ports and macvlan_parent and (int(args.num_ports) > 0) \
and args.macvlan_parent in args.first_port: and macvlan_parent in args.first_port:
start_num = int(args.first_port[args.first_port.index('#') + 1:]) start_num = int(args.first_port[args.first_port.index('#') + 1:])
num_ports = int(args.num_ports) num_ports = int(args.num_ports)
port_list = LFUtils.port_name_series(prefix=args.macvlan_parent + "#", start_id=start_num, port_list = LFUtils.port_name_series(prefix=macvlan_parent + "#", start_id=start_num,
end_id=start_num + num_ports - 1, padding_number=100000, end_id=start_num + num_ports - 1, padding_number=100000,
radio=args.radio) radio=args.radio)
else: else:
raise ValueError("Invalid values for num_ports [%s], macvlan_parent [%s], and/or first_port [%s].\n" raise ValueError("Invalid values for num_ports [%s], macvlan_parent [%s], and/or first_port [%s].\n"
"first_port must contain parent port and num_ports must be greater than 0" "first_port must contain parent port and num_ports must be greater than 0"
% (args.num_ports, args.macvlan_parent, args.first_port)) % (args.num_ports, macvlan_parent, args.first_port))
else: else:
if args.use_ports is None: if args.use_ports is None:
num_ports = int(args.num_ports) num_ports = int(args.num_ports)
@@ -709,7 +689,7 @@ Generic command layout:
padding_number=10000, padding_number=10000,
radio=args.radio) radio=args.radio)
else: else:
port_list = LFUtils.port_name_series(prefix=args.macvlan_parent + "#", start_id=0, port_list = LFUtils.port_name_series(prefix=macvlan_parent + "#", start_id=0,
end_id=num_ports - 1, padding_number=100000, end_id=num_ports - 1, padding_number=100000,
radio=args.radio) radio=args.radio)
else: else:
@@ -724,7 +704,7 @@ Generic command layout:
if len(port_list) != len(ip_list): if len(port_list) != len(ip_list):
raise ValueError(temp_list, " ports must have matching ip addresses!") raise ValueError(temp_list, " ports must have matching ip addresses!")
if args.first_mvlan_ip is not None: if args.first_mvlan_ip:
if args.first_mvlan_ip.lower() == "dhcp": if args.first_mvlan_ip.lower() == "dhcp":
dhcp = True dhcp = True
else: else:
@@ -749,11 +729,13 @@ Generic command layout:
test_duration=args.test_duration, test_duration=args.test_duration,
upstream_port=args.upstream_port, upstream_port=args.upstream_port,
_debug_on=args.debug, _debug_on=args.debug,
macvlan_parent=args.macvlan_parent, macvlan_parent=macvlan_parent,
use_macvlans=args.use_macvlans, use_macvlans=args.use_macvlans,
first_mvlan_ip=args.first_mvlan_ip, first_mvlan_ip=args.first_mvlan_ip,
netmask=args.netmask, netmask=args.netmask,
gateway=args.gateway, gateway=args.gateway,
shelf=shelf,
resource=resource,
dhcp=dhcp, dhcp=dhcp,
fs_type=args.fs_type, fs_type=args.fs_type,
min_rw_size=args.min_rw_size, min_rw_size=args.min_rw_size,

View File

@@ -271,6 +271,8 @@ class TTLSTest(Realm):
self.collect_endp_stats(self.l3_cx_obj_udp.cx_profile.created_cx, traffic_type="UDP") self.collect_endp_stats(self.l3_cx_obj_udp.cx_profile.created_cx, traffic_type="UDP")
def cleanup(self, sta_list): def cleanup(self, sta_list):
self.l3_cx_obj_udp.cx_profile.cleanup_prefix()
self.l3_cx_obj_tcp.cx_profile.cleanup_prefix()
self.station_profile.cleanup(sta_list) self.station_profile.cleanup(sta_list)
if self.vap: if self.vap:
self.vap_profile.cleanup(1) self.vap_profile.cleanup(1)
@@ -278,9 +280,9 @@ class TTLSTest(Realm):
debug=self.debug) debug=self.debug)
def pre_cleanup(self): def pre_cleanup(self):
self.cx_profile.cleanup_prefix() self.l3_cx_obj_udp.cx_profile.cleanup_prefix()
# do not clean up station if existed prior to test # do not clean up station if existed prior to test
if not self.use_existing_sta: if not self.l3_cx_obj_udp.use_existing_sta:
for sta in self.sta_list: for sta in self.sta_list:
self.rm_port(sta, check_exists=True, debug_=False) self.rm_port(sta, check_exists=True, debug_=False)

View File

@@ -9,210 +9,11 @@
"to identify replaced strings in the lf_check.py code.", "to identify replaced strings in the lf_check.py code.",
"When doing a create_chamberview.py --create_scenario <name> ", "When doing a create_chamberview.py --create_scenario <name> ",
"has no correlation to the --instance_name , instance name is used ", "has no correlation to the --instance_name , instance name is used ",
"as a unique identifier for tha chamber-view test run" "as a unique identifier for tha chamber-view test run",
"Simpler runs after the suite_scripts"
] ]
}, },
"test_suites":{ "test_suites":{
"suite_smoke":{
"clean_up_cxs_endp_sta":{
"enabled":"TRUE",
"command":"lf_cleanup.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP --cxs --sta"
]},
"test_ip_variable_time0-ipv4":{
"enabled":"TRUE",
"command":"test_ip_variable_time.py",
"timeout":"360",
"args":"",
"args_list":[
" --mgr LF_MGR_IP ",
" use_ssid_idx=1 --radio wiphy4 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED",
" --test_duration 60s --output_format csv ",
" --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2",
" --mode '5' --layer3_cols 'name','tx rate','rx rate' ",
" --port_mgr_cols 'alias','channel','activity','mode'",
" --num_stations 1"]
},
"test_ip_variable_time1-ipv4":{
"enabled":"FALSE",
"timeout":"360",
"command":"test_ip_variable_time.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP",
" use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED",
" --test_duration 60s --output_format csv ",
" --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2",
" --mode '5' --layer3_cols 'name','tx rate','rx rate' ",
" --port_mgr_cols 'alias','channel','activity','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_verify":{
"clean_up_cxs_endp_sta":{
"enabled":"TRUE",
"command":"lf_cleanup.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP --cxs --sta"
]},
"test_ip_variable_time0-ipv4":{
"enabled":"TRUE",
"command":"test_ip_variable_time.py",
"timeout":"360",
"args":"",
"args_list":[
" --mgr LF_MGR_IP ",
" use_ssid_idx=1 --radio wiphy4 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED",
" --test_duration 60s --output_format csv ",
" --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2",
" --mode '5' --layer3_cols 'name','tx rate','rx rate' ",
" --port_mgr_cols 'alias','channel','activity','mode'",
" --num_stations 1"]
},
"test_ip_variable_time1-ipv4":{
"enabled":"FALSE",
"timeout":"360",
"command":"test_ip_variable_time.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP",
" use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED",
" --test_duration 60s --output_format csv ",
" --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2",
" --mode '5' --layer3_cols 'name','tx rate','rx rate' ",
" --port_mgr_cols 'alias','channel','activity','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":{
"clean_up_cxs_endp_sta_flags_5q_all":{
"enabled":"TRUE",
"command":"lf_cleanup.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP --cxs --sta"
]},
"test_l3_longevity_flags_5g_all":{
"enabled":"TRUE",
"load_db":"NONE",
"command":"test_l3_longevity.py",
"args":"",
"args_list":[
" --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 30s --polling_interval 5s --upstream_port UPSTREAM_PORT ",
" use_ssid_idx=1 --radio 'radio==wiphy1,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==wiphy2,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==wiphy3,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==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 'l3_longevity'",
" --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_2q_all":{
"enabled":"TRUE",
"command":"lf_cleanup.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP --cxs --sta"
]},
"test_l3_longevity_flags_2g_all":{
"enabled":"TRUE",
"load_db":"NONE",
"command":"test_l3_longevity.py",
"args":"",
"args_list":[
" --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 30s --polling_interval 5s --upstream_port UPSTREAM_PORT ",
" use_ssid_idx=1 --radio 'radio==wiphy1,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==wiphy2,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==wiphy3,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==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 'l3_longevity'",
" --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN"
]
},
"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_test":{
"lf_cleanup":{
"enabled":"FALSE",
"load_db":"NONE",
"command":"lf_cleanup.py",
"args":"",
"args_list":["--mgr LF_MGR_IP --cxs --sta"
]
},
"lf_report_test":{
"enabled":"TRUE",
"load_db":"NONE",
"timeout":"60",
"command":"lf_report_test.py",
"args":"",
"args_list":[" --mgr LF_MGR_IP "
]
},
"lf_graph":{
"enabled":"TRUE",
"load_db":"NONE",
"timeout":"60",
"command":"lf_graph.py",
"args":"",
"args_list":[" --mgr LF_MGR_IP "
]
},
"test_ip_variable_time0-ipv4":{
"enabled":"TRUE",
"command":"test_ip_variable_time.py",
"args":"",
"args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"]
},
"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_scripts":{ "suite_scripts":{
"lf_help_check":{ "lf_help_check":{
"enabled":"TRUE", "enabled":"TRUE",
@@ -498,7 +299,7 @@
] ]
}, },
"test_ip_variable_time_ipv4_5g_udp":{ "test_ip_variable_time_ipv4_5g_udp":{
"enabled":"FALSE", "enabled":"TRUE",
"command":"test_ip_variable_time.py", "command":"test_ip_variable_time.py",
"args":"", "args":"",
"args_list":[ "args_list":[
@@ -508,7 +309,7 @@
" --traffic_type lf_udp", " --traffic_type lf_udp",
" --debug"]}, " --debug"]},
"test_ip_variable_time_ipv4_5g_tcp":{ "test_ip_variable_time_ipv4_5g_tcp":{
"enabled":"FALSE", "enabled":"TRUE",
"command":"test_ip_variable_time.py", "command":"test_ip_variable_time.py",
"args":"", "args":"",
"args_list":[ "args_list":[
@@ -578,12 +379,66 @@
"args_list":[" --mgr LF_MGR_IP " "args_list":[" --mgr LF_MGR_IP "
] ]
}, },
"lf_report":{
"enabled":"TRUE",
"load_db":"NONE",
"timeout":"60",
"command":"lf_report.py",
"args":"",
"args_list":[" "
]
},
"lf_snp_test":{
"enabled":"TRUE",
"load_db":"NONE",
"timeout":"60",
"command":"lf_snp_test.py",
"args":"",
"args_list":[" --help"
]
},
"testgroup":{
"enabled":"TRUE",
"load_db":"NONE",
"timeout":"60",
"command":"testgroup.py",
"args":"",
"args_list":[" --mgr LF_MGR_IP --group_name group1 --add_group --list_groups --debug"
]
},
"testgroup2":{
"enabled":"TRUE",
"load_db":"NONE",
"timeout":"60",
"command":"testgroup2.py",
"args":"",
"args_list":[" --mgr LF_MGR_IP --group_name group0 --add_group --num_stations 1 --radio 1.1.wiphy1",
" use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED "
]
},
"clean_up_cxs_endp_sta_from_test_group":{
"enabled":"TRUE",
"command":"lf_cleanup.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP --cxs --sta"
]
},
"test_generic":{
"enabled":"TRUE",
"command":"test_generic.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP --radio 1.1.wiphy1 --upstream_port UPSTREAM_PORT --num_stations 1 --type lfping --dest LF_MGR_IP --debug",
" use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED "
]
},
"test_ipv4_ps":{ "test_ipv4_ps":{
"enabled":"FALSE", "enabled":"FALSE",
"command":"test_ipv4_ps.py", "command":"test_ipv4_ps.py",
"args":"", "args":"",
"args_list":[ "args_list":[
"--mgr LF_MGR_IP --radio 1.1.wiphy1 --upstream_port 1.1.eth2 --radio2 1.1.wiphy2", " --mgr LF_MGR_IP --radio 1.1.wiphy1 --upstream_port UPSTREAM_PORT --radio2 1.1.wiphy2",
" use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED " " use_ssid_idx=1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED "
] ]
}, },
@@ -698,6 +553,206 @@
" --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE" " --server TEST_SERVER --path REPORT_PATH --store --png --database DATABASE_SQLITE"
] ]
} }
},
"suite_smoke":{
"clean_up_cxs_endp_sta":{
"enabled":"TRUE",
"command":"lf_cleanup.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP --cxs --sta"
]},
"test_ip_variable_time0-ipv4":{
"enabled":"TRUE",
"command":"test_ip_variable_time.py",
"timeout":"360",
"args":"",
"args_list":[
" --mgr LF_MGR_IP ",
" use_ssid_idx=1 --radio wiphy4 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED",
" --test_duration 60s --output_format csv ",
" --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2",
" --mode '5' --layer3_cols 'name','tx rate','rx rate' ",
" --port_mgr_cols 'alias','channel','activity','mode'",
" --num_stations 1"]
},
"test_ip_variable_time1-ipv4":{
"enabled":"FALSE",
"timeout":"360",
"command":"test_ip_variable_time.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP",
" use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED",
" --test_duration 60s --output_format csv ",
" --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2",
" --mode '5' --layer3_cols 'name','tx rate','rx rate' ",
" --port_mgr_cols 'alias','channel','activity','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_verify":{
"clean_up_cxs_endp_sta":{
"enabled":"TRUE",
"command":"lf_cleanup.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP --cxs --sta"
]},
"test_ip_variable_time0-ipv4":{
"enabled":"TRUE",
"command":"test_ip_variable_time.py",
"timeout":"360",
"args":"",
"args_list":[
" --mgr LF_MGR_IP ",
" use_ssid_idx=1 --radio wiphy4 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED",
" --test_duration 60s --output_format csv ",
" --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2",
" --mode '5' --layer3_cols 'name','tx rate','rx rate' ",
" --port_mgr_cols 'alias','channel','activity','mode'",
" --num_stations 1"]
},
"test_ip_variable_time1-ipv4":{
"enabled":"FALSE",
"timeout":"360",
"command":"test_ip_variable_time.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP",
" use_ssid_idx=1 --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED",
" --test_duration 60s --output_format csv ",
" --traffic_type lf_tcp --a_min 600000000 --b_min 600000000 --upstream_port eth2",
" --mode '5' --layer3_cols 'name','tx rate','rx rate' ",
" --port_mgr_cols 'alias','channel','activity','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":{
"clean_up_cxs_endp_sta_flags_5q_all":{
"enabled":"TRUE",
"command":"lf_cleanup.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP --cxs --sta"
]},
"test_l3_longevity_flags_5g_all":{
"enabled":"TRUE",
"load_db":"NONE",
"command":"test_l3_longevity.py",
"args":"",
"args_list":[
" --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 30s --polling_interval 5s --upstream_port UPSTREAM_PORT ",
" use_ssid_idx=1 --radio 'radio==wiphy1,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==wiphy2,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==wiphy3,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==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 'l3_longevity'",
" --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_2q_all":{
"enabled":"TRUE",
"command":"lf_cleanup.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP --cxs --sta"
]},
"test_l3_longevity_flags_2g_all":{
"enabled":"TRUE",
"load_db":"NONE",
"command":"test_l3_longevity.py",
"args":"",
"args_list":[
" --lfmgr LF_MGR_IP --local_lf_report_dir REPORT_PATH --test_duration 30s --polling_interval 5s --upstream_port UPSTREAM_PORT ",
" use_ssid_idx=1 --radio 'radio==wiphy1,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==wiphy2,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==wiphy3,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==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 'l3_longevity'",
" --dut_model_num USE_DUT_NAME --dut_sw_version DUT_SW --dut_hw_version DUT_HW --dut_serial_num DUT_SN"
]
},
"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_test":{
"lf_cleanup":{
"enabled":"FALSE",
"load_db":"NONE",
"command":"lf_cleanup.py",
"args":"",
"args_list":["--mgr LF_MGR_IP --cxs --sta"
]
},
"lf_report_test":{
"enabled":"TRUE",
"load_db":"NONE",
"timeout":"60",
"command":"lf_report_test.py",
"args":"",
"args_list":[" --mgr LF_MGR_IP "
]
},
"lf_graph":{
"enabled":"TRUE",
"load_db":"NONE",
"timeout":"60",
"command":"lf_graph.py",
"args":"",
"args_list":[" --mgr LF_MGR_IP "
]
},
"test_ip_variable_time0-ipv4":{
"enabled":"TRUE",
"command":"test_ip_variable_time.py",
"args":"",
"args_list":[" use_ssid_idx=1 --mgr LF_MGR_IP --radio wiphy1 --ssid SSID_USED --passwd SSID_PW_USED --security SECURITY_USED --test_duration 15s --output_format excel --layer3_cols name,tx_bytes,rx_bytes,dropped --traffic_type lf_udp --debug"]
},
"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"
]
}
} }
} }
} }

View File

@@ -1475,6 +1475,16 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a
# Add the qa_report_html # Add the qa_report_html
qa_report_html = check.qa_report_html qa_report_html = check.qa_report_html
# add the python3 version information
lf_server = pd.DataFrame()
hostname = socket.getfqdn()
ip = socket.gethostbyname(hostname)
lf_server['Server Host Name'] = [hostname]
lf_server['Server ip'] = [ip]
lf_server['Python3 Version'] = [sys.version]
lf_server['Python3 Executable'] = [sys.executable]
lf_suite_time = pd.DataFrame() lf_suite_time = pd.DataFrame()
lf_suite_time['Suite Start'] = [check.suite_start_time] lf_suite_time['Suite Start'] = [check.suite_start_time]
lf_suite_time['Suite End'] = [check.suite_end_time] lf_suite_time['Suite End'] = [check.suite_end_time]
@@ -1501,6 +1511,10 @@ note if all json data (rig,dut,tests) in same json file pass same json in for a
report.build_table_title() report.build_table_title()
report.set_table_dataframe(lf_test_setup) report.set_table_dataframe(lf_test_setup)
report.build_table() report.build_table()
report.set_table_title("LANForge CICD Server")
report.build_table_title()
report.set_table_dataframe(lf_server)
report.build_table()
report.set_table_title("LANForge Radios") report.set_table_title("LANForge Radios")
report.build_table_title() report.build_table_title()
report.set_table_dataframe(lf_radio_df) report.set_table_dataframe(lf_radio_df)

View File

@@ -30,22 +30,32 @@ class MineRegression:
['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname', 'Python Environment']).reset_index(drop=True) ['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname', 'Python Environment']).reset_index(drop=True)
errors = list() errors = list()
lanforge_errors = list() lanforge_errors = list()
partial_failures = list()
major_errors = list()
successes = list()
for index in system_variations.index: for index in system_variations.index:
variation = system_variations.iloc[index] variation = system_variations.iloc[index]
result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict( system = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict(
variation).values()).all(axis=1), :].dropna(subset=['STDERR']).shape[0] variation).values()).all(axis=1), :]
result = system.dropna(subset=['STDERR']).shape[0]
errors.append(result) errors.append(result)
lanforge_result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict( lanforge_result = system.dropna(subset=['LANforge Error']).shape[0]
variation).values()).all(axis=1), :].dropna(subset=['LANforge Error']).shape[0] partial_failures.append(system[system['Status'] == 'Partial Failure'].shape[0])
major_errors.append(system[system['Status'] == 'ERROR'].shape[0])
lanforge_errors.append(lanforge_result) lanforge_errors.append(lanforge_result)
system_variations['errors'] = errors successes.append(system[system['Status'] == 'Success'].shape[0])
system_variations['Successes'] = successes
system_variations['Errors'] = errors
system_variations['LANforge errors'] = lanforge_errors system_variations['LANforge errors'] = lanforge_errors
system_variations['Python errors'] = system_variations['errors'] - system_variations['LANforge errors'] system_variations['Python errors'] = system_variations['Errors'] - system_variations['LANforge errors']
system_variations['Partial Failures'] = partial_failures
system_variations['Major Errors'] = major_errors
system_variations
if self.save_csv: if self.save_csv:
system_variations.to_csv('regression_suite_results.csv') system_variations.to_csv('regression_suite_results.csv')
else: else:
print(system_variations.sort_values('errors')) print(system_variations.sort_values('Successes'))
def main(): def main():
@@ -56,8 +66,7 @@ def main():
args = parser.parse_args() args = parser.parse_args()
if args.ip is None: if args.ip is None:
args.ip = ['192.168.92.18', '192.168.92.12', '192.168.93.51', '192.168.92.15'] args.ip = ['192.168.92.18', '192.168.92.12', '192.168.93.51', '192.168.92.15', '192.168.100.184', '192.168.100.30']
#args.ip = ['192.168.93.51']
Miner = MineRegression(system_information=args.system_info, Miner = MineRegression(system_information=args.system_info,
save_csv=args.save_csv, save_csv=args.save_csv,
ips=args.ip) ips=args.ip)