aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTadeusz Struk <tadeusz.struk@intel.com>2019-02-12 15:42:05 -0800
committerJames Morris <james.morris@microsoft.com>2019-04-08 15:58:55 -0700
commit6da70580af9612accf042b37564d73e787af39b4 (patch)
treed34765e2d838f5b139ab38d7f2b3f7bc43fe2a84
parentf1a0ba6cccff75d882204cae1f154f17620b3c4a (diff)
download96b-common-6da70580af9612accf042b37564d73e787af39b4.tar.gz
selftests/tpm2: Open tpm dev in unbuffered mode
In order to have control over how many bytes are read or written the device needs to be opened in unbuffered mode. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: James Morris <james.morris@microsoft.com>
-rw-r--r--tools/testing/selftests/tpm2/tpm2.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/tpm2/tpm2.py b/tools/testing/selftests/tpm2/tpm2.py
index 6fc99ce025b5..828c18584624 100644
--- a/tools/testing/selftests/tpm2/tpm2.py
+++ b/tools/testing/selftests/tpm2/tpm2.py
@@ -358,9 +358,9 @@ class Client:
self.flags = flags
if (self.flags & Client.FLAG_SPACE) == 0:
- self.tpm = open('/dev/tpm0', 'r+b')
+ self.tpm = open('/dev/tpm0', 'r+b', buffering=0)
else:
- self.tpm = open('/dev/tpmrm0', 'r+b')
+ self.tpm = open('/dev/tpmrm0', 'r+b', buffering=0)
def close(self):
self.tpm.close()