summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio López <emilio.lopez@collabora.co.uk>2015-09-07 12:00:23 (GMT)
committerEmilio López <emilio.lopez@collabora.co.uk>2015-10-06 17:55:40 (GMT)
commit3506fb5644dec905977fa4b4c8bee6b6f1a116bf (patch)
tree26fcacb3109b38160e8a553c9536aedb7c9c6a26
parent43c10b5dd4409e9feaeefb91a4628d247b496fd6 (diff)
downloadtest-definitions-master.tar.gz
test-definitions-master.tar.xz
cros_ec: Add new test for vboot interface writeHEADmaster
Differential Revision: https://phabricator.collabora.co.uk/D161
-rwxr-xr-xkernel/cros_ec/scripts/cros-ec-test.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/kernel/cros_ec/scripts/cros-ec-test.py b/kernel/cros_ec/scripts/cros-ec-test.py
index a7f55d7..c8f5216 100755
--- a/kernel/cros_ec/scripts/cros-ec-test.py
+++ b/kernel/cros_ec/scripts/cros-ec-test.py
@@ -183,6 +183,44 @@ else:
if fd != None:
fd.close()
+
+print "Testing vboot context write"
+if exit_status == os.EX_OK:
+ ctx_original = None
+ try:
+ sfs = open(EC_SYSFS_PATH + "/vbc/vboot_context", 'r')
+ ctx_original = sfs.read()
+ sfs.close()
+
+ ctx_write = "0123456789012345"
+ sfs = open(EC_SYSFS_PATH + "/vbc/vboot_context", 'w')
+ sfs.write(ctx_write)
+ sfs.close()
+
+ sfs = open(EC_SYSFS_PATH + "/vbc/vboot_context", 'r')
+ ctx_new = sfs.read()
+ sfs.close()
+
+ if ctx_new == ctx_write:
+ print "ec-vboot-ctx-write: pass"
+ else:
+ print "Wrote {}, but read back {}".format(ctx_write, ctx_new)
+ print "ec-vboot-ctx-write: fail"
+
+ except IOError as e:
+ print "I/O error({0}): {1}".format(e.errno, e.strerror)
+ print "ec-vboot-ctx-write: fail"
+ exit_status = os.EX_IOERR
+
+ finally:
+ if ctx_original is not None:
+ with open(EC_SYSFS_PATH + "/vbc/vboot_context", 'w') as sfs:
+ sfs.write(ctx_original)
+
+else:
+ print "ec-vboot-ctx-write: unknown"
+
+
print "Testing EC sysfs interface"
try: