Commit 6da70580 authored by Tadeusz Struk's avatar Tadeusz Struk Committed by James Morris

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: default avatarTadeusz Struk <tadeusz.struk@intel.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: default avatarJames Morris <james.morris@microsoft.com>
parent f1a0ba6c
...@@ -358,9 +358,9 @@ class Client: ...@@ -358,9 +358,9 @@ class Client:
self.flags = flags self.flags = flags
if (self.flags & Client.FLAG_SPACE) == 0: if (self.flags & Client.FLAG_SPACE) == 0:
self.tpm = open('/dev/tpm0', 'r+b') self.tpm = open('/dev/tpm0', 'r+b', buffering=0)
else: else:
self.tpm = open('/dev/tpmrm0', 'r+b') self.tpm = open('/dev/tpmrm0', 'r+b', buffering=0)
def close(self): def close(self):
self.tpm.close() self.tpm.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment