Skip to content

Commit

Permalink
Update VCRs for fog-openstack v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed May 10, 2023
1 parent 6979148 commit 725a6d5
Show file tree
Hide file tree
Showing 2 changed files with 3,258 additions and 3,960 deletions.
167 changes: 84 additions & 83 deletions spec/models/manageiq/providers/ibm_cic/cloud_manager/refresher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,77 +33,77 @@

def assert_table_counts
expect(ems.availability_zones.count).to eq(2)
expect(ems.cloud_resource_quotas.count).to eq(46)
expect(ems.cloud_resource_quotas.count).to eq(26)
expect(ems.cloud_services.count).to eq(5)
expect(ems.cloud_tenants.count).to eq(2)
expect(ems.cloud_tenants.count).to eq(1)
expect(ems.flavors.count).to eq(9)
expect(ems.host_aggregates.count).to eq(1)
expect(ems.miq_templates.count).to eq(1)
expect(ems.vms.count).to eq(6)
expect(ems.miq_templates.count).to eq(2)
expect(ems.vms.count).to eq(11)

expect(ems.network_manager.cloud_networks.count).to eq(1)
expect(ems.network_manager.cloud_subnets.count).to eq(1)
expect(ems.network_manager.network_ports.count).to eq(6)
expect(ems.network_manager.network_routers.count).to eq(0)
expect(ems.network_manager.cloud_networks.count).to eq(6)
expect(ems.network_manager.cloud_subnets.count).to eq(3)
expect(ems.network_manager.network_ports.count).to eq(12)
expect(ems.network_manager.network_routers.count).to eq(3)
expect(ems.network_manager.security_groups.count).to eq(3)
expect(ems.network_manager.firewall_rules.count).to eq(12)
expect(ems.network_manager.firewall_rules.count).to eq(10)
end

def assert_specific_availability_zone
az = ems.availability_zones.find_by(:ems_ref => "Default Group")
az = ems.availability_zones.find_by(:ems_ref => "Default_Group")
expect(az).to have_attributes(
:name => "Default Group",
:ems_ref => "Default Group",
:name => "Default_Group",
:ems_ref => "Default_Group",
:type => "ManageIQ::Providers::IbmCic::CloudManager::AvailabilityZone",
:provider_services_supported => array_including("compute")
)
end

def assert_specific_cloud_resource_quota
crq = ems.cloud_resource_quotas.find_by(:ems_ref => "[\"1ae3ec2ccd8f41b8851aca05f264f19a\", \"cores\"]")
crq = ems.cloud_resource_quotas.find_by(:ems_ref => "[\"9de7cab5c5f34f8382d2465d5197fa88\", \"cores\"]")
expect(crq).to have_attributes(
:ems_ref => "[\"1ae3ec2ccd8f41b8851aca05f264f19a\", \"cores\"]",
:ems_ref => "[\"9de7cab5c5f34f8382d2465d5197fa88\", \"cores\"]",
:service_name => "Compute",
:name => "cores",
:value => 55_000,
:value => 35_000,
:type => "ManageIQ::Providers::IbmCic::CloudManager::CloudResourceQuota",
:cloud_tenant => ems.cloud_tenants.find_by(:ems_ref => "1ae3ec2ccd8f41b8851aca05f264f19a")
:cloud_tenant => ems.cloud_tenants.find_by(:name => "ibm-default")
)
end

def assert_specific_cloud_service
cloud_service = ems.cloud_services.find_by(:ems_ref => "6")
cloud_service = ems.cloud_services.find_by(:ems_ref => "7")
expect(cloud_service).to have_attributes(
:ems_ref => "6",
:ems_ref => "7",
:source => "compute",
:executable_name => "nova-compute",
:hostname => "BOEIAAS3",
:hostname => "os006",
:status => "up",
:scheduling_disabled => false,
:availability_zone => ems.availability_zones.find_by(:ems_ref => "Default Group")
:availability_zone => ems.availability_zones.find_by(:ems_ref => "Default_Group")
)
end

def assert_specific_cloud_tenant
tenant = ems.cloud_tenants.find_by(:ems_ref => "a0311bc440e64cbe90c1b947e171335a")
tenant = ems.cloud_tenants.find_by(:ems_ref => "9de7cab5c5f34f8382d2465d5197fa88")
expect(tenant).to have_attributes(
:name => "ibm-default",
:description => "IBM Default Tenant",
:enabled => true,
:ems_ref => "a0311bc440e64cbe90c1b947e171335a",
:ems_ref => "9de7cab5c5f34f8382d2465d5197fa88",
:type => "ManageIQ::Providers::IbmCic::CloudManager::CloudTenant"
)
end

def assert_specific_flavor
flavor = ems.flavors.find_by(:ems_ref => "2f86d489086a7cff82052bc7f3f04567")
flavor = ems.flavors.find_by(:ems_ref => "074510d32ec4fd3253ba5e690efac4ce")
expect(flavor).to have_attributes(
:name => "2f86d489086a7cff82052bc7f3f04567",
:name => "074510d32ec4fd3253ba5e690efac4ce",
:description => "1 CPUs, 4 GB RAM, 10 GB Root Disk",
:cpu_total_cores => 1,
:cpu_cores_per_socket => nil,
:memory => 4.gigabytes,
:ems_ref => "2f86d489086a7cff82052bc7f3f04567",
:ems_ref => "074510d32ec4fd3253ba5e690efac4ce",
:type => "ManageIQ::Providers::IbmCic::CloudManager::Flavor",
:supports_32_bit => nil,
:supports_64_bit => nil,
Expand All @@ -121,7 +121,7 @@ def assert_specific_flavor
def assert_specific_host_aggregate
ha = ems.host_aggregates.find_by(:ems_ref => "1")
expect(ha).to have_attributes(
:name => "Default Group",
:name => "Default_Group",
:ems_ref => "1",
:type => "ManageIQ::Providers::IbmCic::CloudManager::HostAggregate",
:metadata => hash_including(
Expand All @@ -138,132 +138,133 @@ def assert_specific_host_aggregate
"runtimepolicy-threshold" => "70",
"runtimepolicy-max_parallel" => "10",
"runtimepolicy-action" => "migrate_vm_advise_only",
"availability_zone" => "Default Group"
"availability_zone" => "Default_Group"
}
)
)
end

def assert_specific_miq_template
image = ems.miq_templates.find_by(:ems_ref => "d3f1f3db-9c81-46cc-b5ea-dda649e2ab9d")
image = ems.miq_templates.find_by(:name => "rhel83")
expect(image).to have_attributes(
:vendor => "ibm_z_vm",
:name => "rhel77",
:name => "rhel83",
:description => nil,
:location => "unknown",
:uid_ems => "d3f1f3db-9c81-46cc-b5ea-dda649e2ab9d",
:uid_ems => "c7cec3a7-85f8-4d06-8881-07b7bfbfb8a9",
:power_state => "never",
:type => "ManageIQ::Providers::IbmCic::CloudManager::Template",
:ems_ref => "d3f1f3db-9c81-46cc-b5ea-dda649e2ab9d",
:ems_ref => "c7cec3a7-85f8-4d06-8881-07b7bfbfb8a9",
:raw_power_state => "never"
)
expect(image.cloud_tenants).to include(ems.cloud_tenants.find_by(:ems_ref => "a0311bc440e64cbe90c1b947e171335a"))
expect(image.cloud_tenants).to include(ems.cloud_tenants.find_by(:name => "ibm-default"))
end

def assert_specific_vm
vm = ems.vms.find_by(:ems_ref => "5856ae52-fb89-47ab-9b7a-62c5adbacd98")
vm = ems.vms.find_by(:name => "vm-1")
expect(vm).to have_attributes(
:vendor => "ibm_z_vm",
:name => "rhel77-662",
:name => "vm-1",
:description => nil,
:location => "unknown",
:uid_ems => "5856ae52-fb89-47ab-9b7a-62c5adbacd98",
:uid_ems => "db956241-dd02-49f3-9858-80a7ef0e740f",
:power_state => "on",
:connection_state => "connected",
:type => "ManageIQ::Providers::IbmCic::CloudManager::Vm",
:ems_ref => "5856ae52-fb89-47ab-9b7a-62c5adbacd98",
:flavor => ems.flavors.find_by(:ems_ref => "8071ddc45015d3d11b8c880f008cfc0e"),
:availability_zone => ems.availability_zones.find_by(:ems_ref => "Default Group"),
:cloud_tenant => ems.cloud_tenants.find_by(:ems_ref => "a0311bc440e64cbe90c1b947e171335a"),
:ems_ref => "db956241-dd02-49f3-9858-80a7ef0e740f",
:flavor => ems.flavors.find_by(:name => "074510d32ec4fd3253ba5e690efac4ce"),
:availability_zone => ems.availability_zones.find_by(:name => "Default_Group"),
:cloud_tenant => ems.cloud_tenants.find_by(:name => "ibm-default"),
:raw_power_state => "ACTIVE"
)
end

def assert_specific_cloud_network
network = ems.network_manager.cloud_networks.find_by(:ems_ref => "c83cb025-7717-496d-b5dd-4bfa655ee719")
network = ems.network_manager.cloud_networks.find_by(:name => "Test_Network_1")
expect(network).to have_attributes(
:name => "vlan16",
:ems_ref => "c83cb025-7717-496d-b5dd-4bfa655ee719",
:name => "Test_Network_1",
:ems_ref => "3118b2d5-4109-4702-96a7-760ace75a86d",
:cidr => nil,
:status => "active",
:enabled => true,
:external_facing => false,
:cloud_tenant => ems.cloud_tenants.find_by(:ems_ref => "a0311bc440e64cbe90c1b947e171335a"),
:shared => true,
:provider_physical_network => "icicvlan1",
:provider_network_type => "vlan",
:provider_segmentation_id => "16",
:cloud_tenant => ems.cloud_tenants.find_by(:name => "ibm-default"),
:shared => false,
:provider_physical_network => "icicvlan2",
:provider_network_type => "flat",
:provider_segmentation_id => nil,
:vlan_transparent => nil,
:extra_attributes => hash_including(
{
:port_security_enabled => true,
:maximum_transmission_unit => 1_500
}
:port_security_enabled => true,
:qos_policy_id => nil,
:maximum_transmission_unit => 0
),
:type => "ManageIQ::Providers::IbmCic::NetworkManager::CloudNetwork::Private",
:description => nil
)
end

def assert_specific_cloud_subnet
subnet = ems.network_manager.cloud_subnets.first
subnet = ems.network_manager.cloud_subnets.find_by(:ems_ref => "06218699-3dac-43a6-981f-4d1d78606070")
expect(subnet).to have_attributes(
:name => "vlan16a",
:ems_ref => "ea84b706-143d-4ebf-ad2d-4edd35ff6d11",
:cloud_network => ems.cloud_networks.find_by(:ems_ref => "c83cb025-7717-496d-b5dd-4bfa655ee719"),
:cidr => "10.16.2.0/24",
:name => "flat1",
:ems_ref => "06218699-3dac-43a6-981f-4d1d78606070",
:cloud_network => ems.cloud_networks.find_by(:ems_ref => "b73787b9-0c62-4822-8eaa-8c91753e66df"),
:cidr => "172.26.0.0/24",
:status => "active",
:dhcp_enabled => false,
:gateway => "10.16.2.1",
:gateway => "172.26.0.1",
:network_protocol => "ipv4",
:cloud_tenant => ems.cloud_tenants.find_by(:ems_ref => "a0311bc440e64cbe90c1b947e171335a"),
:cloud_tenant => ems.cloud_tenants.find_by(:name => "ibm-default"),
:dns_nameservers => [],
:extra_attributes => hash_including(
{
:allocation_pools => array_including({"start" => "10.16.2.2", "end" => "10.16.2.254"}),
:host_routes => [],
:ip_version => 4
}
:allocation_pools => array_including({"end"=>"172.26.0.254", "start"=>"172.26.0.2"}),
:host_routes => [],
:ip_version => 4
),
:type => "ManageIQ::Providers::IbmCic::NetworkManager::CloudSubnet"
)
end

def assert_specific_network_port
port = ems.network_manager.network_ports.find_by(:ems_ref => "22c1a29e-454b-4f6d-a2d8-27c0b0e8a4be")
port = ems.network_manager.network_ports.find_by(:ems_ref => "a17ab4da-7751-494c-8f6c-48b3fb2cb17a")
expect(port).to have_attributes(
:type => "ManageIQ::Providers::IbmCic::NetworkManager::NetworkPort",
:name => "fa:16:3e:59:d7:77",
:ems_ref => "22c1a29e-454b-4f6d-a2d8-27c0b0e8a4be",
:mac_address => "fa:16:3e:59:d7:77",
:name => "fa:16:3e:fc:29:19",
:ems_ref => "a17ab4da-7751-494c-8f6c-48b3fb2cb17a",
:mac_address => "fa:16:3e:fc:29:19",
:status => "ACTIVE",
:admin_state_up => true,
:device_owner => "compute:Default Group",
:device_ref => "5856ae52-fb89-47ab-9b7a-62c5adbacd98",
:device => ems.vms.find_by(:ems_ref => "5856ae52-fb89-47ab-9b7a-62c5adbacd98"),
:cloud_tenant => ems.cloud_tenants.find_by(:ems_ref => "a0311bc440e64cbe90c1b947e171335a"),
:binding_host_id => "BOEIAAS3",
:binding_virtual_interface_type => "zvm",
:device_owner => "compute:Default_Group",
:device_ref => "db956241-dd02-49f3-9858-80a7ef0e740f",
:device => ems.vms.find_by(:name => "vm-1"),
:cloud_tenant => ems.cloud_tenants.find_by(:name => "ibm-default"),
:binding_host_id => "os006",
:binding_virtual_interface_type => "ovs",
:extra_attributes => hash_including(
{
:binding_virtual_nic_type => "normal",
:binding_virtual_interface_details => hash_including(
"connectivity" => "legacy",
"port_filter" => false
)
}
:binding_virtual_nic_type => "normal",
:extra_dhcp_opts => [],
:allowed_address_pairs => [],
:binding_virtual_interface_details => hash_including(
"connectivity" => "l2",
"port_filter" => true,
"ovs_hybrid_plug" => false,
"datapath_type" => "system",
"bridge_name" => "br-int"
),
:binding_profile => {}
)
)
end

def assert_specific_security_group
security_group = ems.network_manager.security_groups.find_by(:ems_ref => "0269a5ce-e5f1-4d55-8ba2-8263a73acc8b")
security_group = ems.network_manager.security_groups.find_by(:ems_ref => "799e6994-e7cd-4b4c-b485-a52926fae489")
expect(security_group).to have_attributes(
:name => "default",
:description => "Default security group",
:type => "ManageIQ::Providers::IbmCic::NetworkManager::SecurityGroup",
:ems_ref => "0269a5ce-e5f1-4d55-8ba2-8263a73acc8b",
:cloud_tenant => ems.cloud_tenants.find_by(:ems_ref => "1ae3ec2ccd8f41b8851aca05f264f19a")
:ems_ref => "799e6994-e7cd-4b4c-b485-a52926fae489",
:cloud_tenant => ems.cloud_tenants.find_by(:name => "ibm-default")
)
end
end
Loading

0 comments on commit 725a6d5

Please sign in to comment.