diff options
Diffstat (limited to 'test-cli/test/tests')
-rw-r--r-- | test-cli/test/tests/qeeprom.py | 2 | ||||
-rw-r--r-- | test-cli/test/tests/qethernet.py | 20 | ||||
-rw-r--r-- | test-cli/test/tests/qram.py | 12 |
3 files changed, 17 insertions, 17 deletions
diff --git a/test-cli/test/tests/qeeprom.py b/test-cli/test/tests/qeeprom.py index c2293c2..acdc1f6 100644 --- a/test-cli/test/tests/qeeprom.py +++ b/test-cli/test/tests/qeeprom.py @@ -27,7 +27,7 @@ class Qeeprom(unittest.TestCase): p = sh.dd(sh.echo(data_tx), "of=" + self.__eeprompath, "bs=1", "seek=" + self.__position) if p.exit_code == 0: # read data from the eeprom - p = sh.dd("if=" + self.__eeprompath, "bs=1", "skip=" + self.__position, "count=" + len(data_tx)) + p = sh.dd("if=" + self.__eeprompath, "bs=1", "skip=" + self.__position, "count=" + str(len(data_tx))) if p.exit_code == 0: data_rx = p.stdout.decode('ascii') # compare both values diff --git a/test-cli/test/tests/qethernet.py b/test-cli/test/tests/qethernet.py index 22d796c..adee67f 100644 --- a/test-cli/test/tests/qethernet.py +++ b/test-cli/test/tests/qethernet.py @@ -4,26 +4,26 @@ import re class Qethernet(unittest.TestCase): - __sip = None + __serverip = None __numbytestx = None __bind = None - __OKBW = None + __bwexpected = None __port = None def __init__(self, testname, testfunc, varlist): super(Qethernet, self).__init__(testfunc) - if "sip" in varlist: - self.__sip = varlist["sip"] + if "serverip" in varlist: + self.__serverip = varlist["serverip"] else: raise Exception('sip param inside Qethernet have been be defined') if "bind" in varlist: self.__bind = varlist["bind"] else: self.__bind = None - if "OKBW" in varlist: - self.__OKBW = varlist["OKBW"] + if "bwexpected" in varlist: + self.__bwexpected = varlist["bwexpected"] else: - raise Exception('OKBW param inside Qethernet must be defined') + raise Exception('bwexpected param inside Qethernet must be defined') if "port" in varlist: self.__port = varlist["port"] else: @@ -34,9 +34,9 @@ class Qethernet(unittest.TestCase): def execute(self): # execute iperf command against the server if self.__bind is None: - p = sh.iperf("-c", self.__sip, "-x", "CMSV", "-n", self.__numbytestx, "-f", "m", "-p", self.__port) + p = sh.iperf("-c", self.__serverip, "-x", "CMSV", "-n", self.__numbytestx, "-f", "m", "-p", self.__port) else: - p = sh.iperf("-c", self.__sip, "-x", "CMSV", "-n", self.__numbytestx, "-f", "m", "-p", self.__port, "-B", + p = sh.iperf("-c", self.__serverip, "-x", "CMSV", "-n", self.__numbytestx, "-f", "m", "-p", self.__port, "-B", self.__bind) # check if it was executed succesfully if p.exit_code == 0: @@ -53,7 +53,7 @@ class Qethernet(unittest.TestCase): bwreal = b[0] # check if BW is in the expected range - self.failUnless(float(bwreal) > float(self.__OKBW) * 0.9, + self.failUnless(float(bwreal) > float(self.__bwexpected) * 0.9, "failed: speed is lower than spected. Speed(MB/s)" + str(bwreal)) else: self.fail("failed: could not complete iperf command") diff --git a/test-cli/test/tests/qram.py b/test-cli/test/tests/qram.py index 1b66e5c..ade7aeb 100644 --- a/test-cli/test/tests/qram.py +++ b/test-cli/test/tests/qram.py @@ -3,17 +3,17 @@ import sh class Qram(unittest.TestCase): - __memSize = "10M" + __memsize = "10M" __loops = "1" - # varlist: memSize, loops + # varlist: memsize, loops def __init__(self, testname, testfunc, varlist): super(Qram, self).__init__(testfunc) - if "memSize" in varlist: - self.__memSize = varlist["memSize"] + if "memsize" in varlist: + self.__memsize = varlist["memsize"] else: - raise Exception('memSize param inside Qram must be defined') + raise Exception('memsize param inside Qram must be defined') if "loops" in varlist: self.__loops = varlist["loops"] else: @@ -22,6 +22,6 @@ class Qram(unittest.TestCase): def execute(self): try: - sh.memtester(self.__memSize, "1") + sh.memtester(self.__memsize, "1") except sh.ErrorReturnCode as e: self.fail("failed: could not complete memtester command") |