Index: tst_cloud_sync_device_registration/test.py =================================================================== diff -u -rc59d7383386f50271d61a84982b6ac5a7770f784 -r2ff95e591789d7869d8921d7b4e36b224539d5ba --- tst_cloud_sync_device_registration/test.py (.../test.py) (revision c59d7383386f50271d61a84982b6ac5a7770f784) +++ tst_cloud_sync_device_registration/test.py (.../test.py) (revision 2ff95e591789d7869d8921d7b4e36b224539d5ba) @@ -15,35 +15,17 @@ # NOTE: # This test verifies the logs for the messages provided - -from dialin.ui.hd_simulator_alarms import HDAlarmsSimulator -import logging -from dialin.protocols.CAN import DenaliCanMessenger +import builtins +import csv from dialin.ui import HDSimulator from dialin.ui import DGSimulator from dialin.ui import utils from configuration import utility from configuration import config -import csv -import builtins -from dialin.common.msg_ids import MsgIds -from dialin.common.hd_defs import HDOpSubModes, HDOpModes -from dialin.common import msg_defs -from dialin.utils.conversions import integer_to_bytearray, float_to_bytearray, short_to_bytearray, unsigned_integer_to_bytearray, integer_to_bit_array hd_simulator = HDSimulator() dg_simulator = DGSimulator() -logger= logging.getLogger("INFO") -messenger= DenaliCanMessenger('can0') -hd_alarm= HDAlarmsSimulator(can_interface=messenger, logger=logger) -NUMBER_OF_OPMODE = 9 -NUMBER_OF_TREATMENTMODES = 3 -CONDITIONS = [0,1] -SW_VERSION = 6292356 -ZERO = 0 -THREE = 3 -epoch = 0 def retrive_log_data(): file_name = utility.get_extracted_file_inp_buf() @@ -59,16 +41,11 @@ except: test.fail("Log file is not created or log file is not created based on standard log naming format.") - def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) - - for index in range (3): - - #0x9900 hd_simulator.cmd_send_serial_hd_data(serial = config.CLOUD_SYNC["HD_VERSION_SERIAL"][index]) utils.waitForGUI(5) epoch,event, ZERO, registration_request, THREE, HD_VERSION_SERIAL, DG_VERSION_SERIAL, SW_VERSION = retrive_log_data() @@ -80,49 +57,35 @@ test.log(str(HD_VERSION_SERIAL)) test.log(str(DG_VERSION_SERIAL)) test.log(str(SW_VERSION)) - - -# utils.waitForGUI(5) -# #0x8800 -# dg_simulator.cmd_send_serial_dg_data(serial = 'DG1234567890123') -# #verify_log(msg_id = MsgIds.MSG_ID_DG_SERIAL_NUMBER.value, msg = "Serial", param = ['DG1234567890123']) - -# utils.waitForGUI(5) -# #0x8800 -# dg_simulator.cmd_send_serial_dg_data(serial = config.CLOUD_SYNC["DG_VERSION_SERIAL"][index]) -# verify_log() -# -# + utils.waitForGUI(5) - dg_simulator.cmd_send_serial_dg_data(serial = config.CLOUD_SYNC["DG_VERSION_SERIAL"][index]) + + for index in range (3): + dg_simulator.cmd_send_serial_dg_data(serial = config.CLOUD_SYNC["DG_VERSION_SERIAL"][index]) + utils.waitForGUI(5) + epoch,event, ZERO, registration_request, THREE, HD_VERSION_SERIAL, DG_VERSION_SERIAL, SW_VERSION = retrive_log_data() + test.log(str(epoch)) + test.log(str(event)) + test.log(str(ZERO)) + test.log(str(registration_request)) + test.log(str(THREE)) + test.log(str(HD_VERSION_SERIAL)) + test.log(str(DG_VERSION_SERIAL)) + test.log(str(SW_VERSION)) utils.waitForGUI(5) - epoch,event, ZERO, registration_request, THREE, HD_VERSION_SERIAL, DG_VERSION_SERIAL, SW_VERSION = retrive_log_data() - test.log(str(epoch)) - test.log(str(event)) - test.log(str(ZERO)) - test.log(str(registration_request)) - test.log(str(THREE)) - test.log(str(HD_VERSION_SERIAL)) - test.log(str(DG_VERSION_SERIAL)) - test.log(str(SW_VERSION)) + for index in range (3): + hd_simulator.cmd_send_serial_hd_data(serial = config.CLOUD_SYNC["HD_VERSION_SERIAL"][index]) + dg_simulator.cmd_send_serial_dg_data(serial = config.CLOUD_SYNC["DG_VERSION_SERIAL"][index]) + utils.waitForGUI(5) + epoch,event, ZERO, registration_request, THREE, HD_VERSION_SERIAL, DG_VERSION_SERIAL, SW_VERSION = retrive_log_data() + test.log(str(epoch)) + test.log(str(event)) + test.log(str(ZERO)) + test.log(str(registration_request)) + test.log(str(THREE)) + test.log(str(HD_VERSION_SERIAL)) + test.log(str(DG_VERSION_SERIAL)) + test.log(str(SW_VERSION)) - utils.waitForGUI(5) - #0x9900 - hd_simulator.cmd_send_serial_hd_data(serial = config.CLOUD_SYNC["HD_VERSION_SERIAL"][index]) - #0x8800 - dg_simulator.cmd_send_serial_dg_data(serial = config.CLOUD_SYNC["DG_VERSION_SERIAL"][index]) - utils.waitForGUI(5) - epoch,event, ZERO, registration_request, THREE, HD_VERSION_SERIAL, DG_VERSION_SERIAL, SW_VERSION = retrive_log_data() - test.log(str(epoch)) - test.log(str(event)) - test.log(str(ZERO)) - test.log(str(registration_request)) - test.log(str(THREE)) - test.log(str(HD_VERSION_SERIAL)) - test.log(str(DG_VERSION_SERIAL)) - test.log(str(SW_VERSION)) - - - utils.tstDone()