mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 11:57:49 +00:00
Wifi 3302 (#476)
* Returning Station_ip in Client_Connectivity function Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * Removed setup_profiles, create_vlan parameters Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * removed setup_profiles, create_vlan parameters, 2G radio ssids, cleanup parameter Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * Changed marker name Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * Fixed errors due to changes in library Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * changed marker name Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * changed list index value Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * created variable station_ip Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * Enabling disabled VLAN, getting station_ip from lf_test Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com>
This commit is contained in:
@@ -173,6 +173,7 @@ class RunTest:
|
||||
station_data_str = ""
|
||||
sta_url = self.staConnect.get_station_url(sta_name)
|
||||
station_info = self.staConnect.json_get(sta_url)
|
||||
self.station_ip = station_info["interface"]["ip"]
|
||||
for i in station_info["interface"]:
|
||||
try:
|
||||
station_data_str = station_data_str + i + " : " + str(station_info["interface"][i]) + "\n"
|
||||
|
||||
@@ -1,29 +1,27 @@
|
||||
"""
|
||||
Create VLAN ,connect stations and flow traffic through it : vlan Mode
|
||||
pytest -m TestVlanConfigRadioFiveg
|
||||
pytest -m test_vlan_config_5g_radio
|
||||
"""
|
||||
|
||||
import time
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.vlan, pytest.mark.multi_vlan, pytest.mark.test_vlan_config_5g_radio, pytest.mark.fiveg]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["2G"], "vlan": 100},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["5G"], "vlan": 100}],
|
||||
"open": [{"ssid_name": "ssid_open_5g", "appliedRadios": ["5G"], "vlan": 100}],
|
||||
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 125},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "something", "vlan": 125}],
|
||||
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something" , "vlan": 200},
|
||||
"wpa2_personal":[
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "something", "vlan": 200}],
|
||||
|
||||
"wpa_wpa2_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa2_p_m_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 150},
|
||||
{"ssid_name": "ssid_wpa_wpa2_p_m_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "something", "vlan": 150}],
|
||||
},
|
||||
@@ -38,13 +36,7 @@ setup_params_general = {
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.parametrize(
|
||||
"create_vlan",
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.TestVlanConfigRadioFiveg
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVlanConfigFivegRadio(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@@ -52,14 +44,14 @@ class TestVlanConfigFivegRadio(object):
|
||||
@pytest.mark.valid_client_ip_wpa_fiveg # wifi-2169
|
||||
@allure.testcase(name="test_station_ip_wpa_ssid_5g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2169")
|
||||
def test_station_ip_wpa_ssid_5g(self, setup_profiles, create_vlan, lf_test, lf_tools,
|
||||
get_vlan_list, update_report, station_names_fiveg,
|
||||
def test_station_ip_wpa_ssid_5g(self, lf_test, lf_tools,
|
||||
update_report, station_names_fiveg,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
Client connectivity using vlan, wpa, fiveg
|
||||
pytest -m valid_client_ip_wpa_fiveg
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
@@ -70,18 +62,18 @@ class TestVlanConfigFivegRadio(object):
|
||||
upstream_port = lanforge_data["upstream"]
|
||||
print("upstream_port: ",upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
vlan_list = get_vlan_list
|
||||
print(vlan_list)
|
||||
lf_test.Client_disconnect(station_names_fiveg)
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan, cleanup=False)
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
if result:
|
||||
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
station_names_fiveg[0])["interface"]["ip"]
|
||||
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
|
||||
vlan_list = list(
|
||||
map(lambda y: int(list(y.values())[0]['alias'][list(y.values())[0]['alias'].find('.') + 1:]),
|
||||
list(filter(lambda x: x if list(x.values())[0]['port type'].endswith('VLAN') else None,
|
||||
lf_tools.json_get("/port/?fields=port+type,alias")['interfaces']))))
|
||||
station_ip = lf_test.station_ip
|
||||
station_ip = station_ip.split(".")
|
||||
vlan_ip = vlan_ip.split(".")
|
||||
|
||||
@@ -108,14 +100,14 @@ class TestVlanConfigFivegRadio(object):
|
||||
@pytest.mark.valid_client_ip_wpa2_fiveg # wifi-2157
|
||||
@allure.testcase(name="test_station_ip_wpa2_ssid_5g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2157")
|
||||
def test_station_ip_wpa2_ssid_5g(self, setup_profiles, create_vlan, lf_test, lf_tools,
|
||||
def test_station_ip_wpa2_ssid_5g(self, lf_test, lf_tools,
|
||||
update_report, station_names_fiveg,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
Client connectivity using vlan, wpa2, fiveg
|
||||
pytest -m valid_client_ip_wpa2_fiveg
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
@@ -128,13 +120,12 @@ class TestVlanConfigFivegRadio(object):
|
||||
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan, cleanup=False)
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
if result:
|
||||
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
station_names_fiveg[0])["interface"]["ip"]
|
||||
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
|
||||
station_ip = lf_test.station_ip
|
||||
station_ip = station_ip.split(".")
|
||||
vlan_ip = vlan_ip.split(".")
|
||||
|
||||
@@ -157,14 +148,14 @@ class TestVlanConfigFivegRadio(object):
|
||||
@pytest.mark.disable_vlan_fiveg # wifi-2174
|
||||
@allure.testcase(name="test_disable_vlan_wpa2_ssid_5g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2174")
|
||||
def test_disable_vlan_wpa2_ssid_5g(self, setup_profiles, create_vlan, lf_test, lf_tools,
|
||||
def test_disable_vlan_wpa2_ssid_5g(self, lf_test, lf_tools,
|
||||
update_report, station_names_fiveg,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
Client connectivity using vlan, wpa2, fiveg
|
||||
pytest -m disable_vlan_fiveg
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
@@ -181,10 +172,14 @@ class TestVlanConfigFivegRadio(object):
|
||||
req_url = "cli-json/set_port"
|
||||
lf_tools.json_post(req_url, port_resources[0], port_resources[1], vlan_alias, 1, 8388608)
|
||||
down = False
|
||||
count = 0
|
||||
while not down:
|
||||
down = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["down"]
|
||||
time.sleep(1)
|
||||
count += 1
|
||||
if count == 30:
|
||||
break
|
||||
|
||||
passes = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
@@ -208,14 +203,14 @@ class TestVlanConfigFivegRadio(object):
|
||||
@pytest.mark.valid_client_ip_open_fiveg # wifi-2161
|
||||
@allure.testcase(name="test_station_ip_open_ssid_5g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2161")
|
||||
def test_station_ip_open_ssid_5g(self, setup_profiles, create_vlan, lf_test, lf_tools,
|
||||
get_vlan_list, update_report, station_names_fiveg,
|
||||
def test_station_ip_open_ssid_5g(self, lf_test, lf_tools,
|
||||
update_report, station_names_fiveg,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
Client connectivity using vlan, open, fiveg
|
||||
pytest -m valid_client_ip_open_fiveg
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][1]
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
@@ -225,18 +220,18 @@ class TestVlanConfigFivegRadio(object):
|
||||
lanforge_data = get_configuration["traffic_generator"]["details"]
|
||||
upstream_port = lanforge_data["upstream"]
|
||||
port_resources = upstream_port.split(".")
|
||||
vlan_list = get_vlan_list
|
||||
print("vlan_list", vlan_list)
|
||||
lf_test.Client_disconnect(station_names_fiveg)
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan, cleanup=False)
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
if result:
|
||||
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
station_names_fiveg[0])["interface"]["ip"]
|
||||
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
|
||||
vlan_list = list(
|
||||
map(lambda y: int(list(y.values())[0]['alias'][list(y.values())[0]['alias'].find('.') + 1:]),
|
||||
list(filter(lambda x: x if list(x.values())[0]['port type'].endswith('VLAN') else None,
|
||||
lf_tools.json_get("/port/?fields=port+type,alias")['interfaces']))))
|
||||
station_ip = lf_test.station_ip
|
||||
station_ip = station_ip.split(".")
|
||||
vlan_ip = vlan_ip.split(".")
|
||||
|
||||
@@ -263,14 +258,14 @@ class TestVlanConfigFivegRadio(object):
|
||||
@pytest.mark.test_station_ip_wpa_wpa2_ssid_5g # wifi-2167
|
||||
@allure.testcase(name="test_station_ip_wpa_wpa2_personal_ssid_5g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2167")
|
||||
def test_station_ip_wpa_wpa2_personal_ssid_5g(self, setup_profiles, create_vlan, lf_test,
|
||||
lf_tools, get_vlan_list, update_report, station_names_fiveg,
|
||||
def test_station_ip_wpa_wpa2_personal_ssid_5g(self, lf_test,
|
||||
lf_tools, update_report, station_names_fiveg,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
Client connectivity using vlan, wpa, wpa2, fiveg
|
||||
pytest -m test_station_ip_wpa_wpa2_ssid_5g
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
@@ -281,18 +276,19 @@ class TestVlanConfigFivegRadio(object):
|
||||
lanforge_data = get_configuration["traffic_generator"]["details"]
|
||||
upstream_port = lanforge_data["upstream"]
|
||||
port_resources = upstream_port.split(".")
|
||||
vlan_list = get_vlan_list
|
||||
print(vlan_list)
|
||||
lf_test.Client_disconnect(station_names_fiveg)
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan, cleanup=False)
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
if result:
|
||||
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
station_names_fiveg[0])["interface"]["ip"]
|
||||
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
vlan_list = list(
|
||||
map(lambda y: int(list(y.values())[0]['alias'][list(y.values())[0]['alias'].find('.') + 1:]),
|
||||
list(filter(lambda x: x if list(x.values())[0]['port type'].endswith('VLAN') else None,
|
||||
lf_tools.json_get("/port/?fields=port+type,alias")['interfaces']))))
|
||||
|
||||
station_ip = lf_test.station_ip
|
||||
station_ip = station_ip.split(".")
|
||||
vlan_ip = vlan_ip.split(".")
|
||||
|
||||
@@ -316,17 +312,17 @@ class TestVlanConfigFivegRadio(object):
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.valid_client_ip_wpa2_personal # wifi-2172
|
||||
@pytest.mark.enable_vlan_fiveg # wifi-2172
|
||||
@allure.testcase(name="test_station_ip_wpa2_personal_ssid_5g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2172")
|
||||
def test_station_ip_wpa2_personal_ssid_5g(self, setup_profiles, create_vlan, lf_test, lf_tools,
|
||||
get_vlan_list, update_report, station_names_fiveg,
|
||||
def test_enable_vlan_wpa2_ssid_5g(self, lf_test, lf_tools,
|
||||
update_report, station_names_fiveg,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
Client connectivity using vlan, wpa2, fiveg
|
||||
pytest -m valid_client_ip_wpa2_personal
|
||||
pytest -m enable_vlan_fiveg
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
@@ -336,18 +332,22 @@ class TestVlanConfigFivegRadio(object):
|
||||
lanforge_data = get_configuration["traffic_generator"]["details"]
|
||||
upstream_port = lanforge_data["upstream"]
|
||||
port_resources = upstream_port.split(".")
|
||||
vlan_list = get_vlan_list
|
||||
print(vlan_list)
|
||||
lf_test.Client_disconnect(station_names_fiveg)
|
||||
vlan_alias = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["alias"]
|
||||
lf_tools.json_post("cli-json/set_port", port_resources[0], port_resources[1], vlan_alias, 0, 8388610)
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan, cleanup=False)
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
if result:
|
||||
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
station_names_fiveg[0])["interface"]["ip"]
|
||||
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
vlan_list = list(
|
||||
map(lambda y: int(list(y.values())[0]['alias'][list(y.values())[0]['alias'].find('.') + 1:]),
|
||||
list(filter(lambda x: x if list(x.values())[0]['port type'].endswith('VLAN') else None,
|
||||
lf_tools.json_get("/port/?fields=port+type,alias")['interfaces']))))
|
||||
|
||||
station_ip = lf_test.station_ip
|
||||
station_ip = station_ip.split(".")
|
||||
vlan_ip = vlan_ip.split(".")
|
||||
|
||||
|
||||
@@ -1,32 +1,27 @@
|
||||
"""
|
||||
Create VLAN ,connect stations and flow traffic through it : vlan Mode
|
||||
pytest -m TestVlanConfigRadioTwog
|
||||
pytest -m test_vlan_config_2g_radio
|
||||
"""
|
||||
|
||||
import time
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.vlan, pytest.mark.multi_vlan, pytest.mark.test_vlan_config_2g_radio, pytest.mark.twog]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["2G"], "vlan": 100},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["5G"], "vlan": 100}],
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["2G"], "vlan": 100}],
|
||||
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 125},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "something", "vlan": 125}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 125}],
|
||||
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 200},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "something", "vlan": 200}],
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 200}],
|
||||
|
||||
"wpa_wpa2_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa2_p_m_2g", "appliedRadios": ["2G"], "security_key": "something",
|
||||
"vlan": 150},
|
||||
{"ssid_name": "ssid_wpa_wpa2_p_m_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "something", "vlan": 150}],
|
||||
"vlan": 150}],
|
||||
},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
@@ -39,13 +34,7 @@ setup_params_general = {
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.parametrize(
|
||||
"create_vlan",
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.TestVlanConfigRadioTwog
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVlanConfigTwogRadio(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@@ -53,8 +42,8 @@ class TestVlanConfigTwogRadio(object):
|
||||
@pytest.mark.valid_client_ip_twog_wpa
|
||||
@allure.testcase(name="test_station_ip_wpa_ssid_2g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2168")
|
||||
def test_station_ip_wpa_ssid_2g(self, setup_profiles, create_vlan, lf_test, lf_tools,
|
||||
get_vlan_list, update_report, station_names_twog,
|
||||
def test_station_ip_wpa_ssid_2g(self, lf_test, lf_tools,
|
||||
update_report, station_names_twog,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
Client connectivity using vlan, wpa, twog
|
||||
@@ -70,18 +59,17 @@ class TestVlanConfigTwogRadio(object):
|
||||
lanforge_data = get_configuration["traffic_generator"]["details"]
|
||||
upstream_port = lanforge_data["upstream"]
|
||||
port_resources = upstream_port.split(".")
|
||||
vlan_list = get_vlan_list
|
||||
print(vlan_list)
|
||||
lf_test.Client_disconnect(station_names_twog)
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan, cleanup=False)
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
if result:
|
||||
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
station_names_twog[0])["interface"]["ip"]
|
||||
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
|
||||
vlan_list = list(map(lambda y : int(list(y.values())[0]['alias'][list(y.values())[0]['alias'].find('.')+1:]),
|
||||
list(filter(lambda x: x if list(x.values())[0]['port type'].endswith('VLAN') else None
|
||||
,lf_tools.json_get("/port/?fields=port+type,alias")['interfaces']))))
|
||||
station_ip = lf_test.station_ip
|
||||
station_ip = station_ip.split(".")
|
||||
vlan_ip = vlan_ip.split(".")
|
||||
|
||||
@@ -90,7 +78,7 @@ class TestVlanConfigTwogRadio(object):
|
||||
if i != j:
|
||||
assert False
|
||||
|
||||
vlan_list = [int(i) for i in vlan_list]
|
||||
# vlan_list = [int(i) for i in vlan_list]
|
||||
if int(vlan) in vlan_list:
|
||||
print("station got IP as per VLAN. Test passed")
|
||||
assert True
|
||||
@@ -108,7 +96,7 @@ class TestVlanConfigTwogRadio(object):
|
||||
@pytest.mark.valid_client_ip_twog_wpa2 # wifi-2156
|
||||
@allure.testcase(name="test_station_ip_wpa2_ssid_2g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2156")
|
||||
def test_station_ip_wpa2_ssid_2g(self, setup_profiles, create_vlan, lf_test, lf_tools,
|
||||
def test_station_ip_wpa2_ssid_2g(self, lf_test, lf_tools,
|
||||
update_report, station_names_twog,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
@@ -128,13 +116,12 @@ class TestVlanConfigTwogRadio(object):
|
||||
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan, cleanup=False)
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
if result:
|
||||
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
station_names_twog[0])["interface"]["ip"]
|
||||
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
|
||||
station_ip = lf_test.station_ip
|
||||
station_ip = station_ip.split(".")
|
||||
vlan_ip = vlan_ip.split(".")
|
||||
|
||||
@@ -156,7 +143,7 @@ class TestVlanConfigTwogRadio(object):
|
||||
@pytest.mark.disable_vlan_twog # wifi-2158
|
||||
@allure.testcase(name="test_disable_vlan_wpa2_ssid_2g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2158")
|
||||
def test_disable_vlan_wpa2_ssid_2g(self, setup_profiles, create_vlan, lf_test, lf_tools,
|
||||
def test_disable_vlan_wpa2_ssid_2g(self, lf_test, lf_tools,
|
||||
update_report, station_names_twog,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
@@ -180,10 +167,14 @@ class TestVlanConfigTwogRadio(object):
|
||||
req_url = "cli-json/set_port"
|
||||
lf_tools.json_post(req_url, port_resources[0], port_resources[1], vlan_alias, 1, 8388608)
|
||||
down = False
|
||||
count = 0
|
||||
while not down:
|
||||
down = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["down"]
|
||||
time.sleep(1)
|
||||
count += 1
|
||||
if count == 30:
|
||||
break
|
||||
|
||||
passes = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
@@ -207,8 +198,8 @@ class TestVlanConfigTwogRadio(object):
|
||||
@pytest.mark.valid_client_ip_twog_open
|
||||
@allure.testcase(name="test_station_ip_open_ssid_2g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2160")
|
||||
def test_station_ip_open_ssid_2g(self, setup_profiles, create_vlan, lf_test, lf_tools,
|
||||
get_vlan_list, update_report, station_names_twog,
|
||||
def test_station_ip_open_ssid_2g(self, lf_test, lf_tools,
|
||||
update_report, station_names_twog,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
Client connectivity using vlan, open, twog
|
||||
@@ -224,18 +215,17 @@ class TestVlanConfigTwogRadio(object):
|
||||
lanforge_data = get_configuration["traffic_generator"]["details"]
|
||||
upstream_port = lanforge_data["upstream"]
|
||||
port_resources = upstream_port.split(".")
|
||||
vlan_list = get_vlan_list
|
||||
print(vlan_list)
|
||||
lf_test.Client_disconnect(station_names_twog)
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan, cleanup=False)
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
if result:
|
||||
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
station_names_twog[0])["interface"]["ip"]
|
||||
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
|
||||
vlan_list = list(map(lambda y: int(list(y.values())[0]['alias'][list(y.values())[0]['alias'].find('.') + 1:]),
|
||||
list(filter(lambda x: x if list(x.values())[0]['port type'].endswith('VLAN') else None,
|
||||
lf_tools.json_get("/port/?fields=port+type,alias")['interfaces']))))
|
||||
station_ip = lf_test.station_ip
|
||||
station_ip = station_ip.split(".")
|
||||
vlan_ip = vlan_ip.split(".")
|
||||
|
||||
@@ -262,8 +252,8 @@ class TestVlanConfigTwogRadio(object):
|
||||
@pytest.mark.test_station_ip_twog_wpa_wpa2
|
||||
@allure.testcase(name="test_station_ip_wpa_wpa2_personal_ssid_2g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2166")
|
||||
def test_station_ip_wpa_wpa2_personal_ssid_2g(self, setup_profiles, create_vlan, lf_test,
|
||||
lf_tools, get_vlan_list, update_report, station_names_twog,
|
||||
def test_station_ip_wpa_wpa2_personal_ssid_2g(self, lf_test,
|
||||
lf_tools, update_report, station_names_twog,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
Client connectivity using vlan, wpa, wpa2, twog
|
||||
@@ -280,18 +270,18 @@ class TestVlanConfigTwogRadio(object):
|
||||
lanforge_data = get_configuration["traffic_generator"]["details"]
|
||||
upstream_port = lanforge_data["upstream"]
|
||||
port_resources = upstream_port.split(".")
|
||||
vlan_list = get_vlan_list
|
||||
print(vlan_list)
|
||||
lf_test.Client_disconnect(station_names_twog)
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan, cleanup=False)
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
if result:
|
||||
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
station_names_twog[0])["interface"]["ip"]
|
||||
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
|
||||
vlan_list = list(
|
||||
map(lambda y: int(list(y.values())[0]['alias'][list(y.values())[0]['alias'].find('.') + 1:]),
|
||||
list(filter(lambda x: x if list(x.values())[0]['port type'].endswith('VLAN') else None,
|
||||
lf_tools.json_get("/port/?fields=port+type,alias")['interfaces']))))
|
||||
station_ip = lf_test.station_ip
|
||||
station_ip = station_ip.split(".")
|
||||
vlan_ip = vlan_ip.split(".")
|
||||
|
||||
@@ -315,15 +305,15 @@ class TestVlanConfigTwogRadio(object):
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.valid_client_ip_twog_wpa2 # wifi-2172
|
||||
@pytest.mark.enable_vlan_twog # wifi-2172
|
||||
@allure.testcase(name="test_station_ip_wpa2_personal_ssid_2g",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-2172")
|
||||
def test_station_ip_wpa2_personal_ssid_2g(self, setup_profiles, create_vlan, lf_test, lf_tools,
|
||||
get_vlan_list, update_report, station_names_twog,
|
||||
def test_enable_vlan_wpa2_ssid_2g(self, lf_test, lf_tools,
|
||||
update_report, station_names_twog,
|
||||
test_cases, get_configuration):
|
||||
"""
|
||||
Client connectivity using vlan, wpa2, twog
|
||||
pytest -m valid_client_ip_twog_wpa2
|
||||
pytest -m enable_vlan_twog
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
@@ -335,18 +325,22 @@ class TestVlanConfigTwogRadio(object):
|
||||
lanforge_data = get_configuration["traffic_generator"]["details"]
|
||||
upstream_port = lanforge_data["upstream"]
|
||||
port_resources = upstream_port.split(".")
|
||||
vlan_list = get_vlan_list
|
||||
print(vlan_list)
|
||||
lf_test.Client_disconnect(station_names_twog)
|
||||
vlan_alias = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["alias"]
|
||||
lf_tools.json_post("cli-json/set_port", port_resources[0], port_resources[1], vlan_alias, 0, 8388610)
|
||||
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan, cleanup=False)
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
if result:
|
||||
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
station_names_twog[0])["interface"]["ip"]
|
||||
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
|
||||
port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
|
||||
vlan_list = list(
|
||||
map(lambda y: int(list(y.values())[0]['alias'][list(y.values())[0]['alias'].find('.') + 1:]),
|
||||
list(filter(lambda x: x if list(x.values())[0]['port type'].endswith('VLAN') else None,
|
||||
lf_tools.json_get("/port/?fields=port+type,alias")['interfaces']))))
|
||||
station_ip = lf_test.station_ip
|
||||
station_ip = station_ip.split(".")
|
||||
vlan_ip = vlan_ip.split(".")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user