Skip to content

Commit

Permalink
vmsdk: fetch real time data in the API
Browse files Browse the repository at this point in the history
* Re-do the processing each time calling the API
* fix minor typo

Signed-off-by: Ruoyu Ying <ruoyu.ying@intel.com>
  • Loading branch information
Ruoyu-y committed Jan 19, 2024
1 parent e3dcb82 commit 629914b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion vmsdk/python/cctrusted_vm/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_measurement_count(self) -> int:
for DRTM).
Beyond the real mesurement register, some SDK may extend virtual measurement
reigster for addtional trust chain like container, namespace, cluster in
reigster for additional trust chain like container, namespace, cluster in
cloud native paradiagm.
Returns:
Expand Down Expand Up @@ -86,6 +86,9 @@ def get_measurement(self, imr_select:[int, int]) -> TcgIMR:
if algo_id is None or algo_id is TcgAlgorithmRegistry.TPM_ALG_ERROR:
algo_id = self._cvm.default_algo_id

# Re-do the processing to fetch the latest measurements
self._cvm.process_cc_report()

return self._cvm.imrs[imr_index]

def get_quote(
Expand Down Expand Up @@ -123,6 +126,10 @@ def get_eventlog(self, start:int = None, count:int = None) -> TcgEventLog:
Returns:
``TcgEventLog`` object.
"""

# Re-do the processing to fetch the latest event logs
self._cvm.process_eventlog()

event_logs = TcgEventLog(self._cvm.cc_event_log)
event_logs.select(start, count)

Expand Down

0 comments on commit 629914b

Please sign in to comment.