WIFI-7705- Added memory Profile output (#475)

Added memory profile before applying config, after applying config and before and after each test case

Signed-off-by: shivam <shivam.thakur@candelatech.com>
This commit is contained in:
Shivam Thakur
2022-04-20 20:24:42 +05:30
committed by GitHub
parent 7b1c307c7b
commit b67a68fb08
2 changed files with 18 additions and 1 deletions

View File

@@ -725,6 +725,10 @@ def get_ap_logs(request, get_apnos, get_configuration, run_lf):
ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")
ap_ssh.run_generic_command(cmd="logger start testcase: " + instance_name)
# Adding memory Profile code before every test start
output = ap_ssh.run_generic_command(cmd="ucode /usr/share/ucentral/sysinfo.uc")
allure.attach(name="ucode /usr/share/ucentral/sysinfo.uc ", body=str(output))
def collect_logs():
for ap in get_configuration['access_point']:
ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")
@@ -732,7 +736,10 @@ def get_ap_logs(request, get_apnos, get_configuration, run_lf):
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
# Adding memory Profile code after every test completion
output = ap_ssh.run_generic_command(cmd="ucode /usr/share/ucentral/sysinfo.uc")
allure.attach(name="ucode /usr/share/ucentral/sysinfo.uc ", body=str(output))
request.addfinalizer(collect_logs)

View File

@@ -673,6 +673,12 @@ class Fixtures_2x:
instance_name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=S))
ap_ssh.run_generic_command(cmd="logger start testcase: " + instance_name)
# Adding memory Profile code before applying config
output = ap_ssh.run_generic_command(cmd="ucode /usr/share/ucentral/sysinfo.uc")
allure.attach(name="ucode /usr/share/ucentral/sysinfo.uc ", body=str(output))
time_1 = time.time()
# Apply config
@@ -802,6 +808,10 @@ class Fixtures_2x:
print(e)
pass
# Adding memory Profile code after applying config
output = ap_ssh.run_generic_command(cmd="ucode /usr/share/ucentral/sysinfo.uc")
allure.attach(name="ucode /usr/share/ucentral/sysinfo.uc ", body=str(output))
def teardown_session():
wifi_status = ap_ssh.get_wifi_status()
allure.attach(name="wifi status", body=str(wifi_status))