mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 03:48:09 +00:00
WIFI-4931: Added pytest exit if controller login fails and 'ubus call ucentral status' returns error
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
@@ -15,6 +15,7 @@ import time
|
||||
import random
|
||||
|
||||
import paramiko
|
||||
import pytest
|
||||
from scp import SCPClient
|
||||
import os
|
||||
|
||||
@@ -336,6 +337,7 @@ class APNOS:
|
||||
active = output.decode('utf-8').splitlines()[4].split(":")[1].replace(" ", "").replace(",", "")
|
||||
client.close()
|
||||
except Exception as e:
|
||||
pytest.exit("ubus call ucentral status: error" + output)
|
||||
print(e)
|
||||
connected, latest, active = "Error", "Error", "Error"
|
||||
return connected, latest, active
|
||||
|
||||
@@ -97,7 +97,10 @@ class ConfigureController:
|
||||
token = resp.json()
|
||||
self.access_token = token["access_token"]
|
||||
print(token)
|
||||
|
||||
if resp.status_code != 200:
|
||||
print(resp.status_code)
|
||||
print(resp.json())
|
||||
pytest.exit(str(resp.json()))
|
||||
# self.session.headers.update({'Authorization': self.access_token})
|
||||
return resp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user