summaryrefslogtreecommitdiff
path: root/test-cli/test
diff options
context:
space:
mode:
authorManel Caro <mcaro@iatec.biz>2020-10-05 11:45:41 +0200
committerManel Caro <mcaro@iatec.biz>2020-10-05 11:45:41 +0200
commit293f0682dd8258a068e4b152f9fecb292d732b78 (patch)
tree03a1370d3ce2e61c783333f1f61bcda746e057a3 /test-cli/test
parenta67f3fc7c10720135361ef99a8bd3110731c0011 (diff)
downloadboard-293f0682dd8258a068e4b152f9fecb292d732b78.zip
board-293f0682dd8258a068e4b152f9fecb292d732b78.tar.gz
board-293f0682dd8258a068e4b152f9fecb292d732b78.tar.bz2
modify finish_test call, added execution without messsage if fails
Diffstat (limited to 'test-cli/test')
-rw-r--r--test-cli/test/helpers/testsrv_db.py14
-rw-r--r--test-cli/test/runners/simple.py3
2 files changed, 15 insertions, 2 deletions
diff --git a/test-cli/test/helpers/testsrv_db.py b/test-cli/test/helpers/testsrv_db.py
index 556c246..8e96e8c 100644
--- a/test-cli/test/helpers/testsrv_db.py
+++ b/test-cli/test/helpers/testsrv_db.py
@@ -101,10 +101,11 @@ class TestSrv_Database(object):
try:
print('finish_test => SQL {}'.format(sql))
self.__sqlObject.db_execute_query(sql)
+ return True
except Exception as err:
r = find_between(str(err), '#', '#')
print('finish_test => {}'.format(err))
- return None
+ return False
def upload_result_file(self, testid_ctl, testid, desc, filepath, mimetype):
try:
@@ -246,3 +247,14 @@ class TestSrv_Database(object):
r = find_between(str(err), '#', '#')
# print(r)
return default
+
+ def setDevelStationState(self, station, newState):
+ sql = "UPDATE station.station_state SET state = {} WHERE hostname={}".format(newState, station)
+ try:
+ res = self.__sqlObject.db_execute_query(sql)
+ # print(res)
+ return res[0][0]
+ except Exception as err:
+ r = find_between(str(err), '#', '#')
+ # print(r)
+ return None
diff --git a/test-cli/test/runners/simple.py b/test-cli/test/runners/simple.py
index ece5a4e..c110b1c 100644
--- a/test-cli/test/runners/simple.py
+++ b/test-cli/test/runners/simple.py
@@ -88,6 +88,7 @@ class TextTestResult(unittest.TestResult):
status = "TEST_FAILED"
resulttext = test.longMessage
logObj.getlogger().info('{}:{}:{}:{}'.format(test.params["testidctl"], test.params["testid"], status, resulttext))
- self.__pgObj.finish_test(test.params["testidctl"], test.params["testid"], status, resulttext)
+ if not self.__pgObj.finish_test(test.params["testidctl"], test.params["testid"], status, resulttext):
+ self.__pgObj.finish_test(test.params["testidctl"], test.params["testid"], status, "")
except Exception as E:
logObj.getlogger().error('Exception: [{}]{}:{}:{}:{}'.format(E, test.params["testidctl"], test.params["testid"], status, resulttext)) \ No newline at end of file