mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2026-01-27 10:23:37 +00:00
Test case fixes
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
@@ -161,7 +161,7 @@ class APNOS:
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
output = stdout.read()
|
||||
status = str(output.decode('utf-8').splitlines())
|
||||
print(output, stderr.read())
|
||||
# print(output, stderr.read())
|
||||
client.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
@@ -178,7 +178,7 @@ class Controller(ConfigureController):
|
||||
# Get the equipment id, of a equipment with a serial number
|
||||
def get_equipment_id(self, serial_number=None):
|
||||
equipment_data = self.get_equipment_by_customer_id(max_items=100)
|
||||
print(len(equipment_data))
|
||||
# print(len(equipment_data))
|
||||
for equipment in equipment_data:
|
||||
if equipment._serial == serial_number:
|
||||
return equipment._id
|
||||
@@ -210,7 +210,7 @@ class Controller(ConfigureController):
|
||||
# print(status_data)
|
||||
try:
|
||||
current_ap_fw = status_data[2]['details']['reportedSwVersion']
|
||||
print(current_ap_fw)
|
||||
# print(current_ap_fw)
|
||||
return current_ap_fw
|
||||
except:
|
||||
current_ap_fw = "error"
|
||||
@@ -341,7 +341,7 @@ class ProfileUtility:
|
||||
self.default_profiles['radius'] = i
|
||||
if i._name == "TipWlan-rf":
|
||||
self.default_profiles['rf'] = i
|
||||
print(i)
|
||||
# print(i)
|
||||
# This will delete the Profiles associated with an equipment of givwn equipment_id, and associate it to default
|
||||
# equipment_ap profile
|
||||
def delete_current_profile(self, equipment_id=None):
|
||||
@@ -383,7 +383,7 @@ class ProfileUtility:
|
||||
for i in self.default_profiles:
|
||||
skip_delete_id.append(self.default_profiles[i]._id)
|
||||
delete_ids = list(set(delete_ids) - set(delete_ids).intersection(set(skip_delete_id)))
|
||||
print(delete_ids)
|
||||
# print(delete_ids)
|
||||
for i in delete_ids:
|
||||
self.set_equipment_to_profile(profile_id=i)
|
||||
self.delete_profile(profile_id=delete_ids)
|
||||
@@ -900,7 +900,7 @@ class FirmwareUtility(JFrogUtility):
|
||||
def get_fw_version(self):
|
||||
# Get The equipment model
|
||||
self.latest_fw = self.get_build(model=self.model, version=self.fw_version)
|
||||
print("shivam", self.latest_fw)
|
||||
# print("shivam", self.latest_fw)
|
||||
return self.latest_fw
|
||||
|
||||
def upload_fw_on_cloud(self, fw_version=None, force_upload=False):
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
from sta_connect2 import StaConnect2
|
||||
import time
|
||||
from eap_connect import EAPConnect
|
||||
|
||||
# from eap_connect import EAPConnect
|
||||
from test_ipv4_ttls import TTLSTest
|
||||
|
||||
class RunTest:
|
||||
|
||||
@@ -67,35 +67,7 @@ class RunTest:
|
||||
time.sleep(3)
|
||||
return self.staConnect.passes(), result
|
||||
|
||||
def Single_Client_EAP(self, port, sta_list, ssid_name, radio, security, eap_type,
|
||||
identity, ttls_password, test_case, rid, client, logger):
|
||||
eap_connect = EAPConnect(self.lanforge_ip, self.lanforge_port, _debug_on=False)
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = port
|
||||
eap_connect.security = security
|
||||
eap_connect.sta_list = sta_list
|
||||
eap_connect.station_names = sta_list
|
||||
eap_connect.sta_prefix = self.lanforge_prefix
|
||||
eap_connect.ssid = ssid_name
|
||||
eap_connect.radio = radio
|
||||
eap_connect.eap = eap_type
|
||||
eap_connect.identity = identity
|
||||
eap_connect.ttls_passwd = ttls_password
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
eap_connect.stop()
|
||||
eap_connect.cleanup()
|
||||
run_results = eap_connect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
result = True
|
||||
print("Single Client Connectivity :", eap_connect.passes)
|
||||
if eap_connect.passes():
|
||||
print("Single client connection to", ssid_name, "successful. Test Passed")
|
||||
else:
|
||||
print("Single client connection to", ssid_name, "unsuccessful. Test Failed")
|
||||
result = False
|
||||
return self.staConnect.passes(), result
|
||||
# def Client_Connectivity_EAP(self, ssid="[BLANK]", passwd="[BLANK]", key_mgmt= "WPA-EAP",
|
||||
# pairwise="", group="", wpa_psk="", identity="", station_name=[],
|
||||
# mode="BRIDGE", security="wpa2", eap_type,
|
||||
# identity, ttls_password, test_case, rid, client, logger):
|
||||
|
||||
@@ -142,12 +142,11 @@ def get_apnos():
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_equipment_id(setup_controller, testbed, get_configuration):
|
||||
equipment_id = 0
|
||||
if len(get_configuration['access_point']) == 1:
|
||||
equipment_id = setup_controller.get_equipment_id(
|
||||
serial_number=get_configuration['access_point'][0]['serial'])
|
||||
print(equipment_id)
|
||||
yield equipment_id
|
||||
equipment_id_list = []
|
||||
for i in get_configuration['access_point']:
|
||||
equipment_id_list.append(setup_controller.get_equipment_id(
|
||||
serial_number=i['serial']))
|
||||
yield equipment_id_list
|
||||
|
||||
|
||||
# APNOS SETUP
|
||||
@@ -250,7 +249,10 @@ def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_f
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def check_ap_firmware_cloud(setup_controller, get_equipment_id):
|
||||
yield setup_controller.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
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
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
|
||||
@@ -303,7 +303,8 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
|
||||
# Push the Equipment AP Profile to AP
|
||||
try:
|
||||
instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
for i in get_equipment_id:
|
||||
instantiate_profile.push_profile_old_method(equipment_id=i)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("failed to create AP Profile")
|
||||
|
||||
@@ -25,20 +25,20 @@ class TestFirmware(object):
|
||||
PASS = False
|
||||
assert PASS
|
||||
|
||||
@pytest.mark.firmware_upgrade
|
||||
def test_firmware_upgrade_request(self, upgrade_firmware, update_report, test_cases):
|
||||
print()
|
||||
if not upgrade_firmware:
|
||||
update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
status_id=0,
|
||||
msg='Error requesting upgrade via API')
|
||||
PASS = False
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
status_id=1,
|
||||
msg='Upgrade request using API successful')
|
||||
PASS = True
|
||||
assert PASS
|
||||
# @pytest.mark.firmware_upgrade
|
||||
# def test_firmware_upgrade_request(self, upgrade_firmware, update_report, test_cases):
|
||||
# print()
|
||||
# if not upgrade_firmware:
|
||||
# update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
# status_id=0,
|
||||
# msg='Error requesting upgrade via API')
|
||||
# PASS = False
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
# status_id=1,
|
||||
# msg='Upgrade request using API successful')
|
||||
# PASS = True
|
||||
# assert PASS
|
||||
|
||||
@pytest.mark.check_active_firmware_cloud
|
||||
def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, update_report, test_cases):
|
||||
@@ -60,7 +60,7 @@ def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, update_report,
|
||||
if check_ap_firmware_ssh == get_latest_firmware:
|
||||
update_report.update_testrail(case_id=test_cases["ap_upgrade"],
|
||||
status_id=1,
|
||||
msg='Upgrade to ' + get_latest_firmware + ' successful')
|
||||
msg='Upgrade to ' + str(get_latest_firmware) + ' successful')
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["ap_upgrade"],
|
||||
status_id=4,
|
||||
|
||||
@@ -130,14 +130,14 @@ class TestBridgeModeConnectivity(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
msg='5G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
msg='5G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@@ -158,14 +158,14 @@ class TestBridgeModeConnectivity(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
msg='2G WPA2 Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@@ -186,63 +186,63 @@ class TestBridgeModeConnectivity(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
msg='5G WPA2 Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="package"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self):
|
||||
# print(setup_client_connectivity)
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self):
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self):
|
||||
# print(setup_client_connectivity)
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self):
|
||||
assert "setup_client_connectivity"
|
||||
# setup_params_enterprise = {
|
||||
# "mode": "BRIDGE",
|
||||
# "ssid_modes": {
|
||||
# "wpa2_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
# {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
# "security_key": "something"}],
|
||||
# "wpa3_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
#
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_enterprise],
|
||||
# indirect=True,
|
||||
# scope="package"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestBridgeModeEnterprise(object):
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa2_enterprise_2g(self):
|
||||
# # print(setup_client_connectivity)
|
||||
# assert "setup_client_connectivity"
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa2_enterprise_5g(self):
|
||||
# assert "setup_client_connectivity"
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self):
|
||||
# # print(setup_client_connectivity)
|
||||
# assert "setup_client_connectivity"
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self):
|
||||
# assert "setup_client_connectivity"
|
||||
|
||||
|
||||
@@ -212,49 +212,49 @@ class TestNATModeConnectivity(object):
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="package"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestNATModeEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self):
|
||||
# print(setup_client_connectivity)
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self):
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self):
|
||||
# print(setup_client_connectivity)
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self):
|
||||
assert "setup_client_connectivity"
|
||||
# setup_params_enterprise = {
|
||||
# "mode": "NAT",
|
||||
# "ssid_modes": {
|
||||
# "wpa2_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
# {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
# "security_key": "something"}],
|
||||
# "wpa3_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
#
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_enterprise],
|
||||
# indirect=True,
|
||||
# scope="package"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestNATModeEnterprise(object):
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa2_enterprise_2g(self):
|
||||
# # print(setup_client_connectivity)
|
||||
# assert "setup_client_connectivity"
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa2_enterprise_5g(self):
|
||||
# assert "setup_client_connectivity"
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self):
|
||||
# # print(setup_client_connectivity)
|
||||
# assert "setup_client_connectivity"
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self):
|
||||
# assert "setup_client_connectivity"
|
||||
|
||||
@@ -33,7 +33,7 @@ class TestVLANModeConnectivity(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, request, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
def test_open_ssid_2g(self, setup_profiles, request, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
|
||||
@@ -25,7 +25,7 @@ class TestResources(object):
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=0, msg='Could not read CloudSDK version from API')
|
||||
pytest.exit("Resource Not Available")
|
||||
print(setup_controller.bearer)
|
||||
# print(setup_controller.bearer)
|
||||
assert setup_controller.bearer
|
||||
|
||||
@pytest.mark.test_access_points_connectivity
|
||||
|
||||
Reference in New Issue
Block a user