Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_esapi: use tr_from_tpmpublic with NV index #311

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/test_esapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@ def test_plain_nv_define_write_read_undefine(self):
self.assertEqual(len(n), 68)
self.assertTrue(isinstance(n, str))

# Read the NV index using tr_from_tpmpublic
nv_handle = self.ectx.tr_from_tpmpublic(TPM2_HC.NV_INDEX_FIRST)
public_2, name_2 = self.ectx.nv_read_public(nv_handle)
self.assertEqual(public_2.marshal(), public.marshal())
self.assertEqual(name_2, name)
value = self.ectx.nv_read(nv_handle, 11)
self.assertEqual(bytes(value), b"hello world")
self.ectx.tr_close(nv_handle)
with self.assertRaises(TSS2_Exception):
self.ectx.nv_read_public(nv_handle)

self.ectx.nv_undefine_space(nv_index)

with self.assertRaises(TSS2_Exception):
Expand Down