summaryrefslogtreecommitdiff
path: root/test-cli/test/tests/qeeprom.py
diff options
context:
space:
mode:
authorHector Fernandez <hector@iatec.biz>2020-03-05 18:50:47 +0100
committerHector Fernandez <hector@iatec.biz>2020-03-05 18:50:47 +0100
commitdd9ffc52507c391271d0821636c683fd7562b46a (patch)
treeaf9cffa6c0be8606ea0bb3eda032a170d2b1b6d8 /test-cli/test/tests/qeeprom.py
parenta615dac03a9ea7897bf3947ba8d31278b2cea121 (diff)
downloadboard-dd9ffc52507c391271d0821636c683fd7562b46a.zip
board-dd9ffc52507c391271d0821636c683fd7562b46a.tar.gz
board-dd9ffc52507c391271d0821636c683fd7562b46a.tar.bz2
Modified postgre functions.
Diffstat (limited to 'test-cli/test/tests/qeeprom.py')
-rw-r--r--test-cli/test/tests/qeeprom.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/test-cli/test/tests/qeeprom.py b/test-cli/test/tests/qeeprom.py
index 5bb0755..c2293c2 100644
--- a/test-cli/test/tests/qeeprom.py
+++ b/test-cli/test/tests/qeeprom.py
@@ -5,10 +5,9 @@ import unittest
class Qeeprom(unittest.TestCase):
__position = None
- __uuid = None
__eeprompath = None
- # varlist: position, uuid, eeprompath
+ # varlist: position, eeprompath
def __init__(self, testname, testfunc, varlist):
super(Qeeprom, self).__init__(testfunc)
self._testMethodDoc = testname
@@ -16,25 +15,23 @@ class Qeeprom(unittest.TestCase):
self.__position = varlist["position"]
else:
raise Exception('position param inside Qeeprom must be defined')
- if "uuid" in varlist:
- self.__uuid = varlist["uuid"]
- else:
- raise Exception('uuid param inside Qeeprom must be defined')
if "eeprompath" in varlist:
self.__eeprompath = varlist["eeprompath"]
else:
raise Exception('eeprompath param inside Qeeprom must be defined')
def execute(self):
+ # generate some data
+ data_tx = "isee_test"
# write data into the eeprom
- p = sh.dd(sh.echo(self._uuid), "of=" + self.__eeprompath, "bs=1", "seek=" + self.__position)
+ 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(self.__uuid))
+ p = sh.dd("if=" + self.__eeprompath, "bs=1", "skip=" + self.__position, "count=" + len(data_tx))
if p.exit_code == 0:
- uuid_rx = p.stdout.decode('ascii')
+ data_rx = p.stdout.decode('ascii')
# compare both values
- if (uuid_rx != self.__uuid):
+ if data_rx != data_tx:
self.fail("failed: mismatch between written and received values.")
else: