summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test-cli/.idea/workspace.xml2
-rw-r--r--test-cli/test/helpers/testsrv_db.py8
-rw-r--r--test-cli/test_main.py23
3 files changed, 11 insertions, 22 deletions
diff --git a/test-cli/.idea/workspace.xml b/test-cli/.idea/workspace.xml
index 9b9e803..2aa3d94 100644
--- a/test-cli/.idea/workspace.xml
+++ b/test-cli/.idea/workspace.xml
@@ -4,8 +4,6 @@
<list default="true" id="4991a6e0-1b9d-4824-9b6e-5ac031eb4816" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/helpers/testsrv_db.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/helpers/testsrv_db.py" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/test/tests/qnand.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qnand.py" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/test/tests/qram.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/tests/qram.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test_main.py" beforeDir="false" afterPath="$PROJECT_DIR$/test_main.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
diff --git a/test-cli/test/helpers/testsrv_db.py b/test-cli/test/helpers/testsrv_db.py
index a6a5545..27024ce 100644
--- a/test-cli/test/helpers/testsrv_db.py
+++ b/test-cli/test/helpers/testsrv_db.py
@@ -101,8 +101,8 @@ class TestSrv_Database(object):
# print(r)
return None
- def get_board_variables(self, board_uuid):
- sql = "SELECT * FROM isee.f_get_boardvariables('{}')".format(board_uuid)
+ def get_task_variables_list(self, board_uuid):
+ sql = "SELECT * FROM isee.f_get_task_variables_list('{}')".format(board_uuid)
# print('>>>' + sql)
try:
res = self.__sqlObject.db_execute_query(sql)
@@ -125,8 +125,8 @@ class TestSrv_Database(object):
# print(r)
return None
- def create_process(self, testid_ctl):
- sql = "SELECT * FROM isee.f_create_process({})".format(testid_ctl)
+ def open_task(self, uuid):
+ sql = "SELECT * FROM isee.f_open_task('{}')".format(uuid)
# print('>>>' + sql)
try:
res = self.__sqlObject.db_execute_query(sql)
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__":