blob: 561e9809604bffb360230f12fe96c9a43346c3ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import unittest
import sh
class Qram(unittest.TestCase):
params = None
__memsize = "10M"
__loops = "1"
# varlist: memsize, loops
def __init__(self, testname, testfunc, varlist):
self.params = varlist
super(Qram, self).__init__(testfunc)
if "memsize" in varlist:
self.__memsize = varlist["memsize"]
else:
raise Exception('memsize param inside Qram must be defined')
if "loops" in varlist:
self.__loops = varlist["loops"]
else:
raise Exception('loops param inside Qram must be defined')
self._testMethodDoc = testname
def execute(self):
try:
p = sh.memtester(self.__memsize, "1", _out="/dev/null")
except sh.ErrorReturnCode as e:
self.fail("failed: could not complete memtester command")
def getresults(self):
# resultlist is a python list of python dictionaries
resultlist = []
return resultlist
|