summaryrefslogtreecommitdiff
path: root/test-cli/test/tests/qrtc.py
diff options
context:
space:
mode:
authorHector Fernandez <hector@iatec.biz>2020-06-25 11:45:31 +0200
committerHector Fernandez <hector@iatec.biz>2020-06-25 11:45:31 +0200
commitdb3b1e45c47a1ef23c1ad67114a09cbec0976681 (patch)
tree6833ba2e59be77f9e818823068570ca3d51959cc /test-cli/test/tests/qrtc.py
parent278b5729a44837e37fe13611518c1babc8de00df (diff)
downloadboard-db3b1e45c47a1ef23c1ad67114a09cbec0976681.zip
board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.tar.gz
board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.tar.bz2
Solved bugs. Adapted to DB changes.
Diffstat (limited to 'test-cli/test/tests/qrtc.py')
-rw-r--r--test-cli/test/tests/qrtc.py38
1 files changed, 34 insertions, 4 deletions
diff --git a/test-cli/test/tests/qrtc.py b/test-cli/test/tests/qrtc.py
index 715bcb7..6d4ecf6 100644
--- a/test-cli/test/tests/qrtc.py
+++ b/test-cli/test/tests/qrtc.py
@@ -7,6 +7,7 @@ import re
class Qrtc(unittest.TestCase):
params = None
__rtc = None
+ __resultlist = None # resultlist is a python list of python dictionaries
def __init__(self, testname, testfunc, varlist):
self.params = varlist
@@ -16,6 +17,7 @@ class Qrtc(unittest.TestCase):
else:
raise Exception('rtc param inside Qrtc must be defined')
self._testMethodDoc = testname
+ self.__resultlist = []
def execute(self):
# get time from RTC peripheral
@@ -31,13 +33,41 @@ class Qrtc(unittest.TestCase):
p.stdout.decode('ascii'))
# check if the seconds of both times are different
if time1 == time2:
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "FAILED: RTC is not running",
+ "type": "string"
+ }
+ )
self.fail("failed: RTC is not running")
else:
- self.fail("failed: couldn't execute hwclock command 2nd time")
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "FAILED: couldn't execute hwclock command for the second time",
+ "type": "string"
+ }
+ )
+ self.fail("failed: couldn't execute hwclock command for the second time")
else:
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "FAILED: couldn't execute hwclock command",
+ "type": "string"
+ }
+ )
self.fail("failed: couldn't execute hwclock command")
+ # Test successful
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "OK",
+ "type": "string"
+ }
+ )
+
def getresults(self):
- # resultlist is a python list of python dictionaries
- resultlist = []
- return resultlist
+ return self.__resultlist