mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-01 19:37:54 +00:00
Merge branch 'master' into WIFI-3623
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
Pytest fixtures: High level Resource Management and base setup fixtures
|
||||
"""
|
||||
import datetime
|
||||
import random
|
||||
import string
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
@@ -652,3 +654,27 @@ def fixtures_ver(request, get_configuration):
|
||||
print("1.x")
|
||||
obj = Fixtures_1x(configuration=get_configuration)
|
||||
yield obj
|
||||
|
||||
|
||||
"""
|
||||
Logs related Fixtures
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_ap_logs(request, get_apnos, get_configuration):
|
||||
S = 9
|
||||
instance_name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=S))
|
||||
for ap in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")
|
||||
ap_ssh.run_generic_command(cmd="logger start testcase: " + instance_name)
|
||||
|
||||
def collect_logs():
|
||||
for ap in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")
|
||||
ap_ssh.run_generic_command(cmd="logger stop testcase: " + instance_name)
|
||||
ap_logs = ap_ssh.get_logread(start_ref="start testcase: " + instance_name,
|
||||
stop_ref="stop testcase: " + instance_name)
|
||||
allure.attach(name='logread', body=str(ap_logs))
|
||||
pass
|
||||
request.addfinalizer(collect_logs)
|
||||
|
||||
Reference in New Issue
Block a user