# -*- coding: utf-8 -*- ## # Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. # copyright # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, # IN PART OR IN WHOLE, # WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # file tst_UI_log_verification # date 2022/07/06 # author Amol Pandharinath Shinde # author Akshay Dhawan # # NOTE: # This test verifies the logs for the messages provided 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 hd_simulator = HDSimulator() dg_simulator = DGSimulator() def retrive_log_data(): file_name = utility.get_extracted_file_inp_buf() try: with open(file_name,mode = 'r') as f: contents = csv.reader(f) try: for reader in reversed(list(contents)): test.log(str(reader)) return (reader[0],reader[1],reader[2],reader[3],reader[4],reader[5],reader[6],reader[7]) except: test.fail("application log data is corrupted") 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): 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() 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) 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) 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.tstDone()