mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 03:48:09 +00:00
Merge branch 'master' into staging-wifi-3035
This commit is contained in:
@@ -57,7 +57,6 @@ class RunTest:
|
||||
self.staConnect = None
|
||||
self.dataplane_obj = None
|
||||
self.dualbandptest_obj = None
|
||||
self.apstab_obj = None
|
||||
self.influx_params = influx_params
|
||||
self.influxdb = RecordInflux(_influx_host=influx_params["influx_host"],
|
||||
_influx_port=influx_params["influx_port"],
|
||||
@@ -120,6 +119,15 @@ class RunTest:
|
||||
print("test result: " + result)
|
||||
result = True
|
||||
print("Client Connectivity :", self.staConnect.passes)
|
||||
endp_data = []
|
||||
for i in self.staConnect.resulting_endpoints:
|
||||
endp_data.append(self.staConnect.resulting_endpoints[i]["endpoint"])
|
||||
cx_data = ""
|
||||
for i in endp_data:
|
||||
for j in i:
|
||||
cx_data = cx_data + str(j) + " : " + str(i[j]) + "\n"
|
||||
cx_data = cx_data + "\n"
|
||||
allure.attach(name="cx_data", body=str(cx_data))
|
||||
if self.staConnect.passes():
|
||||
print("client connection to", self.staConnect.dut_ssid, "successful. Test Passed")
|
||||
else:
|
||||
@@ -205,7 +213,8 @@ class RunTest:
|
||||
self.eap_connect.cleanup(station_name)
|
||||
return self.eap_connect.passes()
|
||||
|
||||
def wifi_capacity(self, mode="BRIDGE", vlan_id=100, instance_name="wct_instance", download_rate="1Gbps",
|
||||
def wifi_capacity(self, mode="BRIDGE", vlan_id=100, batch_size="1,5,10,20,40,64,128",
|
||||
instance_name="wct_instance", download_rate="1Gbps",
|
||||
upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000"):
|
||||
instance_name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=S))
|
||||
if mode == "BRIDGE":
|
||||
@@ -223,7 +232,7 @@ class RunTest:
|
||||
instance_name=instance_name,
|
||||
config_name="wifi_config",
|
||||
upstream="1.1." + upstream_port,
|
||||
batch_size="1,5,10,20,40,64",
|
||||
batch_size=batch_size,
|
||||
loop_iter="1",
|
||||
protocol=protocol,
|
||||
duration=duration,
|
||||
@@ -232,7 +241,6 @@ class RunTest:
|
||||
upload_rate=upload_rate,
|
||||
download_rate=download_rate,
|
||||
sort="interleave",
|
||||
# stations=stations,
|
||||
create_stations=True,
|
||||
radio=None,
|
||||
security=None,
|
||||
@@ -246,11 +254,10 @@ class RunTest:
|
||||
|
||||
wificapacity_obj.setup()
|
||||
wificapacity_obj.run()
|
||||
|
||||
report_name = wificapacity_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
influx = CSVtoInflux(influxdb=self.influxdb, _influx_tag=self.influx_params["influx_tag"],
|
||||
target_csv=self.local_report_path + report_name + "/kpi.csv")
|
||||
influx.post_to_influx()
|
||||
# influx = CSVtoInflux(influxdb=self.influxdb, _influx_tag=self.influx_params["influx_tag"],
|
||||
# target_csv=self.local_report_path + report_name + "/kpi.csv")
|
||||
# influx.post_to_influx()
|
||||
return wificapacity_obj
|
||||
|
||||
def Client_Connect(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", mode="BRIDGE", band="twog",
|
||||
@@ -293,8 +300,17 @@ class RunTest:
|
||||
instance_name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=S))
|
||||
|
||||
if mode == "BRIDGE":
|
||||
self.client_connect.upstream_port = self.upstream_port
|
||||
self.upstream_port = self.upstream_port
|
||||
elif mode == "NAT":
|
||||
|
||||
self.upstream_port = self.upstream_port
|
||||
elif mode == "VLAN":
|
||||
self.upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
|
||||
if raw_lines is None:
|
||||
raw_lines = [['pkts: 60;142;256;512;1024;MTU;4000'], ['directions: DUT Transmit;DUT Receive'],
|
||||
['traffic_types: UDP;TCP'],
|
||||
["show_3s: 1"], ["show_ll_graphs: 1"], ["show_log: 1"]]
|
||||
self.client_connect.upstream_port = self.upstream_port
|
||||
elif mode == "VLAN":
|
||||
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
@@ -420,6 +436,41 @@ class RunTest:
|
||||
# influx.post_to_influx()
|
||||
return self.apstab_obj
|
||||
|
||||
|
||||
def ratevsrange(self, station_name=None, mode="BRIDGE", vlan_id=100, download_rate="85%", dut_name="TIP",
|
||||
upload_rate="0", duration="1m", instance_name="test_demo", raw_lines=None):
|
||||
if mode == "BRIDGE":
|
||||
self.client_connect.upstream_port = self.upstream_port
|
||||
elif mode == "NAT":
|
||||
self.client_connect.upstream_port = self.upstream_port
|
||||
elif mode == "VLAN":
|
||||
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
|
||||
self.rvr_obj = RvrTest(lf_host=self.lanforge_ip,
|
||||
lf_port=self.lanforge_port,
|
||||
ssh_port=self.lf_ssh_port,
|
||||
local_path=self.local_report_path,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name=instance_name,
|
||||
config_name="rvr_config",
|
||||
upstream="1.1." + self.upstream_port,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
upload_speed=upload_rate,
|
||||
download_speed=download_rate,
|
||||
duration=duration,
|
||||
station="1.1." + station_name[0],
|
||||
dut=dut_name,
|
||||
raw_lines=raw_lines)
|
||||
self.rvr_obj.setup()
|
||||
self.rvr_obj.run()
|
||||
report_name = self.rvr_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
influx = CSVtoInflux(influxdb=self.influxdb, _influx_tag=self.influx_params["influx_tag"],
|
||||
target_csv=self.local_report_path + report_name + "/kpi.csv")
|
||||
influx.post_to_influx()
|
||||
return self.rvr_obj
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
lanforge_data = {
|
||||
|
||||
Reference in New Issue
Block a user