mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-10-30 02:22:44 +00:00
Kafka log validation for AP events (#814)
* kafka healtcheck messages unit test added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * class and marker name changed Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * attach healthcheck message value to allure Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * added kafka-python to dependencies list Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * kafka broker value modified Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * healthcheck method modified to ap event test Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * upgrade upgrade event check validation added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * sdk_client for make headers fixed Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * decodes poll message with utf-8 Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * message.value error fixed Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * firmware change check validation added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * added logging for debug Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * records data parsed with json loads to string Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * print statements to debug Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * remove try catch from iteration Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * added event type validation to check the fw upgrade msg Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * get method removed for fetching values from payload Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * recorded messages attached to allure Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * wifi start and dev config change kafka tests added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * test config file and marker name changes Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * wifi stop event validation added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * added client join event validation Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * replaced setup_coniguration fixture with dut data Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * list indices error in ssid data fixed Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * added client-join, client-leave, client-keymismatch event validation Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * client creation fix Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * check condition added to client creation Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * check health radius event added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * TTLS client creation for health radius event added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * boot up event validation added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * check wired interface up or down event added * check blacklisted device test added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * remove current fw from fw list in fw_upgrade test Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * uboot test scenario modified with configuration push before reboot Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * config fix in radius health event Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * check ssh event validation added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * regex fix for the interface ip address Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * dns and dhcp event msgs validation added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * test health memory event validation added Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * DNS & DHCP health test event fixed Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * list index fixed for ssid & passwd Signed-off-by: anil-tegala <anil.tegala@candelatech.com> * radius config issue fixed Signed-off-by: anil-tegala <anil.tegala@candelatech.com> --------- Signed-off-by: anil-tegala <anil.tegala@candelatech.com>
This commit is contained in:
committed by
GitHub
parent
bebf448d76
commit
4d8b57c0b9
@@ -15,4 +15,5 @@ tip-wlan-cloud
|
||||
xlsxwriter
|
||||
tabulate
|
||||
pdfkit
|
||||
matplotlib
|
||||
matplotlib
|
||||
kafka-python
|
||||
@@ -8,8 +8,10 @@ import random
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
import json
|
||||
from _pytest.fixtures import SubRequest
|
||||
from typing import Any, Callable, Optional
|
||||
from kafka import KafkaConsumer
|
||||
|
||||
ALLURE_ENVIRONMENT_PROPERTIES_FILE = 'environment.properties'
|
||||
ALLUREDIR_OPTION = '--alluredir'
|
||||
@@ -517,3 +519,27 @@ def check_connectivity(request, get_testbed_details, get_target_object, run_lf):
|
||||
if not run_lf:
|
||||
request.addfinalizer(collect_logs)
|
||||
|
||||
|
||||
# Pytest fixture for the Kafka consumer
|
||||
@pytest.fixture(scope='session')
|
||||
def kafka_consumer_deq():
|
||||
# Create a Kafka consumer
|
||||
consumer = KafkaConsumer(
|
||||
'device_event_queue',
|
||||
bootstrap_servers=['kafka-headless.openwifi-qa01.svc.cluster.local:9092'],
|
||||
value_deserializer=lambda x: json.loads(x.decode('utf-8'))
|
||||
)
|
||||
yield consumer
|
||||
consumer.close()
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def kafka_consumer_healthcheck():
|
||||
# Create a Kafka consumer
|
||||
consumer = KafkaConsumer(
|
||||
'healthcheck',
|
||||
bootstrap_servers=['kafka-headless.openwifi-qa01.svc.cluster.local:9092'],
|
||||
value_deserializer=lambda x: json.loads(x.decode('utf-8'))
|
||||
)
|
||||
yield consumer
|
||||
consumer.close()
|
||||
|
||||
0
tests/kafka_tests/__init__.py
Normal file
0
tests/kafka_tests/__init__.py
Normal file
0
tests/kafka_tests/ap_events/__init__.py
Normal file
0
tests/kafka_tests/ap_events/__init__.py
Normal file
102
tests/kafka_tests/ap_events/test-config.json
Normal file
102
tests/kafka_tests/ap_events/test-config.json
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"uuid": 2,
|
||||
"radios": [
|
||||
{
|
||||
"band": "5G",
|
||||
"channel": 52,
|
||||
"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",
|
||||
"services": [ "lldp", "dhcp-snooping" ],
|
||||
"ethernet": [
|
||||
{
|
||||
"select-ports": [
|
||||
"WAN*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"ipv4": {
|
||||
"addressing": "dynamic"
|
||||
},
|
||||
"ssids": [
|
||||
{
|
||||
"name": "OpenWifi",
|
||||
"wifi-bands": [
|
||||
"2G", "5G"
|
||||
],
|
||||
"bss-mode": "ap",
|
||||
"encryption": {
|
||||
"proto": "psk2",
|
||||
"key": "OpenWifi@123",
|
||||
"ieee80211w": "optional"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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" ]
|
||||
},
|
||||
"dhcp-snooping": {
|
||||
"filters": [ "ack", "discover", "offer", "request", "solicit", "reply", "renew" ]
|
||||
},
|
||||
"wifi-frames": {
|
||||
"filters": [ "probe", "auth", "assoc", "disassoc", "deauth", "local-deauth", "inactive-deauth", "key-mismatch", "beacon-report", "radar-detected"]
|
||||
},
|
||||
"telemetry": {
|
||||
"interval": 15,
|
||||
"types": [ "ssh" ]
|
||||
},
|
||||
"realtime": {
|
||||
"types": [ "wifi.start"]
|
||||
},
|
||||
"health": {
|
||||
"interval": 120
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"lldp": {
|
||||
"describe": "uCentral",
|
||||
"location": "universe"
|
||||
},
|
||||
"ssh": {
|
||||
"port": 22
|
||||
}
|
||||
}
|
||||
}
|
||||
1386
tests/kafka_tests/ap_events/test_kafka_ap_events.py
Normal file
1386
tests/kafka_tests/ap_events/test_kafka_ap_events.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user