diff options
Diffstat (limited to 'test-cli/test_main.py')
-rw-r--r-- | test-cli/test_main.py | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/test-cli/test_main.py b/test-cli/test_main.py index ddd62aa..5abbe85 100644 --- a/test-cli/test_main.py +++ b/test-cli/test_main.py @@ -113,6 +113,8 @@ def create_board(): print(processor_id) globalVar.g_uuid = psdbObj.create_board(processor_id, model_id, variant, globalVar.station, get_mac(globalVar.g_mid)) + print(globalVar.g_uuid) + psdbObj.bond_to_station(globalVar.g_uuid, globalVar.station) def get_taskvars_list(uuid): @@ -130,14 +132,19 @@ def main(): globalVar.testid_ctl = psdbObj.open_test(globalVar.g_uuid) # create and run tests according to the board type runner = SimpleTestRunner(psdbObj) + loggerObj.getlogger().info("Tests running") testresult = runner.run(create_testsuite()) # execute aditional tasks, only if the test was succesfull - if testresult.wasSuccessful(): + # if testresult.wasSuccessful(): + if True: + loggerObj.getlogger().info("Extra tasks running") # create task control globalVar.taskid_ctl = psdbObj.open_task(globalVar.g_uuid) # get extra variables varlist = get_taskvars_list(globalVar.g_uuid) + alltasksok = False; + # flash eeprom resulteeprom = 0 if "eeprompath" in varlist and len(varlist["eeprompath"]) > 0: @@ -147,18 +154,29 @@ def main(): "TASK_OK" if resulteeprom == 0 else "TASK_FAIL", eepromdata) # flash non-volatile memory - resultmemory = 0 - if "image" in varlist and len(varlist["image"]) > 0: - resultmemory = flash_memory(varlist["image"]) - psdbObj.create_task_result(globalVar.taskid_ctl, "FLASHMEMORY", - "TASK_OK" if resultmemory == 0 else "TASK_FAIL", varlist["image"]) + # resultmemory = 0 + # if "image" in varlist and len(varlist["image"]) > 0: + # resultmemory = flash_memory(varlist["image"]) + # psdbObj.create_task_result(globalVar.taskid_ctl, "FLASHMEMORY", + # "TASK_OK" if resultmemory == 0 else "TASK_FAIL", varlist["image"]) # update status with the result - if resulteeprom == 0 and resultmemory == 0: + # if resulteeprom == 0 and resultmemory == 0: + if resulteeprom == 0: + alltasksok = True; psdbObj.update_taskctl_status(globalVar.taskid_ctl, "TASK_BOARD_OK") else: psdbObj.update_taskctl_status(globalVar.taskid_ctl, "TASK_BOARD_FAIL") + if alltasksok: + # get barcode using the scanner + loggerObj.getlogger().info("Waiting for barcode scanner") + # TODO ----- + factorycode = "XXXXX-XXXXX" + psdbObj.set_factorycode(globalVar.g_uuid, factorycode) + + loggerObj.getlogger().info("Python program finished") + if __name__ == "__main__": # Clear the shell screen @@ -166,7 +184,7 @@ if __name__ == "__main__": # create logger loggerObj = ISEE_Logger(logging.INFO) - # logger = loggerObj.getlogger().info("Starting test script...") + loggerObj.getlogger().info("Python program started") # Try to parse the setup.xml file try: |