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

Missing or invalid Resources do not result in a Fail #159

Closed
jyundt opened this issue Jun 23, 2022 · 3 comments · Fixed by #164
Closed

Missing or invalid Resources do not result in a Fail #159

jyundt opened this issue Jun 23, 2022 · 3 comments · Fixed by #164

Comments

@jyundt
Copy link

jyundt commented Jun 23, 2022

Related to this redfishforum.com post, a defined Resource in an Interop Profile will not result in a Fail when that Resource is missing / not detected.

As an example, this profile provides as Pass as expected:

{
        "SchemaDefinition": "RedfishInteroperabilityProfile.v1_5_0",
        "ProfileName": "test",
	"ProfileVersion": "0.0.1",
        "Resources": {
                "Chassis": {
			"ReadRequirement": "Mandatory",
			"MinVersion": "1.0.1"
		}
	}
}

pass screenshot

However, if I list a Resource that is not present, I'm not getting any type of Fail. Example:

{
        "SchemaDefinition": "RedfishInteroperabilityProfile.v1_5_0",
        "ProfileName": "test",
	"ProfileVersion": "0.0.1",
        "Resources": {
                "FOO": {
			"ReadRequirement": "Mandatory",
			"MinVersion": "1.0.1"
		}
	}
}

fail screenshot

(edit: fixed typo for the "working" Chassis example)

@mraineri
Copy link
Contributor

Definitely a bug; we'll need to look into this

@JordanCHW
Copy link
Contributor

JordanCHW commented Jul 12, 2022

Hmm, I thought that's expected? Doesn't we only validate the resource requirement when that resource exists in the Redfish tree?

(I also found this before, for example we have some property requirements for resourceA, the validation would pass when the Redfish service reports 0 resources for resourceA. So I need to add MinCount requirement for resourceA's collection to ensure there're resources reported, then we could do further checks.)

@mraineri
Copy link
Contributor

The default requirement on a resource is "Mandatory" when you stub it out like that. So, the expectation is at least one instance of the resource must exist. If you add "ReadRequirement: Recommended" at the root level of the resource definition, you can loosen it to be optional.

MinCount is used specifically for arrays. It is possible to achieve similar behavior by specifying "MinCount" in "Members" for a resource collection though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants