Skip to content

Commit

Permalink
test: check for list, but ignore content in FAPI event log tests
Browse files Browse the repository at this point in the history
With the CEL support in FAPI we can not assume we will get an empty
event list, so check that we get a JSON list as a response, but
ignore the content of the list.

Signed-off-by: Erik Larsson <[email protected]>
  • Loading branch information
whooo authored and William Roberts committed Nov 3, 2022
1 parent 0c40a76 commit f490169
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/test_fapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def test_quote_verify(self, sign_key):
assert info_json["attest"]["type"] == "ATTEST_QUOTE"
assert type(signature) is bytes
pcr_log_json = json.loads(pcr_log)
assert pcr_log_json == []
assert type(pcr_log_json) == list
assert certificate == ""

# TODO verify via openssl
Expand Down Expand Up @@ -518,8 +518,9 @@ def test_get_empty_platform_certificates_fail(self):

def test_pcr_read(self):
value, log = self.fapi.pcr_read(7)
log_json = json.loads(log)
assert value == b"\0" * 32
assert log == "[\n]"
assert type(log_json) == list

def test_pcr_extend_read(self):
index = 16
Expand Down

0 comments on commit f490169

Please sign in to comment.