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

Add computer systems to inventory #8

Merged
merged 1 commit into from
Jun 13, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def physical_servers
:location_led_state => s["IndicatorLED"],
:physical_rack_id => 0
)
persister.computer_systems.build(:managed_entity => server)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ def initialize_inventory_collections
collections = %i(
physical_servers
physical_server_details
computer_systems
)
add_inventory_collections(physical_infra, collections)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class PhysicalInfraManager < ManageIQ::Providers::PhysicalInfraManager
:source => :asset_detail,
:through => :physical_servers,
:as => :physical_server
has_many :computer_systems,
:through => :physical_servers,
:as => :computer_system

def self.ems_type
@ems_type ||= "redfish_ph_infra".freeze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def assert_ems
expect(ems.physical_servers.count).to eq(1)
expect(ems.physical_servers.map(&:ems_ref)).to match_array([server_id])
expect(ems.physical_server_details.count).to eq(1)
expect(ems.computer_systems.count).to eq(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a simple assert for the computer_system?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not add it because there is not much to check here, since ComputerSystem model only contains two fields: id and type of its managed entity. I can check if those fields match the server's, but this only checks if the refresh system is working as expected and has nothing to do with Redfish provider.

end

def assert_physical_servers
Expand Down