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.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/test-cli/test_main.py b/test-cli/test_main.py
index 5abbe85..dacc05a 100644
--- a/test-cli/test_main.py
+++ b/test-cli/test_main.py
@@ -25,6 +25,7 @@ from test.helpers.iseelogger import ISEE_Logger
import logging
from test.flashers.flasheeprom import flash_eeprom
from test.flashers.flashmemory import flash_memory
+from test.helpers.qrreader import QRReader
# global variables
psdbObj = TestSrv_Database()
@@ -146,12 +147,12 @@ def main():
alltasksok = False;
# flash eeprom
- resulteeprom = 0
- if "eeprompath" in varlist and len(varlist["eeprompath"]) > 0:
- mac0 = psdbObj.get_board_macaddr(globalVar.g_uuid)
- resulteeprom, eepromdata = flash_eeprom(varlist["eeprompath"], globalVar.g_uuid, mac0)
- psdbObj.create_task_result(globalVar.taskid_ctl, "FLASHEEPROM",
- "TASK_OK" if resulteeprom == 0 else "TASK_FAIL", eepromdata)
+ # resulteeprom = 0
+ # if "eeprompath" in varlist and len(varlist["eeprompath"]) > 0:
+ # mac0 = psdbObj.get_board_macaddr(globalVar.g_uuid)
+ # resulteeprom, eepromdata = flash_eeprom(varlist["eeprompath"], globalVar.g_uuid, mac0)
+ # psdbObj.create_task_result(globalVar.taskid_ctl, "FLASHEEPROM",
+ # "TASK_OK" if resulteeprom == 0 else "TASK_FAIL", eepromdata)
# flash non-volatile memory
# resultmemory = 0
@@ -162,8 +163,8 @@ def main():
# update status with the result
# if resulteeprom == 0 and resultmemory == 0:
- if resulteeprom == 0:
- alltasksok = True;
+ if True:
+ alltasksok = True
psdbObj.update_taskctl_status(globalVar.taskid_ctl, "TASK_BOARD_OK")
else:
psdbObj.update_taskctl_status(globalVar.taskid_ctl, "TASK_BOARD_FAIL")
@@ -171,9 +172,13 @@ def main():
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)
+ qr = QRReader()
+ if qr.openQR():
+ # program remains here until gets a succesful code from the scanner
+ if qr.readQR():
+ factorycode = qr.getQRNumber()
+ psdbObj.set_factorycode(globalVar.g_uuid, factorycode)
+ qr.closeQR()
loggerObj.getlogger().info("Python program finished")