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

Aws targetted and full refresh specs for ebs storage manager #185

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -39,8 +39,10 @@ def expected_table_counts
:availability_zone => 5,
:cloud_network => 5,
:cloud_subnet => 10,
:custom_attribute => 52,
:disk => 32,
:cloud_volume => 45,
:cloud_volume_snapshot => 21,
:custom_attribute => 50,
:disk => 34,
:ext_management_system => 4,
:firewall_rule => 155,
:flavor => 76,
Expand Down Expand Up @@ -70,6 +72,8 @@ def expected_table_counts
def assert_table_counts
actual = {
:auth_private_key => AuthPrivateKey.count,
:cloud_volume => CloudVolume.count,
:cloud_volume_snapshot => CloudVolumeSnapshot.count,
:ext_management_system => ExtManagementSystem.count,
:flavor => Flavor.count,
:availability_zone => AvailabilityZone.count,
Expand Down Expand Up @@ -388,6 +392,7 @@ def assert_specific_vm_powered_on
)

expect(v.hardware.disks.size).to eq(1) # TODO: Change to a flavor that has disks
expect(v.cloud_volumes.pluck(:name, :volume_type)).to match_array([["EmsRefreshSpec-PoweredOn-Basic3-root", "standard"]])
expect(v.hardware.guest_devices.size).to eq(0)
expect(v.hardware.nics.size).to eq(0)

Expand Down
Expand Up @@ -34,6 +34,7 @@
VCR.use_cassette(described_class.name.underscore + '_inventory_object') do
EmsRefresh.refresh(@ems)
EmsRefresh.refresh(@ems.network_manager)
EmsRefresh.refresh(@ems.ebs_storage_manager)
end
@ems.reload

Expand Down
Expand Up @@ -14,6 +14,7 @@
VCR.use_cassette("#{described_class.name.underscore}_other_region") do
EmsRefresh.refresh(@ems)
EmsRefresh.refresh(@ems.network_manager)
EmsRefresh.refresh(@ems.ebs_storage_manager)
end
@ems.reload

Expand All @@ -38,6 +39,8 @@ def expected_table_counts
:availability_zone => 3,
:cloud_network => 1,
:cloud_subnet => 2,
:cloud_volume => 3,
:cloud_volume_snapshot => 1,
:custom_attribute => 5,
:disk => 4,
:ext_management_system => 4,
Expand Down
Expand Up @@ -18,6 +18,7 @@
VCR.use_cassette(described_class.name.underscore) do
EmsRefresh.refresh(@ems)
EmsRefresh.refresh(@ems.network_manager)
EmsRefresh.refresh(@ems.ebs_storage_manager)
end
@ems.reload

Expand Down
Expand Up @@ -43,6 +43,38 @@
end
@ems.reload

expected_counts = {
:auth_private_key => 1,
:availability_zone => 1,
:cloud_network => 0,
:cloud_subnet => 0,
:cloud_volume => 1,
:cloud_volume_snapshot => 0,
:custom_attribute => 2,
:disk => 1,
:firewall_rule => 13,
:floating_ip => 1,
:guest_device => 0,
:hardware => 2,
:miq_template => 1,
:network => 2,
:network_port => 1,
:network_router => 0,
:operating_system => 0,
:orchestration_stack => 0,
:orchestration_stack_output => 0,
:orchestration_stack_parameter => 0,
:orchestration_stack_resource => 0,
:orchestration_template => 0,
:relationship => 2,
:security_group => 2,
:snapshot => 0,
:vm => 1,
:vm_or_template => 2
}

assert_targeted_table_counts(expected_counts)

assert_specific_flavor
assert_specific_key_pair
assert_specific_az
Expand Down Expand Up @@ -74,4 +106,38 @@ def create_flavors
:ephemeral_disk_size => 0,
:ephemeral_disk_count => 0)
end

def assert_targeted_table_counts(expected_table_counts)
actual = {
:auth_private_key => AuthPrivateKey.count,
:availability_zone => AvailabilityZone.count,
:cloud_subnet => CloudSubnet.count,
:cloud_network => CloudNetwork.count,
:cloud_volume => CloudVolume.count,
:cloud_volume_snapshot => CloudVolumeSnapshot.count,
:custom_attribute => CustomAttribute.count,
:vm_or_template => VmOrTemplate.count,
:vm => Vm.count,
:miq_template => MiqTemplate.count,
:disk => Disk.count,
:guest_device => GuestDevice.count,
:hardware => Hardware.count,
:network => Network.count,
:operating_system => OperatingSystem.count,
:snapshot => Snapshot.count,
:relationship => Relationship.count,
:orchestration_template => OrchestrationTemplate.count,
:orchestration_stack => OrchestrationStack.count,
:orchestration_stack_parameter => OrchestrationStackParameter.count,
:orchestration_stack_output => OrchestrationStackOutput.count,
:orchestration_stack_resource => OrchestrationStackResource.count,
:security_group => SecurityGroup.count,
:firewall_rule => FirewallRule.count,
:network_port => NetworkPort.count,
:floating_ip => FloatingIp.count,
:network_router => NetworkRouter.count,
}

expect(actual).to eq expected_table_counts
end
end