mirror of
				https://github.com/Telecominfraproject/wlan-testing.git
				synced 2025-11-03 04:18:15 +00:00 
			
		
		
		
	ucentral vlan config fix
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
		@@ -243,6 +243,22 @@ class UProfileUtility:
 | 
			
		||||
            del self.base_profile_config['interfaces'][1]
 | 
			
		||||
            self.base_profile_config['interfaces'][0]['ssids'] = []
 | 
			
		||||
            self.base_profile_config['interfaces'] = []
 | 
			
		||||
            wan_section_vlan = {
 | 
			
		||||
                "name": "WAN",
 | 
			
		||||
                "role": "upstream",
 | 
			
		||||
                "services": ["lldp"],
 | 
			
		||||
                "ethernet": [
 | 
			
		||||
                    {
 | 
			
		||||
                        "select-ports": [
 | 
			
		||||
                            "WAN*"
 | 
			
		||||
                        ]
 | 
			
		||||
                    }
 | 
			
		||||
                ],
 | 
			
		||||
                "ipv4": {
 | 
			
		||||
                    "addressing": "dynamic"
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            self.base_profile_config['interfaces'].append(wan_section_vlan)
 | 
			
		||||
        else:
 | 
			
		||||
            print("Invalid Mode")
 | 
			
		||||
            return 0
 | 
			
		||||
@@ -310,10 +326,6 @@ class UProfileUtility:
 | 
			
		||||
                self.base_profile_config['interfaces'].append(vlan_section)
 | 
			
		||||
                print(vlan_section)
 | 
			
		||||
                vsection = 0
 | 
			
		||||
            # Add to the ssid section
 | 
			
		||||
            # print(self.base_profile_config)
 | 
			
		||||
            # self.base_profile_config['interfaces'][vsection]['vlan'] = {'id': int(vid)}
 | 
			
		||||
            # self.base_profile_config['interfaces'][vsection]['ssids'].append(ssid_info)
 | 
			
		||||
        else:
 | 
			
		||||
            print("invalid mode")
 | 
			
		||||
            pytest.exit("invalid Operating Mode")
 | 
			
		||||
@@ -328,17 +340,24 @@ class UProfileUtility:
 | 
			
		||||
                             verify=False, timeout=100)
 | 
			
		||||
        self.sdk_client.check_response("POST", resp, self.sdk_client.make_headers(), basic_cfg_str, uri)
 | 
			
		||||
        print(resp.url)
 | 
			
		||||
        # resp.close()()
 | 
			
		||||
        resp.close()()
 | 
			
		||||
        print(resp)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# controller = {
 | 
			
		||||
#     'url': 'https://sec-ucentral-qa01.cicd.lab.wlan.tip.build:16001',  # API base url for the controller
 | 
			
		||||
#     'username': "tip@ucentral.com",
 | 
			
		||||
#     'password': 'openwifi',
 | 
			
		||||
# }
 | 
			
		||||
# obj = UController(controller_data=controller)
 | 
			
		||||
#
 | 
			
		||||
# print(obj.get_devices())
 | 
			
		||||
#
 | 
			
		||||
# obj.logout()
 | 
			
		||||
if __name__ == '__main__':
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    controller = {
 | 
			
		||||
    'url': 'https://sec-ucentral-qa01.cicd.lab.wlan.tip.build:16001',  # API base url for the controller
 | 
			
		||||
    'username': "tip@ucentral.com",
 | 
			
		||||
    'password': 'openwifi',
 | 
			
		||||
    }
 | 
			
		||||
    obj = UController(controller_data=controller)
 | 
			
		||||
    profile = UProfileUtility(sdk_client=obj)
 | 
			
		||||
    profile.set_mode(mode="VLAN")
 | 
			
		||||
    profile.set_radio_config()
 | 
			
		||||
    ssid = {"ssid_name": "ssid_wpa2_2g_nat", "appliedRadios": ["2G"], "security": "psk", "security_key": "something", "vlan": 100}
 | 
			
		||||
    profile.add_ssid(ssid_data=ssid)
 | 
			
		||||
    # profile.push_config(serial_number="903cb39d6918")
 | 
			
		||||
    # print(obj.get_devices())
 | 
			
		||||
    obj.logout()
 | 
			
		||||
 
 | 
			
		||||
@@ -278,7 +278,6 @@ def setup_controller(request, get_configuration, test_access_point):
 | 
			
		||||
 | 
			
		||||
            request.addfinalizer(teardown_ucontroller)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
        print(e)
 | 
			
		||||
        allure.attach(body=str(e), name="Controller Instantiation Failed: ")
 | 
			
		||||
@@ -290,44 +289,56 @@ def setup_controller(request, get_configuration, test_access_point):
 | 
			
		||||
@pytest.fixture(scope="session")
 | 
			
		||||
def instantiate_firmware(request, setup_controller, get_configuration):
 | 
			
		||||
    """sets up firmware utility and yields the object for firmware upgrade"""
 | 
			
		||||
    firmware_client_obj = []
 | 
			
		||||
    if request.config.getoption("--1.x"):
 | 
			
		||||
        firmware_client_obj = []
 | 
			
		||||
 | 
			
		||||
    for access_point_info in get_configuration['access_point']:
 | 
			
		||||
        version = access_point_info["version"]
 | 
			
		||||
        if request.config.getini("build").__contains__("https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/"):
 | 
			
		||||
            version = request.config.getini("build")
 | 
			
		||||
        firmware_client = FirmwareUtility(sdk_client=setup_controller,
 | 
			
		||||
                                          model=access_point_info["model"],
 | 
			
		||||
                                          version_url=version)
 | 
			
		||||
        firmware_client_obj.append(firmware_client)
 | 
			
		||||
    yield firmware_client_obj
 | 
			
		||||
        for access_point_info in get_configuration['access_point']:
 | 
			
		||||
            version = access_point_info["version"]
 | 
			
		||||
            if request.config.getini("build").__contains__("https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/"):
 | 
			
		||||
                version = request.config.getini("build")
 | 
			
		||||
            firmware_client = FirmwareUtility(sdk_client=setup_controller,
 | 
			
		||||
                                              model=access_point_info["model"],
 | 
			
		||||
                                              version_url=version)
 | 
			
		||||
            firmware_client_obj.append(firmware_client)
 | 
			
		||||
        yield firmware_client_obj
 | 
			
		||||
    else:
 | 
			
		||||
        # 2.x
 | 
			
		||||
        pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.fixture(scope="session")
 | 
			
		||||
def get_latest_firmware(instantiate_firmware):
 | 
			
		||||
def get_latest_firmware(request, instantiate_firmware):
 | 
			
		||||
    """yields the list of firmware version"""
 | 
			
		||||
    fw_version_list = []
 | 
			
		||||
    try:
 | 
			
		||||
 | 
			
		||||
        for fw_obj in instantiate_firmware:
 | 
			
		||||
            latest_firmware = fw_obj.get_fw_version()
 | 
			
		||||
            latest_firmware = latest_firmware.replace(".tar.gz", "")
 | 
			
		||||
            fw_version_list.append(latest_firmware)
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
        print(e)
 | 
			
		||||
    if request.config.getoption("--1.x"):
 | 
			
		||||
        fw_version_list = []
 | 
			
		||||
        try:
 | 
			
		||||
 | 
			
		||||
    yield fw_version_list
 | 
			
		||||
            for fw_obj in instantiate_firmware:
 | 
			
		||||
                latest_firmware = fw_obj.get_fw_version()
 | 
			
		||||
                latest_firmware = latest_firmware.replace(".tar.gz", "")
 | 
			
		||||
                fw_version_list.append(latest_firmware)
 | 
			
		||||
        except Exception as e:
 | 
			
		||||
            print(e)
 | 
			
		||||
            fw_version_list = []
 | 
			
		||||
 | 
			
		||||
        yield fw_version_list
 | 
			
		||||
    else:
 | 
			
		||||
        # 2.x
 | 
			
		||||
        pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.fixture(scope="session")
 | 
			
		||||
def upload_firmware(should_upload_firmware, instantiate_firmware):
 | 
			
		||||
def upload_firmware(request, should_upload_firmware, instantiate_firmware):
 | 
			
		||||
    """yields the firmware_id that is uploaded to cloud"""
 | 
			
		||||
    firmware_id_list = []
 | 
			
		||||
    for i in range(0, len(instantiate_firmware)):
 | 
			
		||||
        firmware_id = instantiate_firmware[i].upload_fw_on_cloud(force_upload=should_upload_firmware)
 | 
			
		||||
        firmware_id_list.append(firmware_id)
 | 
			
		||||
    yield firmware_id_list
 | 
			
		||||
    if request.config.getoption("--1.x"):
 | 
			
		||||
        firmware_id_list = []
 | 
			
		||||
        for i in range(0, len(instantiate_firmware)):
 | 
			
		||||
            firmware_id = instantiate_firmware[i].upload_fw_on_cloud(force_upload=should_upload_firmware)
 | 
			
		||||
            firmware_id_list.append(firmware_id)
 | 
			
		||||
        yield firmware_id_list
 | 
			
		||||
    else:
 | 
			
		||||
        # 2.x release
 | 
			
		||||
        yield True
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.fixture(scope="session")
 | 
			
		||||
@@ -335,85 +346,101 @@ def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_f
 | 
			
		||||
                     should_upgrade_firmware, should_upload_firmware, get_apnos, get_configuration):
 | 
			
		||||
    """yields the status of upgrade of firmware. waits for 300 sec after each upgrade request"""
 | 
			
		||||
    print(should_upgrade_firmware, should_upload_firmware)
 | 
			
		||||
    status_list = []
 | 
			
		||||
    active_fw_list = []
 | 
			
		||||
    try:
 | 
			
		||||
        for access_point in get_configuration['access_point']:
 | 
			
		||||
            ap_ssh = get_apnos(access_point)
 | 
			
		||||
            active_fw = ap_ssh.get_active_firmware()
 | 
			
		||||
            active_fw_list.append(active_fw)
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
        print(e)
 | 
			
		||||
    if request.config.getoption("--1.x"):
 | 
			
		||||
        status_list = []
 | 
			
		||||
        active_fw_list = []
 | 
			
		||||
    print(active_fw_list, get_latest_firmware)
 | 
			
		||||
    if get_latest_firmware != active_fw_list:
 | 
			
		||||
        if request.config.getoption("--skip-upgrade"):
 | 
			
		||||
            status = "skip-upgrade"
 | 
			
		||||
            status_list.append(status)
 | 
			
		||||
        else:
 | 
			
		||||
 | 
			
		||||
            for i in range(0, len(instantiate_firmware)):
 | 
			
		||||
                status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i], force_upload=True,
 | 
			
		||||
                                                            force_upgrade=should_upgrade_firmware)
 | 
			
		||||
                allure.attach(name="Firmware Upgrade Request", body=str(status))
 | 
			
		||||
        try:
 | 
			
		||||
            for access_point in get_configuration['access_point']:
 | 
			
		||||
                ap_ssh = get_apnos(access_point)
 | 
			
		||||
                active_fw = ap_ssh.get_active_firmware()
 | 
			
		||||
                active_fw_list.append(active_fw)
 | 
			
		||||
        except Exception as e:
 | 
			
		||||
            print(e)
 | 
			
		||||
            active_fw_list = []
 | 
			
		||||
        print(active_fw_list, get_latest_firmware)
 | 
			
		||||
        if get_latest_firmware != active_fw_list:
 | 
			
		||||
            if request.config.getoption("--skip-upgrade"):
 | 
			
		||||
                status = "skip-upgrade"
 | 
			
		||||
                status_list.append(status)
 | 
			
		||||
            else:
 | 
			
		||||
 | 
			
		||||
                for i in range(0, len(instantiate_firmware)):
 | 
			
		||||
                    status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i], force_upload=True,
 | 
			
		||||
                                                                force_upgrade=should_upgrade_firmware)
 | 
			
		||||
                    allure.attach(name="Firmware Upgrade Request", body=str(status))
 | 
			
		||||
                    status_list.append(status)
 | 
			
		||||
        else:
 | 
			
		||||
            if should_upgrade_firmware:
 | 
			
		||||
                for i in range(0, len(instantiate_firmware)):
 | 
			
		||||
                    status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i],
 | 
			
		||||
                                                                force_upload=should_upload_firmware,
 | 
			
		||||
                                                                force_upgrade=should_upgrade_firmware)
 | 
			
		||||
                    allure.attach(name="Firmware Upgrade Request", body=str(status))
 | 
			
		||||
                    status_list.append(status)
 | 
			
		||||
            else:
 | 
			
		||||
                status = "skip-upgrade Version Already Available"
 | 
			
		||||
                status_list.append(status)
 | 
			
		||||
        yield status_list
 | 
			
		||||
    else:
 | 
			
		||||
        if should_upgrade_firmware:
 | 
			
		||||
            for i in range(0, len(instantiate_firmware)):
 | 
			
		||||
                status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i],
 | 
			
		||||
                                                            force_upload=should_upload_firmware,
 | 
			
		||||
                                                            force_upgrade=should_upgrade_firmware)
 | 
			
		||||
                allure.attach(name="Firmware Upgrade Request", body=str(status))
 | 
			
		||||
                status_list.append(status)
 | 
			
		||||
        else:
 | 
			
		||||
            status = "skip-upgrade Version Already Available"
 | 
			
		||||
            status_list.append(status)
 | 
			
		||||
    yield status_list
 | 
			
		||||
        # 2.x release
 | 
			
		||||
        pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.fixture(scope="session")
 | 
			
		||||
def check_ap_firmware_cloud(setup_controller, get_equipment_id):
 | 
			
		||||
def check_ap_firmware_cloud(request, setup_controller, get_equipment_id):
 | 
			
		||||
    """yields the active version of firmware on cloud"""
 | 
			
		||||
    ap_fw_list = []
 | 
			
		||||
    for i in get_equipment_id:
 | 
			
		||||
        ap_fw_list.append(setup_controller.get_ap_firmware_old_method(equipment_id=i))
 | 
			
		||||
    yield ap_fw_list
 | 
			
		||||
    if request.config.getoption("--1.x"):
 | 
			
		||||
        ap_fw_list = []
 | 
			
		||||
        for i in get_equipment_id:
 | 
			
		||||
            ap_fw_list.append(setup_controller.get_ap_firmware_old_method(equipment_id=i))
 | 
			
		||||
        yield ap_fw_list
 | 
			
		||||
    else:
 | 
			
		||||
        # 2.x
 | 
			
		||||
        pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.fixture(scope="session")
 | 
			
		||||
def check_ap_firmware_ssh(get_configuration):
 | 
			
		||||
def check_ap_firmware_ssh(get_configuration, request):
 | 
			
		||||
    """yields the active version of firmware on ap"""
 | 
			
		||||
    active_fw_list = []
 | 
			
		||||
    try:
 | 
			
		||||
        for access_point in get_configuration['access_point']:
 | 
			
		||||
            ap_ssh = APNOS(access_point)
 | 
			
		||||
            active_fw = ap_ssh.get_active_firmware()
 | 
			
		||||
            active_fw_list.append(active_fw)
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
        print(e)
 | 
			
		||||
    if request.config.getoption("--1.x"):
 | 
			
		||||
        active_fw_list = []
 | 
			
		||||
    yield active_fw_list
 | 
			
		||||
        try:
 | 
			
		||||
            for access_point in get_configuration['access_point']:
 | 
			
		||||
                ap_ssh = APNOS(access_point)
 | 
			
		||||
                active_fw = ap_ssh.get_active_firmware()
 | 
			
		||||
                active_fw_list.append(active_fw)
 | 
			
		||||
        except Exception as e:
 | 
			
		||||
            print(e)
 | 
			
		||||
            active_fw_list = []
 | 
			
		||||
        yield active_fw_list
 | 
			
		||||
    else:
 | 
			
		||||
        # 2.x
 | 
			
		||||
        pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.fixture(scope="session")
 | 
			
		||||
def setup_test_run(setup_controller, upgrade_firmware, get_configuration, get_equipment_id, get_latest_firmware,
 | 
			
		||||
def setup_test_run(setup_controller, request, upgrade_firmware, get_configuration,
 | 
			
		||||
                   get_equipment_id, get_latest_firmware,
 | 
			
		||||
                   get_apnos):
 | 
			
		||||
    """used to upgrade the firmware on AP and should be called on each test case on a module level"""
 | 
			
		||||
 | 
			
		||||
    active_fw_list = []
 | 
			
		||||
    try:
 | 
			
		||||
        for access_point in get_configuration['access_point']:
 | 
			
		||||
            ap_ssh = get_apnos(access_point)
 | 
			
		||||
            active_fw = ap_ssh.get_active_firmware()
 | 
			
		||||
            active_fw_list.append(active_fw)
 | 
			
		||||
    except Exception as e:
 | 
			
		||||
        print(e)
 | 
			
		||||
    if request.config.getoption("--1.x"):
 | 
			
		||||
        active_fw_list = []
 | 
			
		||||
    print(active_fw_list, get_latest_firmware)
 | 
			
		||||
    if active_fw_list == get_latest_firmware:
 | 
			
		||||
        yield True
 | 
			
		||||
        try:
 | 
			
		||||
            for access_point in get_configuration['access_point']:
 | 
			
		||||
                ap_ssh = get_apnos(access_point)
 | 
			
		||||
                active_fw = ap_ssh.get_active_firmware()
 | 
			
		||||
                active_fw_list.append(active_fw)
 | 
			
		||||
        except Exception as e:
 | 
			
		||||
            print(e)
 | 
			
		||||
            active_fw_list = []
 | 
			
		||||
        print(active_fw_list, get_latest_firmware)
 | 
			
		||||
        if active_fw_list == get_latest_firmware:
 | 
			
		||||
            yield True
 | 
			
		||||
        else:
 | 
			
		||||
            pytest.exit("AP is not Upgraded tp Target Firmware versions")
 | 
			
		||||
    else:
 | 
			
		||||
        pytest.exit("AP is not Upgraded tp Target Firmware versions")
 | 
			
		||||
        # 2.x
 | 
			
		||||
        pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
@@ -565,11 +592,12 @@ def create_lanforge_chamberview_dut(get_configuration, testbed):
 | 
			
		||||
                testbed=testbed, access_point_data=get_configuration["access_point"])
 | 
			
		||||
    yield True
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.fixture(scope="session")
 | 
			
		||||
def lf_tools(get_configuration, testbed):
 | 
			
		||||
    """ Create a DUT on LANforge"""
 | 
			
		||||
    obj = ChamberView(lanforge_data=get_configuration["traffic_generator"]["details"],
 | 
			
		||||
                testbed=testbed, access_point_data=get_configuration["access_point"])
 | 
			
		||||
                      testbed=testbed, access_point_data=get_configuration["access_point"])
 | 
			
		||||
 | 
			
		||||
    yield obj
 | 
			
		||||
 | 
			
		||||
@@ -601,6 +629,7 @@ def setup_influx(request, testbed, get_configuration):
 | 
			
		||||
    }
 | 
			
		||||
    yield influx_params
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Need for Perforce Mobile Device Execution
 | 
			
		||||
def pytest_sessionstart(session):
 | 
			
		||||
    session.results = dict()
 | 
			
		||||
@@ -14,9 +14,9 @@ pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.g
 | 
			
		||||
setup_params_general = {
 | 
			
		||||
    "mode": "BRIDGE",
 | 
			
		||||
    "ssid_modes": {
 | 
			
		||||
        "open": [{"ssid_name": "ssid_open_2g_br", "appliedRadios": ["2G"], "security_key": "something", },
 | 
			
		||||
        "open": [{"ssid_name": "ssid_open_2g_br", "appliedRadios": ["2G"], "security_key": "something" },
 | 
			
		||||
                 {"ssid_name": "ssid_open_5g_br", "appliedRadios": ["5G"],
 | 
			
		||||
                  "security_key": "something", }],
 | 
			
		||||
                  "security_key": "something" }],
 | 
			
		||||
        "wpa": [{"ssid_name": "ssid_wpa_2g_br", "appliedRadios": ["2G"], "security_key": "something"},
 | 
			
		||||
                {"ssid_name": "ssid_wpa_5g_br", "appliedRadios": ["5G"],
 | 
			
		||||
                 "security_key": "something"}],
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat, pytest.mark.gene
 | 
			
		||||
setup_params_general = {
 | 
			
		||||
    "mode": "NAT",
 | 
			
		||||
    "ssid_modes": {
 | 
			
		||||
        "open": [{"ssid_name": "ssid_shivam", "appliedRadios": ["2G"], "security_key": "something"},
 | 
			
		||||
        "open": [{"ssid_name": "ssid_open_2g_nat", "appliedRadios": ["2G"], "security_key": "something"},
 | 
			
		||||
                 {"ssid_name": "ssid_open_5g_nat", "appliedRadios": ["5G"],
 | 
			
		||||
                  "security_key": "something"}],
 | 
			
		||||
        "wpa": [{"ssid_name": "ssid_wpa_2g_nat", "appliedRadios": ["2G"], "security_key": "something"},
 | 
			
		||||
@@ -71,7 +71,6 @@ class TestNATModeConnectivitySuiteA(object):
 | 
			
		||||
                                                     passkey=security_key, mode=mode, band=band,
 | 
			
		||||
                                                     station_name=station_names_twog, vlan_id=vlan)
 | 
			
		||||
 | 
			
		||||
       
 | 
			
		||||
        assert result
 | 
			
		||||
 | 
			
		||||
    @pytest.mark.open
 | 
			
		||||
@@ -80,7 +79,7 @@ class TestNATModeConnectivitySuiteA(object):
 | 
			
		||||
    def test_open_ssid_5g(self, get_vif_state, get_lanforge_data, lf_test, test_cases, station_names_fiveg,
 | 
			
		||||
                          update_report):
 | 
			
		||||
        """Client Connectivity open ssid 5G
 | 
			
		||||
           pytest -m "client_connectivity and bridge and general and open and fiveg"
 | 
			
		||||
           pytest -m "client_connectivity and NAT and general and open and fiveg"
 | 
			
		||||
        """
 | 
			
		||||
        profile_data = setup_params_general["ssid_modes"]["open"][1]
 | 
			
		||||
        ssid_name = profile_data["ssid_name"]
 | 
			
		||||
@@ -97,7 +96,6 @@ class TestNATModeConnectivitySuiteA(object):
 | 
			
		||||
                                                     passkey=security_key, mode=mode, band=band,
 | 
			
		||||
                                                     station_name=station_names_fiveg, vlan_id=vlan)
 | 
			
		||||
 | 
			
		||||
       
 | 
			
		||||
        assert result
 | 
			
		||||
 | 
			
		||||
    @pytest.mark.sanity_light
 | 
			
		||||
@@ -107,7 +105,7 @@ class TestNATModeConnectivitySuiteA(object):
 | 
			
		||||
    def test_wpa_ssid_2g(self, get_vif_state, get_lanforge_data, update_report,
 | 
			
		||||
                         lf_test, test_cases, station_names_twog):
 | 
			
		||||
        """Client Connectivity wpa ssid 2.4G
 | 
			
		||||
           pytest -m "client_connectivity and bridge and general and wpa and twog"
 | 
			
		||||
           pytest -m "client_connectivity and NAT and general and wpa and twog"
 | 
			
		||||
        """
 | 
			
		||||
        profile_data = setup_params_general["ssid_modes"]["wpa"][0]
 | 
			
		||||
        ssid_name = profile_data["ssid_name"]
 | 
			
		||||
@@ -124,7 +122,6 @@ class TestNATModeConnectivitySuiteA(object):
 | 
			
		||||
                                                     passkey=security_key, mode=mode, band=band,
 | 
			
		||||
                                                     station_name=station_names_twog, vlan_id=vlan)
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        assert result
 | 
			
		||||
 | 
			
		||||
    @pytest.mark.sanity_light
 | 
			
		||||
@@ -134,7 +131,7 @@ class TestNATModeConnectivitySuiteA(object):
 | 
			
		||||
    def test_wpa_ssid_5g(self, get_vif_state, lf_test, update_report, test_cases, station_names_fiveg,
 | 
			
		||||
                         get_lanforge_data):
 | 
			
		||||
        """Client Connectivity wpa ssid 5G
 | 
			
		||||
           pytest -m "client_connectivity and bridge and general and wpa and fiveg"
 | 
			
		||||
           pytest -m "client_connectivity and NAT and general and wpa and fiveg"
 | 
			
		||||
        """
 | 
			
		||||
        profile_data = setup_params_general["ssid_modes"]["wpa"][1]
 | 
			
		||||
        ssid_name = profile_data["ssid_name"]
 | 
			
		||||
@@ -151,7 +148,6 @@ class TestNATModeConnectivitySuiteA(object):
 | 
			
		||||
                                                     passkey=security_key, mode=mode, band=band,
 | 
			
		||||
                                                     station_name=station_names_fiveg, vlan_id=vlan)
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        assert result
 | 
			
		||||
 | 
			
		||||
    @pytest.mark.sanity_light
 | 
			
		||||
@@ -161,7 +157,7 @@ class TestNATModeConnectivitySuiteA(object):
 | 
			
		||||
    def test_wpa2_personal_ssid_2g(self, get_vif_state, get_lanforge_data, lf_test, update_report, test_cases,
 | 
			
		||||
                                   station_names_twog):
 | 
			
		||||
        """Client Connectivity wpa2_personal ssid 2.4G
 | 
			
		||||
           pytest -m "client_connectivity and bridge and general and wpa2_personal and twog"
 | 
			
		||||
           pytest -m "client_connectivity and NAT and general and wpa2_personal and twog"
 | 
			
		||||
        """
 | 
			
		||||
        profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
 | 
			
		||||
        ssid_name = profile_data["ssid_name"]
 | 
			
		||||
@@ -178,7 +174,6 @@ class TestNATModeConnectivitySuiteA(object):
 | 
			
		||||
                                                     passkey=security_key, mode=mode, band=band,
 | 
			
		||||
                                                     station_name=station_names_twog, vlan_id=vlan)
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        assert result
 | 
			
		||||
 | 
			
		||||
    @pytest.mark.sanity_light
 | 
			
		||||
@@ -189,7 +184,7 @@ class TestNATModeConnectivitySuiteA(object):
 | 
			
		||||
                                   station_names_fiveg,
 | 
			
		||||
                                   lf_test):
 | 
			
		||||
        """Client Connectivity wpa2_personal ssid 5G
 | 
			
		||||
           pytest -m "client_connectivity and bridge and general and wpa2_personal and fiveg"
 | 
			
		||||
           pytest -m "client_connectivity and NAT and general and wpa2_personal and fiveg"
 | 
			
		||||
        """
 | 
			
		||||
        profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
 | 
			
		||||
        ssid_name = profile_data["ssid_name"]
 | 
			
		||||
@@ -206,12 +201,11 @@ class TestNATModeConnectivitySuiteA(object):
 | 
			
		||||
                                                     passkey=security_key, mode=mode, band=band,
 | 
			
		||||
                                                     station_name=station_names_fiveg, vlan_id=vlan)
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        assert result
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
setup_params_general_two = {
 | 
			
		||||
    "mode": "BRIDGE",
 | 
			
		||||
    "mode": "NAT",
 | 
			
		||||
    "ssid_modes": {
 | 
			
		||||
        "wpa3_personal": [
 | 
			
		||||
            {"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["2G"], "security_key": "something"},
 | 
			
		||||
@@ -232,7 +226,7 @@ setup_params_general_two = {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@pytest.mark.suiteB
 | 
			
		||||
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
 | 
			
		||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
 | 
			
		||||
@pytest.mark.parametrize(
 | 
			
		||||
    'setup_profiles',
 | 
			
		||||
    [setup_params_general_two],
 | 
			
		||||
@@ -240,9 +234,9 @@ setup_params_general_two = {
 | 
			
		||||
    scope="class"
 | 
			
		||||
)
 | 
			
		||||
@pytest.mark.usefixtures("setup_profiles")
 | 
			
		||||
class TestBridgeModeConnectivitySuiteB(object):
 | 
			
		||||
class TestNATModeConnectivitySuiteB(object):
 | 
			
		||||
    """ Client Connectivity SuiteA
 | 
			
		||||
        pytest -m "client_connectivity and bridge and suiteB"
 | 
			
		||||
        pytest -m "client_connectivity and NAT and suiteB"
 | 
			
		||||
    """
 | 
			
		||||
 | 
			
		||||
    @pytest.mark.uc_sanity
 | 
			
		||||
@@ -253,7 +247,7 @@ class TestBridgeModeConnectivitySuiteB(object):
 | 
			
		||||
                                   update_report,
 | 
			
		||||
                                   test_cases):
 | 
			
		||||
        """Client Connectivity open ssid 2.4G
 | 
			
		||||
           pytest -m "client_connectivity and bridge and general and wpa3_personal and twog"
 | 
			
		||||
           pytest -m "client_connectivity and NAT and general and wpa3_personal and twog"
 | 
			
		||||
        """
 | 
			
		||||
        profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0]
 | 
			
		||||
        ssid_name = profile_data["ssid_name"]
 | 
			
		||||
@@ -279,7 +273,7 @@ class TestBridgeModeConnectivitySuiteB(object):
 | 
			
		||||
    def test_wpa3_personal_ssid_5g(self, get_vif_state, station_names_fiveg, get_lanforge_data, lf_test, test_cases,
 | 
			
		||||
                                   update_report):
 | 
			
		||||
        """Client Connectivity open ssid 2.4G
 | 
			
		||||
           pytest -m "client_connectivity and bridge and general and wpa3_personal and fiveg"
 | 
			
		||||
           pytest -m "client_connectivity and NAT and general and wpa3_personal and fiveg"
 | 
			
		||||
        """
 | 
			
		||||
        profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1]
 | 
			
		||||
        ssid_name = profile_data["ssid_name"]
 | 
			
		||||
@@ -307,7 +301,7 @@ class TestBridgeModeConnectivitySuiteB(object):
 | 
			
		||||
                                         update_report,
 | 
			
		||||
                                         test_cases):
 | 
			
		||||
        """Client Connectivity open ssid 2.4G
 | 
			
		||||
           pytest -m "client_connectivity and bridge and general and wpa3_personal_mixed and twog"
 | 
			
		||||
           pytest -m "client_connectivity and NAT and general and wpa3_personal_mixed and twog"
 | 
			
		||||
        """
 | 
			
		||||
        profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0]
 | 
			
		||||
        ssid_name = profile_data["ssid_name"]
 | 
			
		||||
@@ -334,7 +328,7 @@ class TestBridgeModeConnectivitySuiteB(object):
 | 
			
		||||
                                         test_cases,
 | 
			
		||||
                                         update_report):
 | 
			
		||||
        """Client Connectivity open ssid 2.4G
 | 
			
		||||
           pytest -m "client_connectivity and bridge and general and wpa3_personal_mixed and fiveg"
 | 
			
		||||
           pytest -m "client_connectivity and NAT and general and wpa3_personal_mixed and fiveg"
 | 
			
		||||
        """
 | 
			
		||||
        profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1]
 | 
			
		||||
        ssid_name = profile_data["ssid_name"]
 | 
			
		||||
@@ -362,7 +356,7 @@ class TestBridgeModeConnectivitySuiteB(object):
 | 
			
		||||
                                       update_report,
 | 
			
		||||
                                       test_cases):
 | 
			
		||||
        """Client Connectivity open ssid 2.4G
 | 
			
		||||
           pytest -m "client_connectivity and bridge and general and wpa_wpa2_personal_mixed and twog"
 | 
			
		||||
           pytest -m "client_connectivity and NAT and general and wpa_wpa2_personal_mixed and twog"
 | 
			
		||||
        """
 | 
			
		||||
        profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
 | 
			
		||||
        ssid_name = profile_data["ssid_name"]
 | 
			
		||||
@@ -389,7 +383,7 @@ class TestBridgeModeConnectivitySuiteB(object):
 | 
			
		||||
    def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, station_names_fiveg, get_lanforge_data, lf_test, test_cases,
 | 
			
		||||
                                       update_report):
 | 
			
		||||
        """Client Connectivity open ssid 2.4G
 | 
			
		||||
           pytest -m "client_connectivity and bridge and general and wpa_wpa2_personal_mixed and fiveg"
 | 
			
		||||
           pytest -m "client_connectivity and NAT and general and wpa_wpa2_personal_mixed and fiveg"
 | 
			
		||||
        """
 | 
			
		||||
        profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
 | 
			
		||||
        ssid_name = profile_data["ssid_name"]
 | 
			
		||||
@@ -411,7 +405,7 @@ class TestBridgeModeConnectivitySuiteB(object):
 | 
			
		||||
 | 
			
		||||
# WEP Security Feature not available
 | 
			
		||||
# setup_params_wep = {
 | 
			
		||||
#     "mode": "BRIDGE",
 | 
			
		||||
#     "mode": "NAT",
 | 
			
		||||
#     "ssid_modes": {
 | 
			
		||||
#         "wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["2G"], "default_key_id": 1,
 | 
			
		||||
#                   "wep_key": 1234567890},
 | 
			
		||||
@@ -431,7 +425,7 @@ class TestBridgeModeConnectivitySuiteB(object):
 | 
			
		||||
#     scope="class"
 | 
			
		||||
# )
 | 
			
		||||
# @pytest.mark.usefixtures("setup_profiles")
 | 
			
		||||
# class TestBridgeModeWEP(object):
 | 
			
		||||
# class TestNATModeWEP(object):
 | 
			
		||||
#
 | 
			
		||||
#     @pytest.mark.wep
 | 
			
		||||
#     @pytest.mark.twog
 | 
			
		||||
@@ -452,12 +446,12 @@ class TestBridgeModeConnectivitySuiteB(object):
 | 
			
		||||
#         if passes:
 | 
			
		||||
#             update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
 | 
			
		||||
#                                           status_id=1,
 | 
			
		||||
#                                           msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
			
		||||
#                                           msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
 | 
			
		||||
#                                               passes))
 | 
			
		||||
#         else:
 | 
			
		||||
#             update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
 | 
			
		||||
#                                           status_id=5,
 | 
			
		||||
#                                           msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
			
		||||
#                                           msg='2G WPA Client Connectivity Failed - NAT mode' + str(
 | 
			
		||||
#                                               passes))
 | 
			
		||||
#         assert passes
 | 
			
		||||
#
 | 
			
		||||
@@ -480,11 +474,11 @@ class TestBridgeModeConnectivitySuiteB(object):
 | 
			
		||||
#         if passes:
 | 
			
		||||
#             update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
 | 
			
		||||
#                                           status_id=1,
 | 
			
		||||
#                                           msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
			
		||||
#                                           msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
 | 
			
		||||
#                                               passes))
 | 
			
		||||
#         else:
 | 
			
		||||
#             update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
 | 
			
		||||
#                                           status_id=5,
 | 
			
		||||
#                                           msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
			
		||||
#                                           msg='2G WPA Client Connectivity Failed - NAT mode' + str(
 | 
			
		||||
#                                               passes))
 | 
			
		||||
#         assert passes
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user