summaryrefslogtreecommitdiff
path: root/test-cli/test_main.py
diff options
context:
space:
mode:
authorHector Fernandez <hector@iatec.biz>2020-04-13 09:49:51 +0200
committerHector Fernandez <hector@iatec.biz>2020-04-13 10:06:37 +0200
commitf86887baef80509460da0bff8f48b2900a627282 (patch)
tree70276382e2bba14673f763e2dbcace998a8fe685 /test-cli/test_main.py
parent0c610ebbef5928f17ec8c14d872b4d4298d3c4fb (diff)
downloadboard-f86887baef80509460da0bff8f48b2900a627282.zip
board-f86887baef80509460da0bff8f48b2900a627282.tar.gz
board-f86887baef80509460da0bff8f48b2900a627282.tar.bz2
Added new DB functions. Added Qrreader.py file.
Diffstat (limited to 'test-cli/test_main.py')
-rw-r--r--test-cli/test_main.py34
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: