Skip to content

Commit

Permalink
Merge pull request #483 from agrare/fix_duplicate_advanced_settings
Browse files Browse the repository at this point in the history
Fix duplicate advanced settings
  • Loading branch information
jaywcarman authored Feb 1, 2024
2 parents 5935588 + 9aa0356 commit fbf6db2
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class ManageIQ::Providers::IbmCloud::PowerVirtualServers::NetworkManager < Manag
:hostname,
:default_endpoint,
:endpoints,
:snapshots,
:refresh,
:refresh_ems,
:to => :parent_manager,
:allow_nil => true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class ManageIQ::Providers::IbmCloud::PowerVirtualServers::StorageManager < Manag
:hostname,
:default_endpoint,
:endpoints,
:key_pairs,
:snapshots,
:refresh,
:refresh_ems,
:to => :parent_manager,
:allow_nil => true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,88 @@
it "refreshes the child network_manager" do
2.times do
full_refresh(ems.network_manager)

ems.reload

assert_table_counts
assert_ems_counts
assert_specific_flavor
assert_specific_vm
assert_specific_template
assert_specific_key_pair
assert_specific_cloud_network
assert_specific_cloud_subnet
assert_specific_network_port
assert_specific_cloud_volume
assert_specific_placement_group
assert_volume_type_attribs
assert_cloud_manager
assert_specific_resource_pool
end
end

it "refreshes the child storage_manager" do
2.times do
full_refresh(ems.storage_manager)

ems.reload

assert_table_counts
assert_ems_counts
assert_specific_flavor
assert_specific_vm
assert_specific_template
assert_specific_key_pair
assert_specific_cloud_network
assert_specific_cloud_subnet
assert_specific_network_port
assert_specific_cloud_volume
assert_specific_placement_group
assert_volume_type_attribs
assert_cloud_manager
assert_specific_resource_pool
end
end

it "refreshes the cloud manager then network manager" do
2.times do
full_refresh(ems)

ems.reload

assert_table_counts
assert_ems_counts
assert_specific_flavor
assert_specific_vm
assert_specific_template
assert_specific_key_pair
assert_specific_cloud_network
assert_specific_cloud_subnet
assert_specific_network_port
assert_specific_cloud_volume
assert_specific_placement_group
assert_volume_type_attribs
assert_cloud_manager
assert_specific_resource_pool

full_refresh(ems.network_manager)

ems.reload

assert_table_counts
assert_ems_counts
assert_specific_flavor
assert_specific_vm
assert_specific_template
assert_specific_key_pair
assert_specific_cloud_network
assert_specific_cloud_subnet
assert_specific_network_port
assert_specific_cloud_volume
assert_specific_placement_group
assert_volume_type_attribs
assert_cloud_manager
assert_specific_resource_pool
end
end

Expand All @@ -76,7 +132,7 @@

it "doesn't impact other inventory" do
assert_inventory_not_changed do
with_vcr("vm_target") { EmsRefresh.refresh(target) }
with_vcr("vm_target") { target.refresh }
end
end
end
Expand All @@ -94,6 +150,7 @@ def assert_table_counts
expect(OperatingSystem.count).to eq(12)
expect(PlacementGroup.count).to eq(2)
expect(Vm.count).to eq(6)
expect(AdvancedSetting.count).to eq(18)
end

def assert_ems_counts
Expand Down Expand Up @@ -286,7 +343,7 @@ def assert_specific_resource_pool

def full_refresh(ems)
VCR.use_cassette(described_class.name.underscore) do
EmsRefresh.refresh(ems)
ems.refresh
end
end
end
Expand Down

0 comments on commit fbf6db2

Please sign in to comment.