mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-01 19:37:54 +00:00
test cases fixed for sanity suite
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
@@ -118,7 +118,8 @@ class Controller(ConfigureController):
|
||||
|
||||
def refresh_instance(self):
|
||||
# Refresh token 10 seconds before it's expiry
|
||||
if time.time() - self.token_timestamp < (self.token_expiry-10):
|
||||
if time.time() - self.token_timestamp > self.token_expiry:
|
||||
self.token_timestamp = time.time()
|
||||
print("Refreshing the controller API token")
|
||||
self.api_client = swagger_client.ApiClient(self.configuration)
|
||||
self.login_client = swagger_client.LoginApi(api_client=self.api_client)
|
||||
@@ -137,7 +138,7 @@ class Controller(ConfigureController):
|
||||
print("Server not Reachable")
|
||||
exit()
|
||||
print("Connected to Controller Server")
|
||||
self.token_timestamp = time.time()
|
||||
|
||||
|
||||
def portal_ping(self):
|
||||
self.refresh_instance()
|
||||
@@ -955,7 +956,7 @@ class FirmwareUtility:
|
||||
firmware_data = {
|
||||
"id": 0,
|
||||
"equipmentType": "AP",
|
||||
"modelId": self.model,
|
||||
"modelId": str(self.model).upper(),
|
||||
"versionName": fw_version,
|
||||
"description": fw_version + " FW VERSION",
|
||||
"filename": self.fw_version,
|
||||
@@ -971,6 +972,7 @@ class FirmwareUtility:
|
||||
exit()
|
||||
if (force_upgrade is True) or (self.should_upgrade_ap_fw(equipment_id=equipment_id)):
|
||||
firmware_id = self.upload_fw_on_cloud(force_upload=force_upload)
|
||||
print(firmware_id)
|
||||
time.sleep(5)
|
||||
try:
|
||||
obj = self.equipment_gateway_client.request_firmware_update(equipment_id=equipment_id,
|
||||
@@ -978,6 +980,7 @@ class FirmwareUtility:
|
||||
print("Request firmware upgrade Success! waiting for 300 sec")
|
||||
time.sleep(300)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
obj = False
|
||||
return obj
|
||||
# Write the upgrade fw logic here
|
||||
@@ -1028,10 +1031,10 @@ if __name__ == '__main__':
|
||||
# "vlan": 1,
|
||||
# "mode": "BRIDGE"
|
||||
# }
|
||||
fw_obj = FirmwareUtility(sdk_client=api, model="eap101",
|
||||
version_url="https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/dev/ecw5410-2021-05-25-pending-e71df5e.tar.gz")
|
||||
fw_obj = FirmwareUtility(sdk_client=api, model="ecw5410",
|
||||
version_url="https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.0.4-rc4.tar.gz")
|
||||
fw_obj.upload_fw_on_cloud(force_upload=True)
|
||||
# fw_obj.upgrade_fw(equipment_id=28)
|
||||
fw_obj.upgrade_fw(equipment_id=7)
|
||||
# profile.create_wep_ssid_profile(profile_data=profile_data)
|
||||
# print(profile.get_profile_by_name(profile_name="wpa_wpa2_eap"))
|
||||
# profile.get_default_profiles()
|
||||
|
||||
@@ -27,7 +27,7 @@ ssh -C -L 8800:lf1:4002 -L 8801:lf1:5901 -L 8802:lf1:8080 -L 8803:lab-ctlr:22 \
|
||||
-L 8860:lf13:4002 -L 8861:lf13:5901 -L 8862:lf13:8080 -L 8863:lab-ctlr4:22 \
|
||||
-L 8870:lf14:4002 -L 8871:lf14:5901 -L 8872:lf14:8080 -L 8873:lab-ctlr4:22 \
|
||||
-L 8880:lf15:4002 -L 8881:lf15:5901 -L 8882:lf15:8080 -L 8883:lab-ctlr4:22 \
|
||||
ubuntu@3.130.51.163
|
||||
ubuntu@orch
|
||||
|
||||
"""
|
||||
|
||||
@@ -51,7 +51,7 @@ CONFIGURATION = {
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.0.4-rc2.tar.gz"
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.0.4-rc4.tar.gz"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
|
||||
@@ -232,6 +232,7 @@ def upload_firmware(should_upload_firmware, instantiate_firmware):
|
||||
@pytest.fixture(scope="session")
|
||||
def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware,
|
||||
should_upgrade_firmware):
|
||||
|
||||
status_list = []
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
if request.config.getoption("--skip-upgrade"):
|
||||
@@ -240,13 +241,13 @@ def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_f
|
||||
else:
|
||||
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i], force_upload=True,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
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, force_upload=False,
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i], force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
status_list.append(status)
|
||||
else:
|
||||
|
||||
@@ -8,22 +8,21 @@ from configuration import CONFIGURATION
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.sdk_version_check
|
||||
def test_cloud_sdk_version(instantiate_controller, testbed, test_cases, instantiate_testrail, instantiate_project):
|
||||
def test_cloud_sdk_version(setup_controller, testbed, test_cases, update_report):
|
||||
try:
|
||||
response = instantiate_controller.portal_ping()
|
||||
response = setup_controller.portal_ping()
|
||||
if CONFIGURATION[testbed]['controller']['version'] == response._project_version:
|
||||
PASS = True
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_ver"], run_id=instantiate_project,
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=1, msg='Read CloudSDK version from API successfully')
|
||||
PASS = True
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_ver"], run_id=instantiate_project,
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=0, msg='Could not read CloudSDK version from API - '
|
||||
'version missmatch')
|
||||
PASS = False
|
||||
except Exception as e:
|
||||
print(e)
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_ver"], run_id=instantiate_project,
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=0, msg='Could not read CloudSDK version from API - Exception '
|
||||
'occured')
|
||||
PASS = False
|
||||
|
||||
@@ -517,7 +517,6 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
time.sleep(10)
|
||||
allure.attach(body=str("VIF Config: " + str(vif_config) + "\n" + "VIF State: " + str(vif_state)),
|
||||
name="SSID Profiles in VIF Config and VIF State: ")
|
||||
print(test_cases)
|
||||
|
||||
def teardown_session():
|
||||
print("\nRemoving Profiles")
|
||||
|
||||
@@ -27,7 +27,7 @@ class TestFirmware(object):
|
||||
|
||||
@pytest.mark.firmware_upgrade
|
||||
def test_firmware_upgrade_request(self, upgrade_firmware, update_report, test_cases):
|
||||
print()
|
||||
print(upgrade_firmware)
|
||||
if not upgrade_firmware:
|
||||
update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
status_id=0,
|
||||
|
||||
Reference in New Issue
Block a user