summaryrefslogtreecommitdiff
path: root/test-cli/test/tests/qnand.py
diff options
context:
space:
mode:
Diffstat (limited to 'test-cli/test/tests/qnand.py')
-rw-r--r--test-cli/test/tests/qnand.py33
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