DMTF / Redfish-Service-Validator

The Redfish Service Validator is a Python3 tool for checking conformance of any "device" with a Redfish service interface against Redfish CSDL schema
Other
40 stars 34 forks source link

Links in LogEntryCollection are not followed and checked #519

Closed jiaqingz-intel closed 3 months ago

jiaqingz-intel commented 1 year ago

Version: 2.2.1

Validator only checks the LogEntry in the response payload of LogEntryCollection, the LogEntry resourced linked at @odata.id is not checked. (Response time is 0 and HTTP status is -1)

image

When the LogEntry resources at @odata.id is incorrect, as validator skips them, no error reported.

image

tomasg2012 commented 1 year ago

Am I mistaken? The log is clearly showing a different payload. How is this happening in practice? I am confused.

Edit: Oh, nevermind. It is likely because the validator is not checking the DIRECT call to that odata.id, it is checking it from within the collection without GETting it from the service from it's URI twice (Note the 0ms response time).

I believe there's code in place for some URIs checked but not unique URIs like this. This is an assumption from the tool, and needs to be reported correctly.

jiaqingz-intel commented 1 year ago

Edit: Oh, nevermind. It is likely because the validator is not checking the DIRECT call to that odata.id, it is checking it from within the collection without GETting it from the service from it's URI twice (Note the 0ms response time).

Oh I see, in other LogEntryCollection, it also does not follow the link.

image

I believe there's code in place for some URIs checked but not unique URIs like this. This is an assumption from the tool, and needs to be reported correctly.

I think only not following the links with # is the correct behavior, like this

image

Anyway I'm going to update the issue.

blakehilliard commented 1 year ago

I am also seeing this error. In validateURITree() of validateResource.py, it goes down the path if link.Type is not None and link.Type.AutoExpand because AutoExpand is set to true for LogEntry in the tool. And so it assumes the the collection it already got was auto-expanded, even though it did not request it to be expanded. So then it processes just the odata.id object in Members as if it were the full LogEntry resource and complains that it is missing every field except odata.id.

mraineri commented 1 year ago

The collection is supposed to be expanded even if not requested; if LogEntryCollection does not show the contents of the LogEntry resources in the Members array, it's nonconformant.

mraineri commented 1 year ago

@blakehilliard to be clear, are you saying the collection is auto expanded and the case is it's treating it like it's not? Do you have a sample of what you're running exactly from the command line?

blakehilliard commented 1 year ago

Thanks, I was unaware a collection could have thiis auto-expansion requirement.

mraineri commented 1 year ago

To date, we only have that requirement on the LogEntryCollection (with the OData.AutoExpand term specified on the Members NavigationProperty). In theory it could be applied elsewhere, but there hasn't been a need to force expansion like with logs. The service validator dynamically looks for the OData.AutoExpand term to determine whether or not it should expect the expansion in the response (and validates accordingly).

mraineri commented 3 months ago

Closing; tool is functioning as designed and leveraging auto-expansion as the schema dictates.