summaryrefslogtreecommitdiff
path: root/test-cli/test_main.py
diff options
context:
space:
mode:
Diffstat (limited to 'test-cli/test_main.py')
-rw-r--r--test-cli/test_main.py23
1 files changed, 7 insertions, 16 deletions
diff --git a/test-cli/test_main.py b/test-cli/test_main.py
index 43a5b67..37207cc 100644
--- a/test-cli/test_main.py
+++ b/test-cli/test_main.py
@@ -115,9 +115,9 @@ def create_board():
get_mac(globalVar.g_mid))
-def create_boardvariables_list(uuid):
+def get_taskvars_list(uuid):
varlist = {}
- for row in psdbObj.get_board_variables(uuid):
+ for row in psdbObj.get_task_variables_list(uuid):
varname, varvalue = row
varlist[varname] = varvalue
return varlist
@@ -128,45 +128,36 @@ def main():
create_board()
# create a process
globalVar.testid_ctl = psdbObj.open_test(globalVar.g_uuid)
- globalVar.taskid_ctl = psdbObj.create_process(globalVar.testid_ctl)
# create and run tests according to the board type
runner = SimpleTestRunner(psdbObj)
testresult = runner.run(create_testsuite())
# execute aditional tasks, only if the test was succesfull
if testresult.wasSuccessful():
- # change status to "running tasks"
- psdbObj.update_taskctl_status(globalVar.taskid_ctl, "TASK_BOARD_RUNNING")
+ # create task control
+ globalVar.taskid_ctl = psdbObj.open_task(globalVar.g_uuid)
# get extra variables
- varlist = create_boardvariables_list(globalVar.g_uuid)
+ varlist = get_taskvars_list(globalVar.g_uuid)
- resultmemory = 0
# flash eeprom
+ resulteeprom = 0
if "eeprompath" in varlist and len(varlist["eeprompath"]) > 0:
mac0 = psdbObj.get_board_macaddr(globalVar.g_uuid)
resulteeprom = flash_eeprom(varlist["eeprompath"], globalVar.g_uuid, mac0)
psdbObj.create_task_result(globalVar.taskid_ctl, "FLASHEEPROM",
"TASK_OK" if resulteeprom == 0 else "TASK_FAIL", varlist["eeprompath"])
- else:
- resulteeprom = 0
- psdbObj.create_task_result(globalVar.taskid_ctl, "FLASHEEPROM", "TASK_SKIP")
# 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"])
- else:
- resultmemory = 0
- psdbObj.create_task_result(globalVar.taskid_ctl, "FLASHMEMORY", "TASK_SKIP")
# update status with the result
if resulteeprom == 0 and resultmemory == 0:
psdbObj.update_taskctl_status(globalVar.taskid_ctl, "TASK_BOARD_OK")
else:
psdbObj.update_taskctl_status(globalVar.taskid_ctl, "TASK_BOARD_FAIL")
- else:
- # change status to "not done"
- psdbObj.update_taskctl_status(globalVar.taskid_ctl, "TASK_BOARD_NOT_DONE")
if __name__ == "__main__":