wifi capacity test fixes: added influx tags and precleanup

Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
shivamcandela
2021-08-21 20:53:04 +05:30
parent 8c54d464e5
commit 4906923070
7 changed files with 103 additions and 43 deletions

View File

@@ -214,7 +214,7 @@ class RunTest:
return self.eap_connect.passes()
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",
instance_name="wct_instance", download_rate="1Gbps", influx_tags=[],
upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000"):
instance_name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=S))
if mode == "BRIDGE":
@@ -254,10 +254,12 @@ class RunTest:
wificapacity_obj.setup()
wificapacity_obj.run()
for tag in influx_tags:
self.influx_params["influx_tag"].append(tag)
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",

View File

@@ -69,7 +69,6 @@ class ChamberView:
["profile_link " + self.uplink_resources + " uplink-nat 1 'DUT: upstream LAN " + self.upstream_subnet
+ "' NA " + self.uplink_port.split(".")[2] + "," + self.upstream_port.split(".")[2] + " -1 NA"]
]
self.reset_dut()
self.Chamber_View()
def reset_dut(self):
@@ -109,32 +108,71 @@ class ChamberView:
print(idx)
if band == "2G":
if num_stations != "max":
if num_stations > 64:
num_stations = int(num_stations / len(self.twog_radios))
for radio in self.twog_radios:
max_stations = 64
station_data = ["profile_link " + radio.split(".")[0] + "." + radio.split(".")[1] +
" STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + radio.split(".")[2]]
self.raw_line.append(station_data)
else:
num_stations = num_stations
station_data = ["profile_link " + self.fiveg_radios[0].split(".")[0] + "." +
self.fiveg_radios[0].split(".")[1] +
" STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + self.twog_radios[0].split(".")[2]]
self.raw_line.append(station_data)
if num_stations == "max":
num_stations = max_stations
station_data = ["profile_link 1.1 STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + radio]
for radio in self.twog_radios:
num_stations = 64
station_data = ["profile_link " + radio.split(".")[0] + "." + radio.split(".")[1] +
" STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + radio.split(".")[2]]
self.raw_line.append(station_data)
if band == "5G":
if num_stations != "max":
if num_stations > 64:
num_stations = int(num_stations / len(self.fiveg_radios))
for radio in self.fiveg_radios:
max_stations = 64
station_data = ["profile_link " + radio.split(".")[0] + "." + radio.split(".")[1] +
" STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + radio.split(".")[2]]
print(station_data)
self.raw_line.append(station_data)
else:
num_stations = num_stations
station_data = ["profile_link " + self.fiveg_radios[0].split(".")[0] + "." +
self.fiveg_radios[0].split(".")[1] +
" STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + self.fiveg_radios[0].split(".")[2]]
print(station_data)
self.raw_line.append(station_data)
if num_stations == "max":
num_stations = max_stations
for radio in self.fiveg_radios:
num_stations = 64
station_data = ["profile_link " + radio.split(".")[0] + "." + radio.split(".")[1] +
" STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + radio.split(".")[2]]
print(station_data)
self.raw_line.append(station_data)
if band == "ax":
if num_stations != "max":
if num_stations > 64:
num_stations = int(num_stations / len(self.ax_radios))
for radio in self.ax_radios:
station_data = ["profile_link 1.1 STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + radio]
self.raw_line.append(station_data)
if band == "ax":
if num_stations != "max":
num_stations = int(num_stations / len(self.fiveg_radios))
for radio in self.ax_radios:
max_stations = 1
else:
num_stations = num_stations
station_data = ["profile_link 1.1 STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + self.ax_radios[0]]
self.raw_line.append(station_data)
if num_stations == "max":
num_stations = max_stations
for radio in self.ax_radios:
num_stations = 64
station_data = ["profile_link 1.1 STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + radio]
self.raw_line.append(station_data)

View File

@@ -216,9 +216,9 @@ CONFIGURATION = {
"ip": "10.28.3.28",
"port": 8080,
"ssh_port": 22,
"2.4G-Radio": ["1.1.wiphy2"],
"5G-Radio": ["1.1.wiphy3"],
"AX-Radio": ["1.1.wiphy0", "1.1.wiphy1", "1.1.wiphy2", "1.1.wiphy3"],
"2.4G-Radio": ["1.1.wiphy0", "1.1.wiphy2"],
"5G-Radio": ["1.1.wiphy1", "1.1.wiphy3"],
"AX-Radio": ["1.1.wiphy4", "1.1.wiphy5", "1.1.wiphy6", "1.1.wiphy7"],
"upstream": "1.1.eth2",
"upstream_subnet": "10.28.2.1/24",
"uplink": "1.1.eth1",

View File

@@ -50,6 +50,7 @@ class TestWifiCapacityBRIDGEModeDualBand(object):
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
lf_tools.reset_scenario()
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
@@ -60,10 +61,12 @@ class TestWifiCapacityBRIDGEModeDualBand(object):
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
# lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
influx_tags = ["tcp", "download", "2.4G-5G Combined"]
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
download_rate="1Gbps", batch_size="1,5,10,20,40,64,128,256",
influx_tags=influx_tags,
upload_rate="0", protocol="TCP-IPv4", duration="60000")
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
@@ -79,6 +82,7 @@ class TestWifiCapacityBRIDGEModeDualBand(object):
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
lf_tools.reset_scenario()
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
@@ -89,10 +93,12 @@ class TestWifiCapacityBRIDGEModeDualBand(object):
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
# lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
influx_tags = ["udp", "download", "2.4G-5G Combined"]
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_udp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
download_rate="1Gbps", batch_size="1,5,10,20,40,64,128,256",
influx_tags=influx_tags,
upload_rate="0", protocol="UDP-IPv4", duration="60000")
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
@@ -108,6 +114,7 @@ class TestWifiCapacityBRIDGEModeDualBand(object):
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
lf_tools.reset_scenario()
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
@@ -119,8 +126,10 @@ class TestWifiCapacityBRIDGEModeDualBand(object):
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
influx_tags = ["tcp", "bidirectional", "2.4G-5G Combined"]
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
download_rate="1Gbps", batch_size="1,5,10,20,40,64,128,256",
influx_tags=influx_tags,
upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000")
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
@@ -136,6 +145,7 @@ class TestWifiCapacityBRIDGEModeDualBand(object):
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
lf_tools.reset_scenario()
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
@@ -145,10 +155,12 @@ class TestWifiCapacityBRIDGEModeDualBand(object):
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
# lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
influx_tags = ["udp", "bidirectional", "2.4G-5G Combined"]
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_udp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
download_rate="1Gbps", batch_size="1,5,10,20,40,64,128,256",
influx_tags=influx_tags,
upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000")
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]

View File

@@ -36,7 +36,6 @@ setup_params_general_dual_band = {
@pytest.mark.twog
@pytest.mark.fiveg
@pytest.mark.dual_band
@pytest.mark.wifi_capacity_test
class TestWifiCapacityNATModeDualBand(object):
""" Wifi Capacity Test NAT mode
pytest -m "wifi_capacity_test and NAT"

View File

@@ -8,7 +8,7 @@ import allure
import pytest
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.enterprise, pytest.mark.ttls,
pytest.mark.ucentral, pytest.mark.sanity]#, pytest.mark.usefixtures("setup_test_run")]
pytest.mark.ucentral, pytest.mark.sanity] # , pytest.mark.usefixtures("setup_test_run")]
setup_params_enterprise = {
"mode": "BRIDGE",
@@ -28,6 +28,8 @@ setup_params_enterprise = {
}
@allure.suite(suite_name="sanity")
@allure.sub_suite(sub_suite_name="Bridge Mode EAP Client Connectivity : Suite-A")
@pytest.mark.suiteA
@pytest.mark.parametrize(
'setup_profiles',
@@ -220,6 +222,8 @@ setup_params_enterprise_two = {
}
@allure.suite(suite_name="sanity")
@allure.sub_suite(sub_suite_name="Bridge Mode EAP Client Connectivity : Suite-B")
@pytest.mark.suiteB
@pytest.mark.parametrize(
'setup_profiles',

View File

@@ -29,6 +29,8 @@ setup_params_general = {
}
@allure.suite(suite_name="sanity")
@allure.sub_suite(sub_suite_name="Bridge Mode Client Connectivity : Suite-A")
@pytest.mark.suiteA
@pytest.mark.sudo
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
@@ -46,7 +48,7 @@ class TestBridgeModeConnectivitySuiteA(object):
@pytest.mark.open
@pytest.mark.twog
@allure.story('open 2.4 GHZ Band')
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2809", name="JIRA LINK")
def test_open_ssid_2g(self, get_vif_state, setup_profiles, get_lanforge_data, lf_test, update_report,
station_names_twog,
test_cases):
@@ -72,7 +74,7 @@ class TestBridgeModeConnectivitySuiteA(object):
@pytest.mark.open
@pytest.mark.fiveg
@allure.story('open 5 GHZ Band')
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2801", name="JIRA LINK")
def test_open_ssid_5g(self, get_vif_state, get_lanforge_data, lf_test, test_cases, station_names_fiveg,
update_report):
"""Client Connectivity open ssid 5G
@@ -99,6 +101,7 @@ class TestBridgeModeConnectivitySuiteA(object):
@pytest.mark.wpa
@pytest.mark.twog
@allure.story('wpa 2.4 GHZ Band')
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2801", name="JIRA LINK")
def test_wpa_ssid_2g(self, get_vif_state, get_lanforge_data, update_report,
lf_test, test_cases, station_names_twog):
"""Client Connectivity wpa ssid 2.4G
@@ -222,6 +225,8 @@ setup_params_general_two = {
}
@allure.suite(suite_name="sanity")
@allure.sub_suite(sub_suite_name="Bridge Mode Client Connectivity : Suite-B")
@pytest.mark.suiteB
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(