from test.helpers.syscmd import SysCommand import unittest class Qram(unittest.TestCase): def __init__(self, testname, testfunc, memSize): super(Qram, self).__init__(testfunc) self.__memSize = memSize self._testMethodDoc = testname def execute(self): str_cmd= "free -m" free_command = SysCommand("free_ram", str_cmd) if free_command.execute() == 0: self.__raw_out = free_command.getOutput() if self.__raw_out == "": return -1 lines = free_command.getOutput().splitlines() aux = [int(s) for s in lines[1].split() if s.isdigit()] self.failUnless(int(aux[0])>int(self.__memSize),"failed: total ram memory size lower than expected") else: self.fail("failed: could not complete iperf command")