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

make getting Chassis collection work with DPU BMCs #323

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion redfish/chassis.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ func (chassis *Chassis) UnmarshalJSON(b []byte) error {
temp
Assembly common.Link
Certificates common.Link
Controls common.Links
Controls common.Link
Drives common.Link
EnvironmentMetrics common.Link
FabricAdapters common.Link
Expand Down Expand Up @@ -504,6 +504,7 @@ func (chassis *Chassis) UnmarshalJSON(b []byte) error {
// Extract the links to other entities for later
chassis.assembly = t.Assembly.String()
chassis.certificates = t.Certificates.String()
chassis.controls = t.Controls.String()
chassis.drives = t.Drives.String()
chassis.environmentMetrics = t.EnvironmentMetrics.String()
chassis.fabricAdapters = t.FabricAdapters.String()
Expand Down
7 changes: 7 additions & 0 deletions redfish/chassis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ var chassisBody = `{
"Assembly": {
"@odata.id": "/redfish/v1/Chassis/Chassis-1/Assembly"
},
"Controls": {
"@odata.id": "/redfish/v1/Chassis/Chassis-1/Controls"
},
"Drives": {
"@odata.id": "/redfish/v1/Chassis/Chassis-1/Drives"
},
Expand Down Expand Up @@ -155,6 +158,10 @@ func TestChassis(t *testing.T) {
t.Errorf("Received invalid assembly reference: %s", result.assembly)
}

if result.controls != "/redfish/v1/Chassis/Chassis-1/Controls" {
t.Errorf("Received invalid controls reference: %s", result.controls)
}

if result.drives != "/redfish/v1/Chassis/Chassis-1/Drives" {
t.Errorf("Received invalid drive reference: %s", result.drives)
}
Expand Down