From ae9bf53a417c72498d9b7f55b8c0c86dc4b9fbc3 Mon Sep 17 00:00:00 2001 From: shivamcandela Date: Wed, 28 Jul 2021 01:25:14 +0530 Subject: [PATCH] exception error in apnos get_uc_latest_config() Signed-off-by: shivamcandela --- libs/apnos/apnos.py | 20 ++--- libs/controller/ucentral_ctlr.py | 3 +- tests/configuration.py | 78 ++++++++++++++++++- .../test_general_security_modes.py | 1 + 4 files changed, 91 insertions(+), 11 deletions(-) diff --git a/libs/apnos/apnos.py b/libs/apnos/apnos.py index 608ee2cc0..9d67448b4 100644 --- a/libs/apnos/apnos.py +++ b/libs/apnos/apnos.py @@ -365,7 +365,7 @@ class APNOS: print(type(json_output)) client.close() except Exception as e: - json_output = False + json_output = {} print(e) return json_output @@ -383,7 +383,7 @@ class APNOS: print(json_output) client.close() except Exception as e: - json_output = False + json_output = {} print(e) return json_output @@ -416,6 +416,8 @@ class APNOS: else: wifi_info[j["ifname"]] = [j["config"]["ssid"], j["config"]["encryption"], ""] data = self.get_iwinfo() + print(wifi_info) + print(data) for i in wifi_info.keys(): wifi_info[i].append(data[i]) return wifi_info @@ -529,17 +531,17 @@ class APNOS: if __name__ == '__main__': obj = { - 'model': 'eap102', - 'mode': 'wifi6', - 'serial': '0000c1018812', + 'model': 'ec420', + 'mode': 'wifi5', + 'serial': '001122090801', 'jumphost': True, - 'ip': "10.28.3.100", # 10.28.3.103 + 'ip': "10.28.3.100", 'username': "lanforge", 'password': "pumpkin77", - 'port': 22, # 22 - 'jumphost_tty': '/dev/ttyAP1', + 'port': 22, + 'jumphost_tty': '/dev/ttyAP3', 'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/edgecore_eap102/20210625-edgecore_eap102-uCentral-trunk-4225122-upgrade.bin" } - var = APNOS(credentials=obj, sdk="1.x") + var = APNOS(credentials=obj, sdk="2.x") x = var.get_interface_details() print(x) diff --git a/libs/controller/ucentral_ctlr.py b/libs/controller/ucentral_ctlr.py index df907d43a..9b73b9a4e 100644 --- a/libs/controller/ucentral_ctlr.py +++ b/libs/controller/ucentral_ctlr.py @@ -225,7 +225,7 @@ class UProfileUtility: "country": "US", # "channel-mode": "HE", "channel-width": 80, - # "channel": 36 + # "channel": "auto" }) self.vlan_section["ssids"] = [] @@ -335,6 +335,7 @@ class UProfileUtility: uri = self.sdk_client.build_uri("device/" + serial_number + "/configure") basic_cfg_str = json.dumps(payload) + allure.attach(name="ucentral_config: ", body=str(self.base_profile_config)) # print(self.base_profile_config) resp = requests.post(uri, data=basic_cfg_str, headers=self.sdk_client.make_headers(), verify=False, timeout=100) diff --git a/tests/configuration.py b/tests/configuration.py index 24625717e..e183d0284 100644 --- a/tests/configuration.py +++ b/tests/configuration.py @@ -237,7 +237,83 @@ CONFIGURATION = { "AX-Station-Name": "ax" } } - } + }, + "basic-03": { + "controller": { + 'url': 'https://sec-ucentral-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller + 'username': "tip@ucentral.com", + 'password': 'openwifi', + }, + 'access_point': [ + { + 'model': 'ec420', + 'mode': 'wifi5', + 'serial': '001122090801', + 'jumphost': True, + 'ip': "10.28.3.100", + 'username': "lanforge", + 'password': "pumpkin77", + 'port': 22, + 'jumphost_tty': '/dev/ttyAP3', + 'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/edgecore_eap102/20210625-edgecore_eap102-uCentral-trunk-4225122-upgrade.bin" + } + ], + "traffic_generator": { + "name": "lanforge", + "details": { + "ip": "10.28.3.10", + "port": 8080, + "ssh_port": 22, + "2.4G-Radio": ["1.1.wiphy4"], + "5G-Radio": ["1.1.wiphy5"], + "AX-Radio": ["1.1.wiphy0", "1.1.wiphy1", "1.1.wiphy2", "1.1.wiphy3"], + "upstream": "1.1.eth2", + "upstream_subnet": "10.28.2.1/24", + "uplink": "1.1.eth3", + "2.4G-Station-Name": "wlan0", + "5G-Station-Name": "wlan1", + "AX-Station-Name": "ax" + } + } + }, + "basic-04": { + "controller": { + 'url': 'https://sec-ucentral-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller + 'username': "tip@ucentral.com", + 'password': 'openwifi', + }, + 'access_point': [ + { + 'model': 'ecw5211', + 'mode': 'wifi5', + 'serial': '68215fda456d', + 'jumphost': True, + 'ip': "10.28.3.100", + 'username': "lanforge", + 'password': "pumpkin77", + 'port': 22, + 'jumphost_tty': '/dev/ttyAP5', + 'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/edgecore_eap102/20210625-edgecore_eap102-uCentral-trunk-4225122-upgrade.bin" + } + ], + "traffic_generator": { + "name": "lanforge", + "details": { + "ip": "10.28.3.12", + "port": 8080, + "ssh_port": 22, + "2.4G-Radio": ["1.1.wiphy4"], + "5G-Radio": ["1.1.wiphy5"], + "AX-Radio": ["1.1.wiphy0", "1.1.wiphy1", "1.1.wiphy2", "1.1.wiphy3"], + "upstream": "1.1.eth2", + "upstream_subnet": "10.28.2.1/24", + "uplink": "1.1.eth3", + "2.4G-Station-Name": "wlan0", + "5G-Station-Name": "wlan0", + "AX-Station-Name": "ax" + } + } + } # checked uci } diff --git a/tests/e2e/basic/validation_of_operating_modes/bridge_mode/client_connectivity/test_general_security_modes.py b/tests/e2e/basic/validation_of_operating_modes/bridge_mode/client_connectivity/test_general_security_modes.py index 14cb99dc4..83dfbffaf 100644 --- a/tests/e2e/basic/validation_of_operating_modes/bridge_mode/client_connectivity/test_general_security_modes.py +++ b/tests/e2e/basic/validation_of_operating_modes/bridge_mode/client_connectivity/test_general_security_modes.py @@ -31,6 +31,7 @@ setup_params_general = { @pytest.mark.uc_sanity @pytest.mark.suiteA +@pytest.mark.sudo @allure.feature("BRIDGE MODE CLIENT CONNECTIVITY") @pytest.mark.parametrize( 'setup_profiles',