diff options
author | Hector Fernandez <hector@iatec.biz> | 2020-06-17 09:44:56 +0200 |
---|---|---|
committer | Hector Fernandez <hector@iatec.biz> | 2020-06-17 09:44:56 +0200 |
commit | 09b3bb38fc7305c9b47c29bc90ebc9c636827307 (patch) | |
tree | a793c8f232031183960178d2a18fcde4baf3348f /test-cli/test/helpers/testsrv_db.py | |
parent | 0dd2613b88d937e71b274d68924088b1bad65de4 (diff) | |
download | board-09b3bb38fc7305c9b47c29bc90ebc9c636827307.zip board-09b3bb38fc7305c9b47c29bc90ebc9c636827307.tar.gz board-09b3bb38fc7305c9b47c29bc90ebc9c636827307.tar.bz2 |
SOPA0000: Added support for saving results (strings or files) in the DB. It also saves a final DMESG file.
Diffstat (limited to 'test-cli/test/helpers/testsrv_db.py')
-rw-r--r-- | test-cli/test/helpers/testsrv_db.py | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/test-cli/test/helpers/testsrv_db.py b/test-cli/test/helpers/testsrv_db.py index dc4fb55..dfb4d15 100644 --- a/test-cli/test/helpers/testsrv_db.py +++ b/test-cli/test/helpers/testsrv_db.py @@ -101,6 +101,42 @@ class TestSrv_Database(object): # print(r) return None + def upload_result_string(self, testid_ctl, testid, descrip, strdata): + sql = "SELECT isee.f_upload_result_string({},{},'{}','{}')".format(testid_ctl, testid, descrip, strdata) + # print('>>>' + sql) + try: + self.__sqlObject.db_execute_query(sql) + except Exception as err: + r = find_between(str(err), '#', '#') + # print(r) + return None + + def upload_result_file(self, testid_ctl, testid, descrip, filepath): + try: + # generate a new oid + fileoid = self.__sqlObject.db_upload_large_file(filepath) + # insert into a table + sql = "SELECT isee.f_upload_result_file({},{},'{}','{}')".format(testid_ctl, testid, descrip, fileoid) + # print('>>>' + sql) + self.__sqlObject.db_execute_query(sql) + except Exception as err: + r = find_between(str(err), '#', '#') + # print(r) + return None + + def upload_dmesg(self, testid_ctl, filepath): + try: + # generate a new oid + fileoid = self.__sqlObject.db_upload_large_file(filepath) + # insert into a table + sql = "SELECT isee.f_upload_dmesg_file({},'{}')".format(testid_ctl, fileoid) + # print('>>>' + sql) + self.__sqlObject.db_execute_query(sql) + except Exception as err: + r = find_between(str(err), '#', '#') + # print(r) + return None + def get_task_variables_list(self, board_uuid): sql = "SELECT * FROM isee.f_get_task_variables_list('{}')".format(board_uuid) # print('>>>' + sql) @@ -176,4 +212,3 @@ class TestSrv_Database(object): r = find_between(str(err), '#', '#') # print(r) return None - |