Index: shared/scripts/configuration/config.py =================================================================== diff -u -r416d9db1a03f52bdf6a890c4dcd42c11e303fed2 -r58d65e5126cac3a1947465c92eeb1abdc7fbcf4c --- shared/scripts/configuration/config.py (.../config.py) (revision 416d9db1a03f52bdf6a890c4dcd42c11e303fed2) +++ shared/scripts/configuration/config.py (.../config.py) (revision 58d65e5126cac3a1947465c92eeb1abdc7fbcf4c) @@ -18,10 +18,32 @@ from configuration.strings import * AUT_NAME = "denaliSquish -k -K -S" -CONFIG_PATH = Path(os.getcwd()) -HOME_DIR_PATH = CONFIG_PATH.parent.parent.parent +HOME_DIR_PATH = "/home/denali" + LOG_LOCATION = "".join([str(HOME_DIR_PATH),'/Desktop/sd-card/log/']) +SERVICE_CONF_LOCATION ="".join([str(HOME_DIR_PATH),'/Projects/application/resources/settings/Settings/System.conf']) +POST_TREATMENT_LOG_LOCATION = "".join([str(HOME_DIR_PATH),'/Desktop/sd-card/treatment/*.log']) +#instructions_imagelocation +INSTRUCTION_CONF_LOCATION = "".join([str(HOME_DIR_PATH),'/Projects/application/resources/settings/Instructions/Instructions.conf']) +IMAGE_LOCATION = "file://"+"".join([str(HOME_DIR_PATH),'/Projects/application/resources/settings/Instructions/']) +EXPECTED_IMAGE_LOCATION ="".join([str(HOME_DIR_PATH),'/Projects/application/resources/settings/Instructions/']) +TREATMENT_LOG_LOCATION = "".join([str(HOME_DIR_PATH),'/Desktop/sd-card/treatment/*.log']) + +#cloud_sync_verification +INP_BUF_FILE_LOCATION = "".join([str(HOME_DIR_PATH),'/Desktop/sd-card/cloudsync/']) +CLOUD_CREDENTIALS_LOCATION = "".join([str(HOME_DIR_PATH)+'/Desktop/cloudsync/credentials']) +ERROR_FILE_LOCATION = "".join([str(HOME_DIR_PATH)+'/Desktop/sd-card/service/']) + +#ui_logs +LOG_LOCATION = "".join([str(HOME_DIR_PATH),'/Desktop/sd-card/log/']) + +CLOUDSYNC_FOLDER_PATH = "".join([str(HOME_DIR_PATH)+'/Desktop/']) +SD_CARD_CLOUDSYNC_FOLDER_PATH = "".join([str(HOME_DIR_PATH)+'/Desktop/sd-card/']) +USB_DISK_FOLDER_LOCATION = "".join([str(HOME_DIR_PATH)+'/Desktop/']) +APPLICATION_FOLDER_LOCATION = "".join([str(HOME_DIR_PATH)+'/Projects/']) + + COLOR_CODES = {"Aqua": "#81ffff", "Blue": "#017dea", "Blue 2": "#1090d5", "Green": "#29fd2d", "Grey": "#d3d3d3", "Lavender": "#db98f5", "Light Blue": "#acd7f1", "Light Teal": "#29f1da","Lime": "#b7fc36", "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r400b948437c1cefd1133b56e756c3f7a94c3cb33 -r58d65e5126cac3a1947465c92eeb1abdc7fbcf4c --- shared/scripts/configuration/utility.py (.../utility.py) (revision 400b948437c1cefd1133b56e756c3f7a94c3cb33) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 58d65e5126cac3a1947465c92eeb1abdc7fbcf4c) @@ -11,14 +11,16 @@ # @date (last) 15-Jan-2022 # ############################################################################ - +import os import csv import test import squish +import shutil from configuration import config from dialin.ui.hd_simulator import HDSimulator from builtins import int as pyInt from builtins import format +from dialin.ui import utils from datetime import datetime hd_simulator = HDSimulator() @@ -248,5 +250,36 @@ content_record.append(ack_bak_status) return content_record +def rename_file(path,filename): + """ + This method Rename the original folder name to dummy name. + """ + folder_path = os.listdir(path) + for files in folder_path: + if files == filename+"_1": + if os.path.exists(path+filename+"_1"): + shutil.rmtree(path+filename+"_1") + test.log(str(filename+" name changed to "+files)) + if files == filename: + if os.path.exists(path+filename): + utils.waitForGUI(1) + os.rename(path+filename,path+filename+"_1") + test.log(str(files+" name changed to "+filename+"_1")) +def rename_old_name(path,filename): + """ + This method Rename the dummy name to original folder name . + """ + folder_path = os.listdir(path) + for files in folder_path: + if files == filename: + if os.path.exists(path+filename): + shutil.rmtree(path+filename) + test.log(str(files+"_1 name changed to "+filename)) + utils.waitForGUI(5) + if files != filename: + if (files == filename+"_1"): + os.rename(path+files,path+filename) + test.log(str(files+" name changed to "+filename)) + Index: tst_ui_logs/test.py =================================================================== diff -u -rf561edb90782fefe26b5bc95c2bc46e526241aea -r58d65e5126cac3a1947465c92eeb1abdc7fbcf4c --- tst_ui_logs/test.py (.../test.py) (revision f561edb90782fefe26b5bc95c2bc46e526241aea) +++ tst_ui_logs/test.py (.../test.py) (revision 58d65e5126cac3a1947465c92eeb1abdc7fbcf4c) @@ -32,6 +32,7 @@ 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, unsigned_short_to_bytearray, unsigned_byte_to_bytearray +from symbol import try_stmt hd_simulator = HDSimulator() dg_simulator = DGSimulator() @@ -67,42 +68,8 @@ if param != None: test.verify(param in message_extracted, "parameters are verified") test.endSection() - - -def main(): - utils.tstStart(__file__) - """ - Flag Options: - -h, --help Displays this help. - -v, --version Displays version information. - -c, --canOut Show the Can Frame Output - -m, --msgOut Show the Message Output - -l, --logOut Show the Logs Output - -0, --enable-keep-awake Enable send low priority, empty message - on the CANBus just to keep UI board CAN - driver awake - -i, --fake-interval Test fake message interval(ms) - -f, --fake-message Test fake message data - will use default sequenced long fake - message if set to 00(default) - will used only if correct integer value - assigned for interval option - -b, --fake-message-seq-at-begin Test fake message sequence at the - beginning of the frame - -u, --disable-unhandled-report Disable unhandled messages report as an - error in the log - -d, --disable-dialin-unhandled Disable the Dialin messages logged as - unhandled - -q, --disable-timeout Disables HD communication timeout - -a, --disable-alarm-no-minimize Disables alarm no minimize - -S, --disable-sd-card-fail-log-stop disable-sd-card-fail-log-stop - -k, --enable-check-in-log Enables Check-In Log - -K, --enable-acknow-log Enables Acknowledgment Log - """ - startApplication(config.AUT_NAME+" -d"+ " -i"+ " -f"+ " -b"+ " -u"+ " -c"+ " -0"+ " -m") - - +def verif_ui_logs_api(): #HD Broadcast #0x0D00 hd_simulator.cmd_set_treatment_time(sec_total= 470, sec_elapsed= 300, sec_remain= 170) @@ -1582,6 +1549,67 @@ hd_simulator.cmd_send_hd_general_response(message_id=78, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload,channel_id= DenaliChannels.ui_to_hd_ch_id ) hd_simulator.cmd_send_hd_general_response(message_id=78, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload,channel_id= DenaliChannels.ui_to_hd_ch_id ) - +def verify_missing_path_verification(): + try: + utility.rename_file(config.CLOUDSYNC_FOLDER_PATH, "cloudsync") + try: + utility.rename_file(config.SD_CARD_CLOUDSYNC_FOLDER_PATH, "cloudsync") + try: + utility.rename_file(config.USB_DISK_FOLDER_LOCATION, "usb-disk") + try: + utility.rename_file(config.APPLICATION_FOLDER_LOCATION, "application") + + utils.waitForGUI(1) + verif_ui_logs_api() + except: + test.log("Error occured while renaming settings files") + except: + test.log("Error occured while renaming canbus files") + except: + test.log("Error occured while renaming scripts files") + except: + test.log("Error occured while renaming application files") + finally: + + utility.rename_old_name(config.APPLICATION_FOLDER_LOCATION, "application") +# utility.rename_old_name(config.SD_CARD_LOCATION, "sd-card") + utility.rename_old_name(config.CLOUDSYNC_FOLDER_PATH, "cloudsync") + utility.rename_old_name(config.SD_CARD_CLOUDSYNC_FOLDER_PATH, "cloudsync") + utility.rename_old_name(config.USB_DISK_FOLDER_LOCATION, "usb-disk") + +def main(): + utils.tstStart(__file__) + """ + Flag Options: + -h, --help Displays this help. + -v, --version Displays version information. + -c, --canOut Show the Can Frame Output + -m, --msgOut Show the Message Output + -l, --logOut Show the Logs Output + -0, --enable-keep-awake Enable send low priority, empty message + on the CANBus just to keep UI board CAN + driver awake + -i, --fake-interval Test fake message interval(ms) + -f, --fake-message Test fake message data + will use default sequenced long fake + message if set to 00(default) + will used only if correct integer value + assigned for interval option + -b, --fake-message-seq-at-begin Test fake message sequence at the + beginning of the frame + -u, --disable-unhandled-report Disable unhandled messages report as an + error in the log + -d, --disable-dialin-unhandled Disable the Dialin messages logged as + unhandled + -q, --disable-timeout Disables HD communication timeout + -a, --disable-alarm-no-minimize Disables alarm no minimize + -S, --disable-sd-card-fail-log-stop disable-sd-card-fail-log-stop + -k, --enable-check-in-log Enables Check-In Log + -K, --enable-acknow-log Enables Acknowledgment Log + """ + + startApplication(config.AUT_NAME+" -d"+ " -i"+ " -f"+ " -b"+ " -u"+ " -c"+ " -0"+ " -m") +# verif_ui_logs_api() + verify_missing_path_verification() utils.tstDone()