diff options
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 - |