diff options
author | Hector Fernandez <hector@iatec.biz> | 2020-06-25 11:45:31 +0200 |
---|---|---|
committer | Hector Fernandez <hector@iatec.biz> | 2020-06-25 11:45:31 +0200 |
commit | db3b1e45c47a1ef23c1ad67114a09cbec0976681 (patch) | |
tree | 6833ba2e59be77f9e818823068570ca3d51959cc /test-cli/test/tests/qnand.py | |
parent | 278b5729a44837e37fe13611518c1babc8de00df (diff) | |
download | board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.zip board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.tar.gz board-db3b1e45c47a1ef23c1ad67114a09cbec0976681.tar.bz2 |
Solved bugs. Adapted to DB changes.
Diffstat (limited to 'test-cli/test/tests/qnand.py')
-rw-r--r-- | test-cli/test/tests/qnand.py | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/test-cli/test/tests/qnand.py b/test-cli/test/tests/qnand.py index 7ff7cb2..d7c22b3 100644 --- a/test-cli/test/tests/qnand.py +++ b/test-cli/test/tests/qnand.py @@ -5,6 +5,7 @@ import sh class Qnand(unittest.TestCase): params = None __device = "10M" + __resultlist = None # resultlist is a python list of python dictionaries # varlist: device def __init__(self, testname, testfunc, varlist): @@ -15,6 +16,7 @@ class Qnand(unittest.TestCase): else: raise Exception('device param inside Qnand must be defined') self._testMethodDoc = testname + self.__resultlist = [] def execute(self): try: @@ -22,17 +24,32 @@ class Qnand(unittest.TestCase): # save result with open('/tmp/nand-nandtest.txt', 'w') as outfile: n = outfile.write(p.stdout.decode('ascii')) + self.__resultlist.append( + { + "desc": "nandtest output", + "data": "/tmp/nand-nandtest.txt", + "type": "file" + } + ) except sh.ErrorReturnCode as e: + self.__resultlist.append( + { + "desc": "Test result", + "data": "FAILED: could not complete nandtest command", + "type": "string" + } + ) self.fail("failed: could not complete nandtest command") - def getresults(self): - # resultlist is a python list of python dictionaries - resultlist = [ + # Test successful + self.__resultlist.append( { - "desc": "nandtest output", - "data": "/tmp/nand-nandtest.txt", - "type": "file" + "desc": "Test result", + "data": "OK", + "type": "string" } - ] - return resultlist + ) + + def getresults(self): + return self.__resultlist |