Wifi 12754 (#841)

* test added to validate master-config1

Signed-off-by: anil-tegala <anil.tegala@candelatech.com>

* allure info added to master-config1 test

Signed-off-by: anil-tegala <anil.tegala@candelatech.com>

* added master-config2 test

Signed-off-by: anil-tegala <anil.tegala@candelatech.com>

* added master-config3 test

Signed-off-by: anil-tegala <anil.tegala@candelatech.com>

---------

Signed-off-by: anil-tegala <anil.tegala@candelatech.com>
This commit is contained in:
Anil Kumar Tegala
2023-08-28 19:18:13 +05:30
committed by GitHub
parent 884e2346cd
commit 0348629b7e
2 changed files with 255 additions and 0 deletions

View File

@@ -0,0 +1,192 @@
{
"uuid": 2,
"radios": [
{
"band": "5G",
"channel": 149,
"channel-mode": "HE",
"channel-width": 80,
"country": "CA"
},
{
"band": "2G",
"channel": 11,
"channel-mode": "HE",
"channel-width": 20,
"country": "CA"
}
],
"interfaces": [
{
"name": "WAN",
"role": "upstream",
"tunnel": {
"proto": "mesh"
},
"services": [ "lldp" ],
"ethernet": [
{
"select-ports": [
"WAN*"
]
}
],
"ipv4": {
"addressing": "dynamic"
},
"ssids": [
{
"name": "mesh-transit-1",
"wifi-bands": [
"5G"
],
"bss-mode": "mesh",
"encryption": {
"proto": "psk2",
"key": "meshpassword",
"ieee80211w": "optional"
}
},
{
"name": "Mesh-SSID-2G",
"wifi-bands": [
"2G"
],
"bss-mode": "ap",
"encryption": {
"proto": "psk",
"key": "OpenWifi",
"ieee80211w": "optional"
}
},
{
"name": "Mesh-SSID-5G",
"wifi-bands": [
"5G"
],
"bss-mode": "ap",
"encryption": {
"proto": "psk",
"key": "OpenWifi",
"ieee80211w": "optional"
}
},
{
"name": "usteering-air-3",
"wifi-bands": [
"5G",
"2G"
],
"bss-mode": "ap",
"encryption": {
"proto": "psk2",
"key": "password@123",
"ieee80211w": "optional"
},
"roaming": {
"message-exchange": "air",
"generate-psk": true
},
"services": [ "wifi-steering" ]
},{
"name": "Uchannel-ds-4",
"wifi-bands": [
"2G","5G"
],
"bss-mode": "ap",
"encryption": {
"proto": "psk2",
"key": "OpenWifi",
"ieee80211w": "optional"
},
"roaming": {
"message-exchange": "ds",
"generate-psk": true
},
"rrm": {
"neighbor-reporting": true,
"ftm-responder": true,
"stationary-ap": true },
"services": [ "wifi-steering" ]
},
{
"name": "captive-radius-5",
"services": [
"captive"
],
"wifi-bands": [
"5G",
"2G"
],
"bss-mode": "ap",
"encryption": {
"proto": "psk2",
"key": "OpenWifi",
"ieee80211w": "optional"
},
"captive": {
"auth-mode": "radius",
"auth-server": "10.28.3.100",
"auth-port": 1812,
"auth-secret": "testing123",
"walled-garden-fqdn": [
"*.google.com",
"telecominfraproject.com"
]
}
}
]
},
{
"name": "LAN",
"role": "downstream",
"services": [ "ssh", "lldp" ],
"ethernet": [
{
"select-ports": [
"LAN*"
]
}
],
"ipv4": {
"addressing": "static",
"subnet": "192.168.1.1/24",
"dhcp": {
"lease-first": 10,
"lease-count": 100,
"lease-time": "6h"
}
}
}
],
"metrics": {
"statistics": {
"interval": 120,
"types": [ "ssids", "lldp", "clients" ]
},
"health": {
"interval": 120
},
"wifi-frames": {
"filters": [ "probe", "auth" ]
}
},
"services": {
"lldp": {
"describe": "uCentral",
"location": "universe"
},
"wifi-steering": {
"mode": "local",
"network": "upstream",
"assoc-steering": true,
"required-snr": -85,
"required-probe-snr": -80,
"required-roam-snr": -80,
"load-kick-threshold": 90
},
"ssh": {
"port": 22
}
}
}

View File

@@ -28,6 +28,12 @@ with open(file_path, 'r') as file:
config_data_2 = json.loads(json_string)
file_path3 = os.path.join(test_file_dir, 'master-config-3.json')
with open(file_path, 'r') as file:
json_string = file.read()
config_data_3 = json.loads(json_string)
pytestmark = [pytest.mark.master_config]
@@ -96,6 +102,7 @@ class TestMasterConfig(object):
assert True
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-12753", name="WIFI-12753")
@pytest.mark.wpa_personal
@pytest.mark.master_config2
@@ -150,3 +157,59 @@ class TestMasterConfig(object):
pytest.fail("Some or ALL Configured SSID's are not present in iwinfo")
assert True
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-12753", name="WIFI-12753")
@pytest.mark.wpa_personal
@pytest.mark.master_config3
def test_master_config_three(self, get_test_library, check_connectivity, get_target_object):
"""
Master Config Three
pytest -m "master_config3"
"""
for ap in range(len(get_target_object.device_under_tests_info)):
serial_number = get_target_object.device_under_tests_info[ap]['identifier']
logging.info(config_data_1)
payload = {"configuration": json.dumps(config_data_1), "serialNumber": serial_number, "UUID": 1}
uri = get_target_object.firmware_library_object.sdk_client.build_uri(
"device/" + serial_number + "/configure")
logging.info("Sending Command: " + "\n" + str(uri) + "\n" +
"TimeStamp: " + str(datetime.utcnow()) + "\n" +
"Data: " + str(json.dumps(payload, indent=2)) + "\n" +
"Headers: " + str(get_target_object.firmware_library_object.sdk_client.make_headers()))
allure.attach(name="Push Config:", body="Sending Command: " + "\n" + str(uri) + "\n" +
"TimeStamp: " + str(datetime.utcnow()) + "\n" +
"Data: " + str(payload) + "\n" +
"Headers: " + str(
get_target_object.firmware_library_object.sdk_client.make_headers()))
resp = requests.post(uri, data=json.dumps(payload),
headers=get_target_object.firmware_library_object.sdk_client.make_headers(),
verify=False, timeout=120)
logging.info(resp.json())
allure.attach(name=f"Response - {resp.status_code}{resp.reason}", body=str(resp.json()))
if int(resp.status_code) == 200:
time.sleep(120)
else:
pytest.exit("Configuration Push Failed")
# check RX message from AP after config push
after_config_push = get_target_object.dut_library_object.get_dut_logs()
logging.info(after_config_push)
# get pushed config from ap
config_pushed = get_target_object.dut_library_object.run_generic_command(cmd="cat /etc/ucentral/ucentral"
".active", attach_allure=True)
logging.info(config_pushed)
# check ssid info in iwinfo
configured_ssids = config_data_3
iw_info = get_target_object.dut_library_object.get_iwinfo()
if iw_info is not None:
interface_pattern = r'(\S+)\s+ESSID:\s+"(.*?)"'
matches = re.findall(interface_pattern, iw_info)
logging.info(matches)
if matches and len(matches) != 0:
data = {interface: essid for interface, essid in matches}
else:
pytest.fail("Some or ALL Configured SSID's are not present in iwinfo")
assert True