Index: tst_cloud_sync_device_registration/test.py =================================================================== diff -u -r2ff95e591789d7869d8921d7b4e36b224539d5ba -r7ea06f6694a6c28c6c071cd8b7b8c75f72fb41ac --- tst_cloud_sync_device_registration/test.py (.../test.py) (revision 2ff95e591789d7869d8921d7b4e36b224539d5ba) +++ tst_cloud_sync_device_registration/test.py (.../test.py) (revision 7ea06f6694a6c28c6c071cd8b7b8c75f72fb41ac) @@ -22,7 +22,12 @@ from dialin.ui import utils from configuration import utility from configuration import config +from builtins import int as pyInt +from builtins import str as pyStr +import time +from datetime import datetime + hd_simulator = HDSimulator() dg_simulator = DGSimulator() @@ -37,55 +42,80 @@ 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") + test.fail("input buf data is corrupted") except: - test.fail("Log file is not created or log file is not created based on standard log naming format.") + test.fail("Input buf file is not created or it is not created based on standard naming format.") +def system_epoch_value(): + + time_formatted = time.strftime('%Y-%m-%d %H:%M', time.localtime(time.time())) + test.log(str(time_formatted)) + return time_formatted + +def epoch_value_conversion(epoch): + + time_formatted_one = time.strftime('%Y-%m-%d %H:%M', time.localtime(epoch)) + test.log(str(time_formatted_one)) + return time_formatted_one +def verify_inp_buf_data(): + + test.startSection("Verification of cloud sync latest inuput buf file data") + EPOCH_ONE = system_epoch_value() + epoch,event, ZERO, registration_request, THREE, HD_VERSION_SERIAL, DG_VERSION_SERIAL, SW_VERSION = retrive_log_data() + epoch = builtins.int(epoch) + epoch = epoch_value_conversion(epoch) + test.compare(EPOCH_ONE, epoch) +# test.compare(event) +# test.compare(ZERO) +# test.compare(registration_request) +# test.compare(THREE) +# test.compare(config.CLOUD_SYNC[index], HD_VERSION_SERIAL) +# test.compare(config.CLOUD_SYNC[index], DG_VERSION_SERIAL) +# test.compare(SW_VERSION) + test.endSection() + + + 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)) + verify_inp_buf_data() + + + + #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()