Merge branch 'master' into WIFI-3631

This commit is contained in:
Shivam Thakur
2021-11-09 16:30:45 +05:30
committed by GitHub
11 changed files with 980 additions and 1046 deletions

View File

@@ -139,7 +139,7 @@ jobs:
- -c
- |
cd tests
pytest -m "${{ steps.marker.outputs.expression }}" -s -vvv --testbed=interop-03 -o 'jobName=Github-Interop-${{ matrix.test_type }}' -o 'jobNumber=${{ github.run_number }}' --alluredir=/tmp/allure-results
pytest -m "${{ steps.marker.outputs.expression }}" -s -vvv --testbed=interop-03 -o 'jobName=Github-Interop-${{ matrix.test_type }}' -o 'jobNumber=${{ github.run_number }}' --alluredir=/tmp/allure-results --skip-lanforge
ret=\$?
# sleep some time to be able to download the Allure results
sleep 60

View File

@@ -182,7 +182,7 @@ jobs:
}
RADIUS_SERVER_DATA = {
"ip": "10.10.10.72",
"ip": "10.10.1.221",
"port": 1812,
"secret": "testing123",
"user": "user",
@@ -191,8 +191,8 @@ jobs:
}
RADIUS_ACCOUNTING_DATA = {
"ip": "10.10.10.72",
"port": 1812,
"ip": "10.10.1.221",
"port": 1813,
"secret": "testing123",
"user": "user",
"password": "password",

View File

@@ -97,6 +97,13 @@ def pytest_addoption(parser):
help="skip updating firmware on the AP (useful for local testing)"
)
parser.addoption(
"--skip-lanforge",
action="store_true",
default=False,
help="skip to do any interactions on lanforge (to be used in case of interop)"
)
# change behaviour
parser.addoption(
"--exit-on-fail",
@@ -260,6 +267,11 @@ def get_sdk_version(fixtures_ver):
yield version
@pytest.fixture(scope="session")
def skip_lf(request):
yield request.config.getoption("--skip-lanforge")
# Controller Fixture
@pytest.fixture(scope="session")
def setup_controller(request, get_configuration, add_env_properties, fixtures_ver):
@@ -542,26 +554,33 @@ def traffic_generator_connectivity(testbed, get_configuration):
@pytest.fixture(scope="session")
def create_lanforge_chamberview_dut(lf_tools):
dut_object, dut_name = lf_tools.Create_Dut()
def create_lanforge_chamberview_dut(lf_tools, skip_lf):
dut_name = ""
if not skip_lf:
dut_object, dut_name = lf_tools.Create_Dut()
return dut_name
@pytest.fixture(scope="session")
def lf_tools(get_configuration, testbed):
def lf_tools(get_configuration, testbed, skip_lf):
""" Create a DUT on LANforge"""
obj = ChamberView(lanforge_data=get_configuration["traffic_generator"]["details"],
testbed=testbed, access_point_data=get_configuration["access_point"])
if not skip_lf:
obj = ChamberView(lanforge_data=get_configuration["traffic_generator"]["details"],
testbed=testbed, access_point_data=get_configuration["access_point"])
else:
obj = False
yield obj
@pytest.fixture(scope="session")
def lf_test(get_configuration, setup_influx, request):
if request.config.getoption("--exit-on-fail"):
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'], influx_params=setup_influx, debug=True)
if request.config.getoption("--exit-on-fail") is False:
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'], influx_params=setup_influx, debug=False)
def lf_test(get_configuration, setup_influx, request, skip_lf):
if not skip_lf:
if request.config.getoption("--exit-on-fail"):
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'], influx_params=setup_influx,
debug=True)
if request.config.getoption("--exit-on-fail") is False:
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'], influx_params=setup_influx,
debug=False)
yield obj

View File

@@ -8,33 +8,22 @@
"""
import os
import time
import pytest
import allure
import os.path
import csv
import pandas as pd
pytestmark = [pytest.mark.ratevsrange, pytest.mark.bridge ,pytest.mark.usefixtures("setup_test_run")]
pytestmark = [pytest.mark.advance, pytest.mark.ratevsrange, pytest.mark.bridge]
setup_params_general = {
"mode": "BRIDGE",
"ssid_modes": {
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something"}],
"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": {
"is5GHz": {"channelBandwidth": "is20MHz"},
"is5GHzL": {"channelBandwidth": "is20MHz"},
"is5GHzU": {"channelBandwidth": "is20MHz"}
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"}
]
},
"rf": {},
"radius": False
}
@@ -52,8 +41,8 @@ class TestRatevsRangeBridge(object):
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.client11b
def test_client_wpa2_personal_2g_11b(self, get_vif_state,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2495", name="WIFI-2495")
def test_client_wpa2_personal_2g_11b(self, lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
"""
@@ -68,26 +57,25 @@ class TestRatevsRangeBridge(object):
band = "twog"
vlan = 1
dut_name = create_lanforge_chamberview_dut
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_twog, vlan_id=vlan)
print("station", station)
val = [['modes: 802.11b'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
val = [['modes: 802.11b'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
instance_name="BRIDGE_RVR_11B",
instance_name="MODEBRIDGE_RVR_11B_TWOG",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
print("report name ", report_name)
entries = os.listdir("../reports/" + report_name + '/')
print("entries",entries)
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
pdf = False
for i in entries:
if ".pdf" in i:
@@ -99,16 +87,15 @@ class TestRatevsRangeBridge(object):
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_twog)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
if str(kpi_val) == "empty":
print("kpi is empty, station did not got ip, Test failed")
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
assert False
else:
print("Test passed successfully")
allure.attach(name="Kpi Data", body=str(kpi_val))
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
# print(str(kpi_val))
# if str(kpi_val) == "empty":
# print("kpi is empty, station did not got ip, Test failed")
# allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
# assert False
# else:
# print("Test passed successfully")
# allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@@ -116,7 +103,8 @@ class TestRatevsRangeBridge(object):
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.client11g
def test_client_wpa2_personal_2g_11g(self, get_vif_state,
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2496", name="WIFI-2496")
def test_client_wpa2_personal_2g_11g(self,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
"""
@@ -132,24 +120,22 @@ class TestRatevsRangeBridge(object):
band = "twog"
vlan = 1
dut_name = create_lanforge_chamberview_dut
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_twog, vlan_id=vlan)
print("station", station)
val = [['modes: 802.11g'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
val = [['modes: 802.11g'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
instance_name="BRIDGE_RVR_11G",
instance_name="MODEBRIDGE_RVR_11G_TWOG",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
pdf = False
for i in entries:
if ".pdf" in i:
@@ -159,17 +145,6 @@ class TestRatevsRangeBridge(object):
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_twog)
script_dir = os.path.dirname(__file__) # Script directory
print(script_dir)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
if str(kpi_val) == "empty":
print("kpi is empty, station did not got ip, Test failed")
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
assert False
else:
print("Test passed successfully")
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@@ -177,7 +152,8 @@ class TestRatevsRangeBridge(object):
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.client11a
def test_client_wpa2_personal_5g_11a(self, get_vif_state,
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2497", name="WIFI-2497")
def test_client_wpa2_personal_5g_11a(self,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
get_configuration,lf_tools):
"""
@@ -193,24 +169,22 @@ class TestRatevsRangeBridge(object):
band = "fiveg"
vlan = 1
dut_name = create_lanforge_chamberview_dut
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)
print("station", station)
val = [['modes: 802.11a'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
val = [['modes: 802.11a'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
instance_name="BRIDGE_RVR_11A",
instance_name="MODEBRIDGE_RVR_11A_FIVEG",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
pdf = False
for i in entries:
if ".pdf" in i:
@@ -220,15 +194,6 @@ class TestRatevsRangeBridge(object):
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
kpi_val = lf_tools.read_kpi_file(column_name=['numeric-score'], dir_name=report_name)
print(str(kpi_val))
if str(kpi_val) == "empty":
print("kpi is empty, station did not got ip, Test failed")
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
assert False
else:
print("Test passed successfully")
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@@ -236,7 +201,8 @@ class TestRatevsRangeBridge(object):
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.client11an
def test_client_wpa2_personal_5g_11an(self, get_vif_state,
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2498", name="WIFI-2498")
def test_client_wpa2_personal_5g_11an(self,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
"""
@@ -252,24 +218,23 @@ class TestRatevsRangeBridge(object):
band = "fiveg"
vlan = 1
dut_name = create_lanforge_chamberview_dut
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)
print("station", station)
val = [['modes: 802.11an'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
val = [['modes: 802.11an'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
instance_name="BRIDGE_RVR_11AN",
instance_name="MODEBRIDGE_RVR_11AN_FIVEG",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
pdf = False
for i in entries:
if ".pdf" in i:
@@ -279,25 +244,16 @@ class TestRatevsRangeBridge(object):
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
if str(kpi_val) == "empty":
print("kpi is empty, station did not got ip, Test failed")
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
assert False
else:
print("Test passed successfully")
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@pytest.mark.performance_advanced
@pytest.mark.performance_advanced
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.client11ac
def test_client_wpa2_personal_5g_11ac(self, get_vif_state,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2499", name="WIFI-2499")
def test_client_wpa2_personal_5g_11ac(self, lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
"""
@@ -312,24 +268,23 @@ class TestRatevsRangeBridge(object):
band = "fiveg"
vlan = 1
dut_name = create_lanforge_chamberview_dut
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)
print("station", station)
val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'] ,['attenuator2: 1.1.3059'], ['attenuations: 0..+50..950'],['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
instance_name="BRIDGE_RVR_11AC",
instance_name="MODEBRIDGE_RVR_11AC_FIVEG",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
pdf = False
for i in entries:
if ".pdf" in i:
@@ -339,15 +294,6 @@ class TestRatevsRangeBridge(object):
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
if str(kpi_val) == "empty":
print("kpi is empty, station did not got ip, Test failed")
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
assert False
else:
print("Test passed successfully")
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False

View File

@@ -1,7 +1,8 @@
"""
Advanced Test: Rate v/s Range test under various combinations: NAT Mode
pytest -m "throughput_benchmark_test and nat" -s -vvv --skip-testrail --testbed=basic-01
pytest -m "ratevsrange and NAT " -s -vvv --skip-testrail --testbed=basic-01 --alluredir=../allure_reports
--> allure serve ../allure_reports/
"""
@@ -10,31 +11,26 @@ import time
import pytest
import allure
import os.path
import csv
import pandas as pd
pytestmark = [pytest.mark.ratevsrange, pytest.mark.nat ,pytest.mark.usefixtures("setup_test_run")]
# pytestmark = [pytest.mark.advance, pytest.mark.ratevsrange, pytest.mark.nat]
setup_params_general = {
"mode": "NAT",
"ssid_modes": {
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something"}],
"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": {
"is5GHz": {"channelBandwidth": "is20MHz"},
"is5GHzL": {"channelBandwidth": "is20MHz"},
"is5GHzU": {"channelBandwidth": "is20MHz"}
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"}
]
},
"rf": {},
"radius": False
}
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
@@ -42,18 +38,17 @@ setup_params_general = {
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
@pytest.mark.Mhz20
class TestRatevsRangeNat(object):
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.client11b
def test_client_wpa2_personal_2g_11b(self, get_vif_state,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2495", name="WIFI-2495")
def test_client_wpa2_personal_2g_11b(self, lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
"""
pytest -m "ratevsrange and nat and 11bclient" -s -vvv --skip-testrail --testbed=advanced-02
pytest -m "ratevsrange and client11b" -s -vvv --skip-testrail --testbed=advanced-02
jira- wifi-2495
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
@@ -64,24 +59,25 @@ class TestRatevsRangeNat(object):
band = "twog"
vlan = 1
dut_name = create_lanforge_chamberview_dut
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_twog, vlan_id=vlan)
print("station", station)
val = [['modes: 802.11b'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
val = [['modes: 802.11b'], ['pkts: 60;142;256;512;1024;MTU;4000;9000'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
instance_name="NAT_RVR_11B",
instance_name="NAT_RVR_11B_TWOG",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
print("report name ", report_name)
entries = os.listdir("../reports/" + report_name + '/')
print("entries",entries)
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
pdf = False
for i in entries:
if ".pdf" in i:
@@ -89,11 +85,20 @@ class TestRatevsRangeNat(object):
if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_twog)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
allure.attach(name="Kpi Data", body=str(kpi_val))
if str(kpi_val) == "empty":
print("kpi is empty, station did not got ip, Test failed")
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
assert False
else:
print("Test passed successfully")
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@@ -101,12 +106,13 @@ class TestRatevsRangeNat(object):
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.client11g
def test_client_wpa2_personal_2g_11g(self, get_vif_state,
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2496", name="WIFI-2496")
def test_client_wpa2_personal_2g_11g(self,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
"""
pytest -m "ratevsrange and nat and client11g" -s -vvv --skip-testrail --testbed=advanced-02
pytest -m "ratevsrange and NAT and client11g" -s -vvv --skip-testrail --testbed=advanced-02
jira- wifi-2496
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
@@ -117,25 +123,22 @@ class TestRatevsRangeNat(object):
band = "twog"
vlan = 1
dut_name = create_lanforge_chamberview_dut
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_twog, vlan_id=vlan)
print("station", station)
val = [['modes: 802.11G'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
val = [['modes: 802.11g'], ['pkts: 60;142;256;512;1024;MTU;4000;9000'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
instance_name="NAT_RVR_11G",
instance_name="NAT_RVR_11G_TWOG",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
pdf = False
for i in entries:
if ".pdf" in i:
@@ -145,9 +148,17 @@ class TestRatevsRangeNat(object):
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_twog)
script_dir = os.path.dirname(__file__) # Script directory
print(script_dir)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
allure.attach(name="Kpi Data", body=str(kpi_val))
if str(kpi_val) == "empty":
print("kpi is empty, station did not got ip, Test failed")
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
assert False
else:
print("Test passed successfully")
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@@ -155,12 +166,13 @@ class TestRatevsRangeNat(object):
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.client11a
def test_client_wpa2_personal_5g_11a(self, get_vif_state,
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2497", name="WIFI-2497")
def test_client_wpa2_personal_5g_11a(self,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
get_configuration,lf_tools):
"""
pytest -m "ratevsrange and nat and client11a" -s -vvv --skip-testrail --testbed=advanced-02
pytest -m "ratevsrange and NAT and client11a" -s -vvv --skip-testrail --testbed=advanced-02
jira- wifi-2497
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
@@ -171,25 +183,22 @@ class TestRatevsRangeNat(object):
band = "fiveg"
vlan = 1
dut_name = create_lanforge_chamberview_dut
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)
print("station", station)
val = [['modes: 802.11a'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
val = [['modes: 802.11a'], ['pkts: 60;142;256;512;1024;MTU;4000;9000'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
instance_name="NAT_RVR_11A",
instance_name="NAT_RVR_11A_FIVEG",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
pdf = False
for i in entries:
if ".pdf" in i:
@@ -199,9 +208,15 @@ class TestRatevsRangeNat(object):
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
kpi_val = lf_tools.read_kpi_file(column_name=['numeric-score'], dir_name=report_name)
print(str(kpi_val))
allure.attach(name="Kpi Data", body=str(kpi_val))
if str(kpi_val) == "empty":
print("kpi is empty, station did not got ip, Test failed")
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
assert False
else:
print("Test passed successfully")
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@@ -209,12 +224,13 @@ class TestRatevsRangeNat(object):
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.client11an
def test_client_wpa2_personal_5g_11an(self, get_vif_state,
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2498", name="WIFI-2498")
def test_client_wpa2_personal_5g_11an(self,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
get_configuration,lf_tools):
get_configuration, lf_tools):
"""
pytest -m "ratevsrange and nat and client11an" -s -vvv --skip-testrail --testbed=advanced-02
pytest -m "ratevsrange and NAT and client11an" -s -vvv --skip-testrail --testbed=advanced-02
jira- wifi-2498
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
@@ -225,25 +241,23 @@ class TestRatevsRangeNat(object):
band = "fiveg"
vlan = 1
dut_name = create_lanforge_chamberview_dut
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)
print("station", station)
val = [['modes: 802.11an'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
val = [['modes: 802.11an'], ['pkts: 60;142;256;512;1024;MTU;4000;9000'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
instance_name="NAT_RVR_11AN",
instance_name="NAT_RVR_11AN_FIVEG",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
pdf = False
for i in entries:
if ".pdf" in i:
@@ -255,7 +269,13 @@ class TestRatevsRangeNat(object):
lf_test.Client_disconnect(station_name=station_names_fiveg)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
allure.attach(name="Kpi Data", body=str(kpi_val))
if str(kpi_val) == "empty":
print("kpi is empty, station did not got ip, Test failed")
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
assert False
else:
print("Test passed successfully")
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@@ -264,12 +284,12 @@ class TestRatevsRangeNat(object):
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.client11ac
def test_client_wpa2_personal_5g_11ac(self, get_vif_state,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2499", name="WIFI-2499")
def test_client_wpa2_personal_5g_11ac(self, lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
"""
pytest -m "ratevsrange and nat and client11ac" -s -vvv --skip-testrail --testbed=advanced-02
pytest -m "ratevsrange and NAT and client11ac" -s -vvv --skip-testrail --testbed=advanced-02
jira- wifi-2499
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
@@ -280,25 +300,23 @@ class TestRatevsRangeNat(object):
band = "fiveg"
vlan = 1
dut_name = create_lanforge_chamberview_dut
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)
print("station", station)
val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
val = [['modes: 802.11an-AC'], ['pkts: 60;142;256;512;1024;MTU;4000;9000'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'] ,['attenuator2: 1.1.3059'], ['attenuations: 0..+50..950'],['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
instance_name="NAT_RVR_11AC",
instance_name="NAT_RVR_11AC_FIVEG",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
pdf = False
for i in entries:
if ".pdf" in i:
@@ -310,7 +328,13 @@ class TestRatevsRangeNat(object):
lf_test.Client_disconnect(station_name=station_names_fiveg)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
allure.attach(name="Kpi Data", body=str(kpi_val))
if str(kpi_val) == "empty":
print("kpi is empty, station did not got ip, Test failed")
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
assert False
else:
print("Test passed successfully")
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False

View File

@@ -1,314 +1,314 @@
"""
Advanced Test: Rate v/s Range test under various combinations: VLAN Mode
pytest -m "throughput_benchmark_test and vlan" -s -vvv --skip-testrail --testbed=basic-01
"""
import os
import time
import pytest
import allure
pytestmark = [pytest.mark.ratevsrange, pytest.mark.vlan ,pytest.mark.usefixtures("setup_test_run")]
setup_params_general = {
"mode": "VLAN",
"ssid_modes": {
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something"}],
"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": {
"is5GHz": {"channelBandwidth": "is20MHz"},
"is5GHzL": {"channelBandwidth": "is20MHz"},
"is5GHzU": {"channelBandwidth": "is20MHz"}
},
"radius": False
}
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
@pytest.mark.Mhz20
class TestRatevsRangeVlan(object):
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.client11b
def test_client_wpa2_personal_2g_11b(self, get_vif_state,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
"""
pytest -m "ratevsrange and vlan and 11bclient" -s -vvv --skip-testrail --testbed=advanced-02
jira- wifi-2495
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "twog"
vlan = 100
dut_name = create_lanforge_chamberview_dut
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_twog, vlan_id=vlan)
print("station", station)
val = [['modes: 802.11b'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
instance_name="VLAN_RVR_11B",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.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"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_twog)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.client11g
def test_client_wpa2_personal_2g_11g(self, get_vif_state,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
"""
pytest -m "ratevsrange and vlan and client11g" -s -vvv --skip-testrail --testbed=advanced-02
jira- wifi-2496
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "twog"
vlan = 100
dut_name = create_lanforge_chamberview_dut
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_twog, vlan_id=vlan)
print("station", station)
val = [['modes: 802.11g'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
instance_name="VLAN_RVR_11G",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.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"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_twog)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.client11a
def test_client_wpa2_personal_5g_11a(self, get_vif_state,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
"""
pytest -m "ratevsrange and vlan and client11a" -s -vvv --skip-testrail --testbed=advanced-02
jira- wifi-2497
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "fiveg"
vlan = 100
dut_name = create_lanforge_chamberview_dut
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)
print("station", station)
val = [['modes: 802.11a'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
instance_name="VLAN_RVR_11A",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.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"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.client11an
def test_client_wpa2_personal_5g_11an(self, get_vif_state,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
get_configuration,lf_tools):
"""
pytest -m "ratevsrange and vlan and client11an" -s -vvv --skip-testrail --testbed=advanced-02
jira- wifi-2498
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "fiveg"
vlan = 100
dut_name = create_lanforge_chamberview_dut
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)
print("station", station)
val = [['modes: 802.11an'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
instance_name="VLAN_RVR_11AN",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.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"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
@pytest.mark.performance_advanced
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.client11ac
def test_client_wpa2_personal_5g_11ac(self, get_vif_state,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
get_configuration, lf_tools):
"""
pytest -m "ratevsrange and vlan and client11ac" -s -vvv --skip-testrail --testbed=advanced-02
jira- wifi-2499
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "fiveg"
vlan = 1
dut_name = create_lanforge_chamberview_dut
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)
print("station", station)
val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
if station:
time.sleep(3)
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
instance_name="VLAN_RVR_11AC",
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
report_name = rvr_o.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"] + "ratevsrange")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
print(str(kpi_val))
allure.attach(name="Kpi Data", body=str(kpi_val))
assert station
else:
assert False
# """
#
# Advanced Test: Rate v/s Range test under various combinations: VLAN Mode
# pytest -m "throughput_benchmark_test and vlan" -s -vvv --skip-testrail --testbed=basic-01
#
#
# """
# import os
# import time
#
# import pytest
# import allure
#
# pytestmark = [pytest.mark.ratevsrange, pytest.mark.vlan ,pytest.mark.usefixtures("setup_test_run")]
#
#
# setup_params_general = {
# "mode": "VLAN",
# "ssid_modes": {
# "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
# {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
# "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
# {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
# "security_key": "something"}],
# "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": {
# "is5GHz": {"channelBandwidth": "is20MHz"},
# "is5GHzL": {"channelBandwidth": "is20MHz"},
# "is5GHzU": {"channelBandwidth": "is20MHz"}
# },
# "radius": False
# }
#
# @allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
# @pytest.mark.parametrize(
# 'setup_profiles',
# [setup_params_general],
# indirect=True,
# scope="class"
# )
# @pytest.mark.usefixtures("setup_profiles")
# @pytest.mark.Mhz20
# class TestRatevsRangeVlan(object):
#
# @pytest.mark.wpa2_personal
# @pytest.mark.twog
# @pytest.mark.client11b
# def test_client_wpa2_personal_2g_11b(self, get_vif_state,
# lf_test, station_names_twog, create_lanforge_chamberview_dut,
# get_configuration, lf_tools):
# """
#
# pytest -m "ratevsrange and vlan and 11bclient" -s -vvv --skip-testrail --testbed=advanced-02
# jira- wifi-2495
# """
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
# ssid_name = profile_data["ssid_name"]
# security_key = profile_data["security_key"]
# security = "wpa2"
# mode = "VLAN"
# band = "twog"
# vlan = 100
# dut_name = create_lanforge_chamberview_dut
# 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_twog, vlan_id=vlan)
# print("station", station)
#
# val = [['modes: 802.11b'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
# ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
# ['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
# if station:
# time.sleep(3)
# rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
# instance_name="VLAN_RVR_11B",
# vlan_id=vlan, dut_name=dut_name, raw_lines=val)
# report_name = rvr_o.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"] + "ratevsrange")
# print("Test Completed... Cleaning up Stations")
# lf_test.Client_disconnect(station_name=station_names_twog)
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
# print(str(kpi_val))
# allure.attach(name="Kpi Data", body=str(kpi_val))
# assert station
# else:
# assert False
#
# @pytest.mark.wpa2_personal
# @pytest.mark.twog
# @pytest.mark.client11g
# def test_client_wpa2_personal_2g_11g(self, get_vif_state,
# lf_test, station_names_twog, create_lanforge_chamberview_dut,
# get_configuration, lf_tools):
# """
#
# pytest -m "ratevsrange and vlan and client11g" -s -vvv --skip-testrail --testbed=advanced-02
# jira- wifi-2496
# """
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
# ssid_name = profile_data["ssid_name"]
# security_key = profile_data["security_key"]
# security = "wpa2"
# mode = "VLAN"
# band = "twog"
# vlan = 100
# dut_name = create_lanforge_chamberview_dut
# 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_twog, vlan_id=vlan)
# print("station", station)
#
# val = [['modes: 802.11g'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
# ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
# ['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
#
# if station:
# time.sleep(3)
# rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
# instance_name="VLAN_RVR_11G",
# vlan_id=vlan, dut_name=dut_name, raw_lines=val)
# report_name = rvr_o.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"] + "ratevsrange")
# print("Test Completed... Cleaning up Stations")
# lf_test.Client_disconnect(station_name=station_names_twog)
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
# print(str(kpi_val))
# allure.attach(name="Kpi Data", body=str(kpi_val))
# assert station
# else:
# assert False
#
# @pytest.mark.wpa2_personal
# @pytest.mark.fiveg
# @pytest.mark.client11a
# def test_client_wpa2_personal_5g_11a(self, get_vif_state,
# lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
# get_configuration, lf_tools):
# """
#
# pytest -m "ratevsrange and vlan and client11a" -s -vvv --skip-testrail --testbed=advanced-02
# jira- wifi-2497
# """
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
# ssid_name = profile_data["ssid_name"]
# security_key = profile_data["security_key"]
# security = "wpa2"
# mode = "VLAN"
# band = "fiveg"
# vlan = 100
# dut_name = create_lanforge_chamberview_dut
# 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)
# print("station", station)
#
# val = [['modes: 802.11a'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
# ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
# ['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
# if station:
# time.sleep(3)
# rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
# instance_name="VLAN_RVR_11A",
# vlan_id=vlan, dut_name=dut_name, raw_lines=val)
# report_name = rvr_o.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"] + "ratevsrange")
# print("Test Completed... Cleaning up Stations")
# lf_test.Client_disconnect(station_name=station_names_fiveg)
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
# print(str(kpi_val))
# allure.attach(name="Kpi Data", body=str(kpi_val))
# assert station
# else:
# assert False
#
# @pytest.mark.wpa2_personal
# @pytest.mark.fiveg
# @pytest.mark.client11an
# def test_client_wpa2_personal_5g_11an(self, get_vif_state,
# lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
# get_configuration,lf_tools):
# """
#
# pytest -m "ratevsrange and vlan and client11an" -s -vvv --skip-testrail --testbed=advanced-02
# jira- wifi-2498
# """
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
# ssid_name = profile_data["ssid_name"]
# security_key = profile_data["security_key"]
# security = "wpa2"
# mode = "VLAN"
# band = "fiveg"
# vlan = 100
# dut_name = create_lanforge_chamberview_dut
# 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)
# print("station", station)
#
# val = [['modes: 802.11an'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
# ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
# ['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
# if station:
# time.sleep(3)
# rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
# instance_name="VLAN_RVR_11AN",
# vlan_id=vlan, dut_name=dut_name, raw_lines=val)
# report_name = rvr_o.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"] + "ratevsrange")
# print("Test Completed... Cleaning up Stations")
# lf_test.Client_disconnect(station_name=station_names_fiveg)
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
# print(str(kpi_val))
# allure.attach(name="Kpi Data", body=str(kpi_val))
# assert station
# else:
# assert False
#
# @pytest.mark.performance_advanced
# @pytest.mark.wpa2_personal
# @pytest.mark.fiveg
# @pytest.mark.client11ac
# def test_client_wpa2_personal_5g_11ac(self, get_vif_state,
# lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
# get_configuration, lf_tools):
# """
#
# pytest -m "ratevsrange and vlan and client11ac" -s -vvv --skip-testrail --testbed=advanced-02
# jira- wifi-2499
# """
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
# ssid_name = profile_data["ssid_name"]
# security_key = profile_data["security_key"]
# security = "wpa2"
# mode = "VLAN"
# band = "fiveg"
# vlan = 1
# dut_name = create_lanforge_chamberview_dut
# 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)
# print("station", station)
#
# val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
# ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
# ['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
#
# if station:
# time.sleep(3)
# rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
# instance_name="VLAN_RVR_11AC",
# vlan_id=vlan, dut_name=dut_name, raw_lines=val)
# report_name = rvr_o.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"] + "ratevsrange")
# print("Test Completed... Cleaning up Stations")
# lf_test.Client_disconnect(station_name=station_names_fiveg)
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
# print(str(kpi_val))
# allure.attach(name="Kpi Data", body=str(kpi_val))
# assert station
# else:
# assert False

View File

@@ -196,39 +196,40 @@ def setup_vlan():
@pytest.fixture(scope="class")
def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtures_ver,
def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtures_ver, skip_lf,
instantiate_profile, get_markers, create_lanforge_chamberview_dut, lf_tools,
get_security_flags, get_configuration, radius_info, get_apnos, radius_accounting_info):
lf_tools.reset_scenario()
param = dict(request.param)
if not skip_lf:
lf_tools.reset_scenario()
# VLAN Setup
if request.param["mode"] == "VLAN":
if request.param["mode"] == "VLAN":
vlan_list = list()
refactored_vlan_list = list()
ssid_modes = request.param["ssid_modes"].keys()
for mode in ssid_modes:
for ssid in range(len(request.param["ssid_modes"][mode])):
if "vlan" in request.param["ssid_modes"][mode][ssid]:
vlan_list.append(request.param["ssid_modes"][mode][ssid]["vlan"])
else:
pass
if vlan_list:
[refactored_vlan_list.append(x) for x in vlan_list if x not in refactored_vlan_list]
vlan_list = refactored_vlan_list
for i in range(len(vlan_list)):
if vlan_list[i] > 4095 or vlan_list[i] < 1:
vlan_list.pop(i)
if request.param["mode"] == "VLAN":
lf_tools.add_vlan(vlan_ids=vlan_list)
vlan_list = list()
refactored_vlan_list = list()
ssid_modes = request.param["ssid_modes"].keys()
for mode in ssid_modes:
for ssid in range(len(request.param["ssid_modes"][mode])):
if "vlan" in request.param["ssid_modes"][mode][ssid]:
vlan_list.append(request.param["ssid_modes"][mode][ssid]["vlan"])
else:
pass
if vlan_list:
[refactored_vlan_list.append(x) for x in vlan_list if x not in refactored_vlan_list]
vlan_list = refactored_vlan_list
for i in range(len(vlan_list)):
if vlan_list[i] > 4095 or vlan_list[i] < 1:
vlan_list.pop(i)
if request.param["mode"] == "VLAN":
lf_tools.add_vlan(vlan_ids=vlan_list)
# call this, if 1.x
return_var = fixtures_ver.setup_profiles(request, param, setup_controller, testbed, get_equipment_ref,
instantiate_profile,
get_markers, create_lanforge_chamberview_dut, lf_tools,
get_security_flags, get_configuration, radius_info, get_apnos,
radius_accounting_info)
radius_accounting_info, skip_lf=skip_lf)
yield return_var
@@ -257,16 +258,21 @@ def failure_tracking_fixture(request):
yield tests_failed_during_module
@pytest.fixture(scope="class")
def get_vif_state(get_apnos, get_configuration, request, lf_tools):
if request.config.getoption("1.x"):
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/", sdk="1.x")
vif_state = list(ap_ssh.get_vif_state_ssids())
vif_state.sort()
yield vif_state
else:
yield lf_tools.ssid_list
empty_get_vif_state_list = []
@pytest.fixture(scope="class")
def get_vif_state(get_apnos, get_configuration, request, lf_tools, skip_lf):
if not skip_lf:
if request.config.getoption("1.x"):
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/", sdk="1.x")
vif_state = list(ap_ssh.get_vif_state_ssids())
vif_state.sort()
yield vif_state
else:
yield lf_tools.ssid_list
else:
yield empty_get_vif_state_list
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):

View File

@@ -85,7 +85,7 @@ class Fixtures_1x:
def setup_profiles(self, request, param, setup_controller, testbed, get_equipment_ref, instantiate_profile,
get_markers, create_lanforge_chamberview_dut, lf_tools,
get_security_flags, get_configuration, radius_info, get_apnos, radius_accounting_info):
get_security_flags, get_configuration, radius_info, get_apnos, radius_accounting_info, skip_lf=False):
instantiate_profile = instantiate_profile(sdk_client=setup_controller)
vlan_id, mode = 0, 0

View File

@@ -324,7 +324,8 @@ class Fixtures_2x:
def setup_profiles(self, request, param, setup_controller, testbed, get_equipment_ref,
instantiate_profile, get_markers, create_lanforge_chamberview_dut, lf_tools,
get_security_flags, get_configuration, radius_info, get_apnos, radius_accounting_info):
get_security_flags, get_configuration, radius_info, get_apnos,
radius_accounting_info, skip_lf=False):
instantiate_profile_obj = instantiate_profile(sdk_client=setup_controller)
print(1, instantiate_profile_obj.sdk_client)
@@ -660,8 +661,9 @@ class Fixtures_2x:
]
ssid_data.append(ssid)
lf_tools.ssid_list.append(ssid_info_sdk[interface][0])
lf_tools.dut_idx_mapping = idx_mapping
lf_tools.update_ssid(ssid_data=ssid_data)
if skip_lf:
lf_tools.dut_idx_mapping = idx_mapping
lf_tools.update_ssid(ssid_data=ssid_data)
except Exception as e:
print(e)
pass