Merge branch 'feature-wifi-2548' of https://github.com/Telecominfraproject/wlan-testing into feature-wifi-2548

This commit is contained in:
anjali
2021-07-19 14:27:03 +05:30
13 changed files with 155 additions and 159 deletions

View File

@@ -56,9 +56,7 @@ class RunTest:
self.rx_sensitivity_obj = None self.rx_sensitivity_obj = None
self.dualbandptest_obj = None self.dualbandptest_obj = None
self.influx_params = influx_params self.influx_params = influx_params
self.influxdb = RecordInflux(_lfjson_host=self.lanforge_ip, self.influxdb = RecordInflux(_influx_host=influx_params["influx_host"],
_lfjson_port=self.lanforge_port,
_influx_host=influx_params["influx_host"],
_influx_port=influx_params["influx_port"], _influx_port=influx_params["influx_port"],
_influx_org=influx_params["influx_org"], _influx_org=influx_params["influx_org"],
_influx_token=influx_params["influx_token"], _influx_token=influx_params["influx_token"],
@@ -212,10 +210,11 @@ class RunTest:
elif mode == "VLAN": elif mode == "VLAN":
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id) self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
'''SINGLE WIFI CAPACITY using lf_wifi_capacity.py''' '''SINGLE WIFI CAPACITY using lf_wifi_capacity.py'''
self.wificapacity_obj = WiFiCapacityTest(lfclient_host=self.lanforge_ip, wificapacity_obj = WiFiCapacityTest(lfclient_host=self.lanforge_ip,
lf_port=self.lanforge_port, lf_port=self.lanforge_port,
lf_user="lanforge", lf_user="lanforge",
lf_password="lanforge", lf_password="lanforge",
local_lf_report_dir=self.local_report_path,
instance_name=instance_name, instance_name=instance_name,
config_name="wifi_config", config_name="wifi_config",
upstream="1.1." + self.upstream_port, upstream="1.1." + self.upstream_port,
@@ -240,13 +239,14 @@ class RunTest:
raw_lines_file="", raw_lines_file="",
sets=[]) sets=[])
self.wificapacity_obj.setup() wificapacity_obj.setup()
self.wificapacity_obj.run() wificapacity_obj.run()
report_name = self.wificapacity_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] 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"], influx = CSVtoInflux(influxdb=self.influxdb, _influx_tag=self.influx_params["influx_tag"],
target_csv=self.local_report_path + report_name + "/kpi.csv") target_csv=self.local_report_path + report_name + "/kpi.csv")
influx.post_to_influx() influx.post_to_influx()
return wificapacity_obj
def Client_Connect(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", mode="BRIDGE", band="twog", def Client_Connect(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", mode="BRIDGE", band="twog",
vlan_id=100, vlan_id=100,

View File

@@ -11,7 +11,7 @@ import time
import pytest import pytest
import allure import allure
pytestmark = [pytest.mark.performance, pytest.mark.throughput_benchmark_test, pytest.mark.bridge] # pytest.mark.usefixtures("setup_test_run")] pytestmark = [pytest.mark.throughput_benchmark_test, pytest.mark.bridge] # pytest.mark.usefixtures("setup_test_run")]
setup_params_general = { setup_params_general = {

View File

@@ -11,7 +11,7 @@ import time
import pytest import pytest
import allure import allure
pytestmark = [pytest.mark.performance, pytest.mark.throughput_benchmark_test, pytest.mark.nat] # pytest.mark.usefixtures("setup_test_run")] pytestmark = [pytest.mark.throughput_benchmark_test, pytest.mark.nat] # pytest.mark.usefixtures("setup_test_run")]
setup_params_general = { setup_params_general = {

View File

@@ -11,7 +11,7 @@ import time
import pytest import pytest
import allure import allure
#pytestmark = [pytest.mark.performance, pytest.mark.throughput_benchmark_test, pytest.mark.vlan, pytest.mark.usefixtures("setup_test_run")] pytestmark = [pytest.mark.throughput_benchmark_test, pytest.mark.vlan, pytest.mark.usefixtures("setup_test_run")]
setup_params_general = { setup_params_general = {

View File

@@ -8,8 +8,8 @@ import os
import pytest import pytest
import allure import allure
pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.nat, pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.nat]
pytest.mark.usefixtures("setup_test_run")]
setup_params_general = { setup_params_general = {
"mode": "NAT", "mode": "NAT",

View File

@@ -8,8 +8,8 @@ import os
import pytest import pytest
import allure import allure
pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.vlan, pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.vlan]
pytest.mark.usefixtures("setup_test_run")]
setup_params_general = { setup_params_general = {
"mode": "VLAN", "mode": "VLAN",

View File

@@ -8,8 +8,8 @@ import os
import pytest import pytest
import allure import allure
pytestmark = [pytest.mark.throughput_vs_pkt, pytest.mark.bridge, pytest.mark.wpa, pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.bridge]
pytest.mark.usefixtures("setup_test_run")]
setup_params_general = { setup_params_general = {
"mode": "BRIDGE", "mode": "BRIDGE",

View File

@@ -68,38 +68,13 @@ class TestWifiCapacityBridgeMode(object):
pdf = i pdf = i
if pdf: if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf, allure.attach.file(source="../reports/" + report_name + "/" + pdf,
name=get_configuration["access_point"][0]["model"] + "_dataplane") name=get_configuration["access_point"][0]["model"] + "_wifi_capacity_test")
print("Test Completed... Cleaning up Stations") print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_twog) lf_test.Client_disconnect(station_name=station_names_twog)
assert station assert station
else: else:
assert False assert False
setup_params_general_5g = {
"mode": "BRIDGE",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something"}]},
"rf": {},
"radius": False
}
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general_5g],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestWifiCapacityBridgeMode5g(object):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge"
"""
@pytest.mark.wpa2_personal @pytest.mark.wpa2_personal
@pytest.mark.fiveg @pytest.mark.fiveg
def test_client_wpa2_bridge_5gg(self, get_vif_state, def test_client_wpa2_bridge_5gg(self, get_vif_state,
@@ -108,7 +83,7 @@ class TestWifiCapacityBridgeMode5g(object):
""" Wifi Capacity Test Bridge mode """ Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and fiveg" pytest -m "wifi_capacity_test and bridge and wpa2_personal and fiveg"
""" """
profile_data = setup_params_general_5g["ssid_modes"]["wpa2_personal"][1] profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"] ssid_name = profile_data["ssid_name"]
security = "wpa2" security = "wpa2"
mode = "BRIDGE" mode = "BRIDGE"
@@ -132,7 +107,7 @@ class TestWifiCapacityBridgeMode5g(object):
pdf = i pdf = i
if pdf: if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf, allure.attach.file(source="../reports/" + report_name + "/" + pdf,
name=get_configuration["access_point"][0]["model"] + "_dataplane") name=get_configuration["access_point"][0]["model"] + "_wifi_capacity_test")
print("Test Completed... Cleaning up Stations") print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg) lf_test.Client_disconnect(station_name=station_names_fiveg)
assert station assert station

View File

@@ -1,7 +1,7 @@
""" """
Performance Test: Wifi Capacity Test : Nat Mode Performance Test: Wifi Capacity Test : Bridge Mode
pytest -m "wifi_capacity_test and nat" pytest -m "wifi_capacity_test and bridge"
""" """
import os import os
@@ -31,23 +31,23 @@ setup_params_general = {
scope="class" scope="class"
) )
@pytest.mark.usefixtures("setup_profiles") @pytest.mark.usefixtures("setup_profiles")
class TestWifiCapacityNatMode(object): class TestWifiCapacityNATMode(object):
""" Wifi Capacity Test Nat mode """ Wifi Capacity Test NAT mode
pytest -m "wifi_capacity_test and nat" pytest -m "wifi_capacity_test and NAT"
""" """
@pytest.mark.wpa2_personal @pytest.mark.wpa2_personal
@pytest.mark.twog @pytest.mark.twog
def test_client_open_pkt_60_2g(self, get_vif_state, def test_client_wpa2_NAT_2g(self, get_vif_state,
lf_test, station_names_twog, create_lanforge_chamberview_dut, lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration): get_configuration):
""" Wifi Capacity Test Nat mode """ Wifi Capacity Test NAT mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog" pytest -m "wifi_capacity_test and NAT and wpa2_personal and twog"
""" """
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"] ssid_name = profile_data["ssid_name"]
security = "wpa2" security = "wpa2"
mode = "BRIDGE" mode = "NAT"
security_key = profile_data["security_key"] security_key = profile_data["security_key"]
band = "twog" band = "twog"
vlan = 1 vlan = 1
@@ -59,7 +59,7 @@ class TestWifiCapacityNatMode(object):
station_name=station_names_twog, vlan_id=vlan) station_name=station_names_twog, vlan_id=vlan)
if station: if station:
wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_twog[0], wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_twog[0],
instance_name="test_wct_wpa2_bridge", mode=mode, vlan_id=vlan) instance_name="test_wct_wpa2_NAT", mode=mode, vlan_id=vlan)
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/') entries = os.listdir("../reports/" + report_name + '/')
pdf = False pdf = False
@@ -68,51 +68,25 @@ class TestWifiCapacityNatMode(object):
pdf = i pdf = i
if pdf: if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf, allure.attach.file(source="../reports/" + report_name + "/" + pdf,
name=get_configuration["access_point"][0]["model"] + "_dataplane") name=get_configuration["access_point"][0]["model"] + "_wifi_capacity_test")
print("Test Completed... Cleaning up Stations") print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_twog) lf_test.Client_disconnect(station_name=station_names_twog)
assert station assert station
else: else:
assert False assert False
setup_params_general_5g = {
"mode": "NAT",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something"}]},
"rf": {},
"radius": False
}
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general_5g],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestWifiCapacityNatMode5g(object):
""" Wifi Capacity Test Nat mode
pytest -m "wifi_capacity_test and bridge"
"""
@pytest.mark.wpa2_personal @pytest.mark.wpa2_personal
@pytest.mark.fiveg @pytest.mark.fiveg
def test_client_open_pkt_60_5g(self, get_vif_state, def test_client_wpa2_NAT_5gg(self, get_vif_state,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut, lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
get_configuration): get_configuration):
""" Wifi Capacity Test Nat mode """ Wifi Capacity Test NAT mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog" pytest -m "wifi_capacity_test and NAT and wpa2_personal and fiveg"
""" """
profile_data = setup_params_general_5g["ssid_modes"]["wpa2_personal"][1] profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"] ssid_name = profile_data["ssid_name"]
security = "wpa2" security = "wpa2"
mode = "BRIDGE" mode = "NAT"
security_key = profile_data["security_key"] security_key = profile_data["security_key"]
band = "fiveg" band = "fiveg"
vlan = 1 vlan = 1
@@ -124,7 +98,7 @@ class TestWifiCapacityNatMode5g(object):
station_name=station_names_fiveg, vlan_id=vlan) station_name=station_names_fiveg, vlan_id=vlan)
if station: if station:
wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_fiveg[0], wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_fiveg[0],
instance_name="test_wct_wpa2_bridge", mode=mode, vlan_id=vlan) instance_name="test_wct_wpa2_NAT", mode=mode, vlan_id=vlan)
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/') entries = os.listdir("../reports/" + report_name + '/')
pdf = False pdf = False
@@ -133,11 +107,9 @@ class TestWifiCapacityNatMode5g(object):
pdf = i pdf = i
if pdf: if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf, allure.attach.file(source="../reports/" + report_name + "/" + pdf,
name=get_configuration["access_point"][0]["model"] + "_dataplane") name=get_configuration["access_point"][0]["model"] + "_wifi_capacity_test")
print("Test Completed... Cleaning up Stations") print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg) lf_test.Client_disconnect(station_name=station_names_fiveg)
assert station assert station
else: else:
assert False assert False

View File

@@ -1,66 +1,115 @@
# """ """
# Performance : Wifi Capacity Test : VLAN Mode
# Performance Test: Wifi Capacity Test : VLAN Mode
# """ pytest -m "wifi_capacity_test and VLAN"
#
# import pytest """
# import allure import os
# import pytest
# pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.vlan] import allure
#
# setup_params_general = { pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.vlan,
# "mode": "VLAN", pytest.mark.usefixtures("setup_test_run")]
# "ssid_modes": {
# "wpa2_personal": [ setup_params_general = {
# {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, "mode": "VLAN",
# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], "ssid_modes": {
# "security_key": "something"}]}, "wpa2_personal": [
# "rf": {}, {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
# "radius": False {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
# } "security_key": "something"}]},
# "rf": {},
# "radius": False
# @pytest.mark.basic }
# @allure.feature("VLAN MODE CLIENT CONNECTIVITY")
# @pytest.mark.parametrize(
# 'setup_profiles', @allure.feature("VLAN MODE CLIENT CONNECTIVITY")
# [setup_params_general], @pytest.mark.parametrize(
# indirect=True, 'setup_profiles',
# scope="class" [setup_params_general],
# ) indirect=True,
# @pytest.mark.usefixtures("setup_profiles") scope="class"
# class TestWifiCapacityVLANMode(object): )
# @pytest.mark.usefixtures("setup_profiles")
# @pytest.mark.wpa2_personal class TestWifiCapacityVLANMode(object):
# @pytest.mark.twog """ Wifi Capacity Test vlan mode
# def test_client_wpa2_personal_2g(self, lf_test, station_names_twog, create_lanforge_chamberview_dut, pytest -m "wifi_capacity_test and vlan"
# get_configuration): """
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
# ssid_name = profile_data["ssid_name"] @pytest.mark.wpa2_personal
# security_key = profile_data["security_key"] @pytest.mark.twog
# security = "wpa2" def test_client_wpa2_VLAN_2g(self, get_vif_state,
# mode = "VLAN" lf_test, station_names_twog, create_lanforge_chamberview_dut,
# band = "twog" get_configuration):
# vlan = 1 """ Wifi Capacity Test vlan mode
# dut_name = create_lanforge_chamberview_dut pytest -m "wifi_capacity_test and vlan and wpa2_personal and twog"
# PASS = lf_test.wifi_capacity(ssid=profile_data["ssid_name"], paswd=profile_data["security_key"], """
# security="wpa2", mode="VLAN", band="twog", profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
# instance_name="wct_instance", ) ssid_name = profile_data["ssid_name"]
# assert PASS security = "wpa2"
# mode = "VLAN"
# @pytest.mark.wpa2_personal security_key = profile_data["security_key"]
# @pytest.mark.fiveg band = "twog"
# def test_client_wpa2_personal_2g(self, lf_test, station_names_twog, create_lanforge_chamberview_dut, vlan = 1
# get_configuration): if ssid_name not in get_vif_state:
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
# ssid_name = profile_data["ssid_name"] pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
# security_key = profile_data["security_key"] station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key,
# security = "wpa2" mode=mode, band=band,
# mode = "VLAN" station_name=station_names_twog, vlan_id=vlan)
# band = "fiveg" if station:
# vlan = 1 wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_twog[0],
# dut_name = create_lanforge_chamberview_dut instance_name="test_wct_wpa2_vlan", mode=mode, vlan_id=vlan)
# PASS = lf_test.wifi_capacity(ssid=profile_data["ssid_name"], paswd=profile_data["security_key"], report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
# security=security, mode=mode, band=band, entries = os.listdir("../reports/" + report_name + '/')
# instance_name="wct_instance", ) pdf = False
# assert PASS for i in entries:
if ".pdf" in i:
pdf = i
if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
name=get_configuration["access_point"][0]["model"] + "_wifi_capacity_test")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_twog)
assert station
else:
assert False
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
def test_client_wpa2_vlan_5gg(self, get_vif_state,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test vlan mode
pytest -m "wifi_capacity_test and vlan and wpa2_personal and fiveg"
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
security = "wpa2"
mode = "VLAN"
security_key = profile_data["security_key"]
band = "fiveg"
vlan = 1
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key,
mode=mode, band=band,
station_name=station_names_fiveg, vlan_id=vlan)
if station:
wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_fiveg[0],
instance_name="test_wct_wpa2_vlan", mode=mode, vlan_id=vlan)
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
pdf = False
for i in entries:
if ".pdf" in i:
pdf = i
if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
name=get_configuration["access_point"][0]["model"] + "_wifi_capacity_test")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
assert station
else:
assert False