mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-10-29 18:12:34 +00:00
Added all device_statistics and device_reboot_logs in teardown section for each test case (#996)
* Added all device_statistics and device_reboot_logs in teardown section for each test case Signed-off-by: jitendracandela <jitendra.kushavah@candelatech.com> * Added get_device_statistics_teardown and get_device_reboot_logs methods for attaching data in teradown section Signed-off-by: jitendracandela <jitendra.kushavah@candelatech.com> * Modified get_dut_logs_per_test_case for attaching the data in teardown Signed-off-by: jitendracandela <jitendra.kushavah@candelatech.com> --------- Signed-off-by: jitendracandela <jitendra.kushavah@candelatech.com>
This commit is contained in:
committed by
GitHub
parent
3126395008
commit
be7fe82de4
@@ -650,6 +650,23 @@ class Controller(ConfigureController):
|
||||
self.check_response("GET", resp, self.make_headers(), "", uri)
|
||||
return resp
|
||||
|
||||
def get_device_reboot_logs(self, serial_number="", query="?startDate=1726204413&endDate=1726206213&limit=30&logType=2&newest=true",
|
||||
allure_attach=False):
|
||||
uri = self.build_uri("device/" + serial_number + "/logs" + query)
|
||||
logging.info("Sending Command: " + "\n" +
|
||||
"TimeStamp: " + str(datetime.datetime.utcnow()) + "\n" +
|
||||
"URI: " + str(uri) + "\n" +
|
||||
"Headers: " + str(self.make_headers()))
|
||||
if allure_attach:
|
||||
allure.attach(name="Sending Command:", body="Sending Command: " + "\n" +
|
||||
"TimeStamp: " + str(datetime.datetime.utcnow()) + "\n" +
|
||||
"URI: " + str(uri) + "\n" +
|
||||
"Headers: " + str(self.make_headers()))
|
||||
resp = requests.get(uri, headers=self.make_headers(), verify=False, timeout=120)
|
||||
if allure_attach:
|
||||
self.check_response("GET", resp, self.make_headers(), "", uri)
|
||||
return resp
|
||||
|
||||
def get_device_health_checks(self, serial_number):
|
||||
uri = self.build_uri("device/" + serial_number + "/healthchecks")
|
||||
logging.info("Sending Command: " + "\n" +
|
||||
@@ -692,6 +709,22 @@ class Controller(ConfigureController):
|
||||
self.check_response("GET", resp, self.make_headers(), "", uri)
|
||||
return resp
|
||||
|
||||
def get_device_statistics_teardown(self, serial_number="", query="?newest=true&limit=30", allure_attach=False):
|
||||
uri = self.build_uri("device/" + serial_number + "/statistics" + query)
|
||||
logging.info("Sending Command: " + "\n" +
|
||||
"TimeStamp: " + str(datetime.datetime.utcnow()) + "\n" +
|
||||
"URI: " + str(uri) + "\n" +
|
||||
"Headers: " + str(self.make_headers()))
|
||||
if allure_attach:
|
||||
allure.attach(name="Sending Command:", body="Sending Command: " + "\n" +
|
||||
"TimeStamp: " + str(datetime.datetime.utcnow()) + "\n" +
|
||||
"URI: " + str(uri) + "\n" +
|
||||
"Headers: " + str(self.make_headers()))
|
||||
resp = requests.get(uri, headers=self.make_headers(), verify=False, timeout=120)
|
||||
if allure_attach:
|
||||
self.check_response("GET", resp, self.make_headers(), "", uri)
|
||||
return resp
|
||||
|
||||
def get_device_status(self, serial_number):
|
||||
uri = self.build_uri("device/" + serial_number + "/status")
|
||||
logging.info("Sending Command: " + "\n" +
|
||||
|
||||
Reference in New Issue
Block a user