blob: 8ec02105133fdd48cf4352e3fe0cc6aac5377e8e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
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")
|