fog-google 1.25.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/integration-compute-core.yml +2 -2
  3. data/.github/workflows/integration-compute-instance_groups.yml +2 -2
  4. data/.github/workflows/integration-compute-loadbalancing.yml +2 -2
  5. data/.github/workflows/integration-compute-networking.yml +2 -2
  6. data/.github/workflows/integration-monitoring.yml +2 -2
  7. data/.github/workflows/integration-pubsub.yml +2 -2
  8. data/.github/workflows/integration-sql.yml +2 -2
  9. data/.github/workflows/integration-storage.yml +2 -2
  10. data/.github/workflows/unit.yml +2 -2
  11. data/CHANGELOG.md +46 -27
  12. data/SECURITY.md +3 -14
  13. data/fog-google.gemspec +2 -3
  14. data/lib/fog/google/compute/models/server.rb +1 -1
  15. data/lib/fog/google/storage/storage_json/real.rb +4 -2
  16. data/lib/fog/google/storage/storage_json/utils.rb +4 -2
  17. data/lib/fog/google/storage/storage_xml/real.rb +4 -2
  18. data/lib/fog/google/storage/storage_xml/requests/get_bucket.rb +1 -1
  19. data/lib/fog/google/storage/storage_xml/utils.rb +4 -2
  20. data/lib/fog/google/version.rb +1 -1
  21. metadata +5 -198
  22. data/.github/workflows/stale.yml +0 -23
  23. data/test/helpers/client_helper.rb +0 -63
  24. data/test/helpers/integration_test_helper.rb +0 -108
  25. data/test/helpers/test_collection.rb +0 -60
  26. data/test/helpers/test_helper.rb +0 -28
  27. data/test/integration/compute/core_compute/test_client_options.rb +0 -12
  28. data/test/integration/compute/core_compute/test_coverage.rb +0 -6
  29. data/test/integration/compute/core_compute/test_disk_types.rb +0 -43
  30. data/test/integration/compute/core_compute/test_disks.rb +0 -53
  31. data/test/integration/compute/core_compute/test_images.rb +0 -32
  32. data/test/integration/compute/core_compute/test_machine_types.rb +0 -55
  33. data/test/integration/compute/core_compute/test_operations.rb +0 -45
  34. data/test/integration/compute/core_compute/test_projects.rb +0 -19
  35. data/test/integration/compute/core_compute/test_regions.rb +0 -33
  36. data/test/integration/compute/core_compute/test_servers.rb +0 -235
  37. data/test/integration/compute/core_compute/test_snapshots.rb +0 -21
  38. data/test/integration/compute/core_compute/test_zones.rb +0 -35
  39. data/test/integration/compute/core_networking/test_addresses.rb +0 -107
  40. data/test/integration/compute/core_networking/test_coverage.rb +0 -6
  41. data/test/integration/compute/core_networking/test_firewalls.rb +0 -11
  42. data/test/integration/compute/core_networking/test_networks.rb +0 -30
  43. data/test/integration/compute/core_networking/test_routes.rb +0 -26
  44. data/test/integration/compute/core_networking/test_subnetworks.rb +0 -11
  45. data/test/integration/compute/instance_groups/test_coverage.rb +0 -6
  46. data/test/integration/compute/instance_groups/test_instance_group_managers.rb +0 -11
  47. data/test/integration/compute/instance_groups/test_instance_groups.rb +0 -11
  48. data/test/integration/compute/instance_groups/test_instance_templates.rb +0 -11
  49. data/test/integration/compute/loadbalancing/test_backend_services.rb +0 -11
  50. data/test/integration/compute/loadbalancing/test_coverage.rb +0 -6
  51. data/test/integration/compute/loadbalancing/test_forwarding_rules.rb +0 -11
  52. data/test/integration/compute/loadbalancing/test_global_addresses.rb +0 -11
  53. data/test/integration/compute/loadbalancing/test_global_forwarding_rules.rb +0 -11
  54. data/test/integration/compute/loadbalancing/test_http_health_checks.rb +0 -11
  55. data/test/integration/compute/loadbalancing/test_ssl_certificates.rb +0 -11
  56. data/test/integration/compute/loadbalancing/test_target_http_proxies.rb +0 -11
  57. data/test/integration/compute/loadbalancing/test_target_https_proxies.rb +0 -11
  58. data/test/integration/compute/loadbalancing/test_target_instances.rb +0 -11
  59. data/test/integration/compute/loadbalancing/test_target_pools.rb +0 -55
  60. data/test/integration/compute/loadbalancing/test_url_maps.rb +0 -11
  61. data/test/integration/factories/addresses_factory.rb +0 -20
  62. data/test/integration/factories/backend_services_factory.rb +0 -19
  63. data/test/integration/factories/collection_factory.rb +0 -52
  64. data/test/integration/factories/disks_factory.rb +0 -22
  65. data/test/integration/factories/firewalls_factory.rb +0 -13
  66. data/test/integration/factories/forwarding_rules_factory.rb +0 -25
  67. data/test/integration/factories/global_addresses_factory.rb +0 -15
  68. data/test/integration/factories/global_forwarding_rules_factory.rb +0 -20
  69. data/test/integration/factories/http_health_checks_factory.rb +0 -11
  70. data/test/integration/factories/images_factory.rb +0 -16
  71. data/test/integration/factories/instance_group_manager_factory.rb +0 -30
  72. data/test/integration/factories/instance_groups_factory.rb +0 -20
  73. data/test/integration/factories/instance_template_factory.rb +0 -24
  74. data/test/integration/factories/networks_factory.rb +0 -14
  75. data/test/integration/factories/servers_factory.rb +0 -30
  76. data/test/integration/factories/sql_certs_factory.rb +0 -20
  77. data/test/integration/factories/sql_instances_factory.rb +0 -19
  78. data/test/integration/factories/sql_users_factory.rb +0 -23
  79. data/test/integration/factories/ssl_certificates_factory.rb +0 -13
  80. data/test/integration/factories/subnetworks_factory.rb +0 -26
  81. data/test/integration/factories/target_http_proxies_factory.rb +0 -19
  82. data/test/integration/factories/target_https_proxies_factory.rb +0 -26
  83. data/test/integration/factories/target_instances_factory.rb +0 -24
  84. data/test/integration/factories/target_pools_factory.rb +0 -28
  85. data/test/integration/factories/url_maps_factory.rb +0 -19
  86. data/test/integration/monitoring/test_coverage.rb +0 -6
  87. data/test/integration/monitoring/test_metric_descriptors.rb +0 -131
  88. data/test/integration/monitoring/test_monitored_resource_descriptors.rb +0 -37
  89. data/test/integration/monitoring/test_timeseries.rb +0 -253
  90. data/test/integration/pubsub/pubsub_shared.rb +0 -75
  91. data/test/integration/pubsub/test_coverage.rb +0 -6
  92. data/test/integration/pubsub/test_pubsub_models.rb +0 -135
  93. data/test/integration/pubsub/test_pubsub_requests.rb +0 -105
  94. data/test/integration/sql/test_certs.rb +0 -50
  95. data/test/integration/sql/test_common_flags.rb +0 -31
  96. data/test/integration/sql/test_common_tiers.rb +0 -26
  97. data/test/integration/sql/test_coverage.rb +0 -6
  98. data/test/integration/sql/test_instances.rb +0 -101
  99. data/test/integration/sql/test_users.rb +0 -37
  100. data/test/integration/storage/storage_shared.rb +0 -101
  101. data/test/integration/storage/test_buckets.rb +0 -112
  102. data/test/integration/storage/test_coverage.rb +0 -6
  103. data/test/integration/storage/test_directories.rb +0 -67
  104. data/test/integration/storage/test_files.rb +0 -168
  105. data/test/integration/storage/test_objects.rb +0 -226
  106. data/test/integration/test_authentication.rb +0 -38
  107. data/test/unit/compute/test_common_collections.rb +0 -42
  108. data/test/unit/compute/test_common_models.rb +0 -35
  109. data/test/unit/compute/test_disk.rb +0 -26
  110. data/test/unit/compute/test_server.rb +0 -29
  111. data/test/unit/dns/test_common_collections.rb +0 -43
  112. data/test/unit/monitoring/test_comon_collections.rb +0 -44
  113. data/test/unit/pubsub/test_common_collections.rb +0 -35
  114. data/test/unit/sql/test_common_collections.rb +0 -46
  115. data/test/unit/storage/test_common_json_collections.rb +0 -38
  116. data/test/unit/storage/test_common_xml_collections.rb +0 -50
  117. data/test/unit/storage/test_json_requests.rb +0 -60
  118. data/test/unit/storage/test_xml_requests.rb +0 -60
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/instance_group_manager_factory"
3
-
4
- class TestInstanceGroupManagers < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].instance_group_managers
9
- @factory = InstanceGroupManagerFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/instance_groups_factory"
3
-
4
- class TestInstanceGroups < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].instance_groups
9
- @factory = InstanceGroupsFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/instance_template_factory"
3
-
4
- class TestInstanceTemplates < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].instance_templates
9
- @factory = InstanceTemplateFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/backend_services_factory"
3
-
4
- class TestBackendServices < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].backend_services
9
- @factory = BackendServicesFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,6 +0,0 @@
1
- require "helpers/integration_test_helper"
2
-
3
- # This is a simple coverage helper that helps differentiate
4
- # the tests when run in parallel so the final coverage report
5
- # can be properly combined together from multiple runners
6
- SimpleCov.command_name "test:compute-loadbalancing" if ENV["COVERAGE"]
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/forwarding_rules_factory"
3
-
4
- class TestForwardingRules < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].forwarding_rules
9
- @factory = ForwardingRulesFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/global_addresses_factory"
3
-
4
- class TestGlobalAddresses < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].global_addresses
9
- @factory = GlobalAddressesFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/global_forwarding_rules_factory"
3
-
4
- class TestGlobalForwardingRules < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].global_forwarding_rules
9
- @factory = GlobalForwardingRulesFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/http_health_checks_factory"
3
-
4
- class TestHttpHealthChecks < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].http_health_checks
9
- @factory = HttpHealthChecksFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/ssl_certificates_factory"
3
-
4
- class TestSslCertificates < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].ssl_certificates
9
- @factory = SslCertificatesFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/target_http_proxies_factory"
3
-
4
- class TestTargetHttpProxies < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].target_http_proxies
9
- @factory = TargetHttpProxiesFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/target_https_proxies_factory"
3
-
4
- class TestTargetHttpsProxies < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].target_https_proxies
9
- @factory = TargetHttpsProxiesFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/target_instances_factory"
3
-
4
- class TestTargetInstances < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].target_instances
9
- @factory = TargetInstancesFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,55 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/target_pools_factory"
3
-
4
- class TestTargetPools < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].target_pools
9
- @factory = TargetPoolsFactory.new(namespaced_name)
10
- @servers = Fog::Compute[:google].servers
11
- end
12
-
13
- # Override to include zone in get request
14
- def get_resource(identity)
15
- @subject.get(identity, TEST_ZONE)
16
- end
17
-
18
- def test_get_health
19
- target_pool = @factory.create
20
- server = @servers.get(target_pool.instances[0].split("/").last)
21
- server.wait_for { ready? }
22
-
23
- # XXX This is not partucularly elegant but if the instance doesn't respond
24
- # to the healthcheck at all (for example there's nothing listening) it'll
25
- # enter "No instance health info was found." state, during which the API
26
- # will return an empty health object instead of UNHEALTHY.
27
- # To avoid setting up a brittle environment with a live healthcheck we just
28
- # stop the instance so health check returns UNHEALTHY and we can test that
29
- # all fields are returned correctly.
30
- server.stop
31
- server.wait_for { stopped? }
32
-
33
- # There's no way to track the readiness of the instance resource in a target pool,
34
- # so wrapping in a soft retry:
35
- begin
36
- retries ||= 0
37
- target_pool.get_health
38
- rescue ::Google::Apis::ClientError
39
- sleep 25
40
- retry if (retries += 1) < 3
41
- end
42
-
43
- refute_empty(target_pool.health_checks, "Target pool should have a health check")
44
- assert_equal(2, target_pool.instances.count, "Target pool should have 2 instances")
45
- assert_equal([{ :health_state => "UNHEALTHY",
46
- :instance => server.self_link }],
47
- target_pool.get_health[server.self_link],
48
- "Target pool should return a proper health check list")
49
- assert_equal({ server.self_link =>
50
- [{ :health_state => "UNHEALTHY",
51
- :instance => server.self_link }] },
52
- target_pool.get_health(server.name),
53
- "target_pool should return instance health details when an instance is specified")
54
- end
55
- end
@@ -1,11 +0,0 @@
1
- require "helpers/integration_test_helper"
2
- require "integration/factories/url_maps_factory"
3
-
4
- class TestUrlMaps < FogIntegrationTest
5
- include TestCollection
6
-
7
- def setup
8
- @subject = Fog::Compute[:google].url_maps
9
- @factory = UrlMapsFactory.new(namespaced_name)
10
- end
11
- end
@@ -1,20 +0,0 @@
1
- require "integration/factories/collection_factory"
2
-
3
- class AddressesFactory < CollectionFactory
4
- def initialize(example)
5
- super(Fog::Compute[:google].addresses, example)
6
- end
7
-
8
- def get(identity)
9
- @subject.get(identity, TEST_REGION)
10
- end
11
-
12
- def all
13
- @subject.all(region: TEST_REGION)
14
- end
15
-
16
- def params
17
- { :name => resource_name,
18
- :region => TEST_REGION }
19
- end
20
- end
@@ -1,19 +0,0 @@
1
- require "integration/factories/collection_factory"
2
- require "integration/factories/http_health_checks_factory"
3
-
4
- class BackendServicesFactory < CollectionFactory
5
- def initialize(example)
6
- @http_health_checks = HttpHealthChecksFactory.new(example)
7
- super(Fog::Compute[:google].backend_services, example)
8
- end
9
-
10
- def cleanup
11
- super
12
- @http_health_checks.cleanup
13
- end
14
-
15
- def params
16
- { :name => resource_name,
17
- :health_checks => [@http_health_checks.create.self_link] }
18
- end
19
- end
@@ -1,52 +0,0 @@
1
- class CollectionFactory
2
- PREFIX = "fog-test".freeze
3
-
4
- def initialize(subject, example)
5
- @subject = subject
6
- @example = example
7
- @resource_counter = 0
8
- end
9
-
10
- # Cleans up all objects created by the factory in the current test suite.
11
- #
12
- # @param async [FalseClass or TrueClass] perform resource destruction asynchronously
13
- def cleanup(async = false)
14
- suit_name = @example.gsub(/\W/, "").tr("_", "-").downcase.split("-")[0]
15
- resources = @subject.all.select { |resource| resource.name.match(/#{PREFIX}-[0-9]*-#{suit_name}/) }
16
- if DEBUG
17
- p "Cleanup invoked in #{self} for example: #{@example}"
18
- p "Resources to be deleted: #{resources.map { |r| r.name }}"
19
- p "All subject resources: #{@subject.all.map { |s| s.name }}"
20
- end
21
- resources.each { |r| r.destroy(async) }
22
- resources.each { |r| Fog.wait_for { !@subject.all.map(&:identity).include? r.identity } }
23
- end
24
-
25
- # Creates a collection object instance e.g. Fog::Google::Compute::Server
26
- #
27
- # @param custom_params [Hash] override factory creation parameters or provide
28
- # additional ones. Useful in tests where you need to create a slightly different
29
- # resource than the default one but still want to take advantage of the factory's
30
- # cleanup methods, etc.
31
- #
32
- # @example Create a custom factory
33
- # @factory = ServersFactory.new(namespaced_name)
34
- # server = @factory.create(:machine_type => "f1-micro")
35
- #
36
- # @return [Object] collection object instance
37
- def create(custom_params = {})
38
- @subject.create(params.merge(custom_params))
39
- end
40
-
41
- def get(identity)
42
- @subject.get(identity)
43
- end
44
-
45
- def resource_name(base = @example, prefix = PREFIX)
46
- index = @resource_counter += 1
47
- # In prefix, convert - to _ to make sure that it doesn't get stripped by the \W strip below.
48
- # Then, concatenate prefix, index, and base; strip all non-alphanumerics except _;
49
- # convert _ to -; downcase; truncate to 62 characters; delete trailing -
50
- [prefix.tr("-", "_"), index, base].join("_").gsub(/\W/, "").tr("_", "-").downcase[0..61].chomp("-")
51
- end
52
- end
@@ -1,22 +0,0 @@
1
- require "integration/factories/collection_factory"
2
-
3
- class DisksFactory < CollectionFactory
4
- def initialize(example)
5
- super(Fog::Compute[:google].disks, example)
6
- end
7
-
8
- def get(identity)
9
- @subject.get(identity, TEST_ZONE)
10
- end
11
-
12
- def all
13
- @subject.all(zone: TEST_ZONE)
14
- end
15
-
16
- def params
17
- { :name => resource_name,
18
- :zone_name => TEST_ZONE,
19
- :source_image => TEST_IMAGE,
20
- :size_gb => TEST_SIZE_GB }
21
- end
22
- end
@@ -1,13 +0,0 @@
1
- require "integration/factories/collection_factory"
2
-
3
- class FirewallsFactory < CollectionFactory
4
- def initialize(example)
5
- super(Fog::Compute[:google].firewalls, example)
6
- end
7
-
8
- def params
9
- { :name => resource_name,
10
- :allowed => [{ :ip_protocol => "TCP",
11
- :ports => ["201"] }] }
12
- end
13
- end
@@ -1,25 +0,0 @@
1
- require "integration/factories/collection_factory"
2
- require "integration/factories/target_pools_factory"
3
-
4
- class ForwardingRulesFactory < CollectionFactory
5
- def initialize(example)
6
- @target_pools = TargetPoolsFactory.new(example)
7
- super(Fog::Compute[:google].forwarding_rules, example)
8
- end
9
-
10
- def cleanup
11
- super
12
- @target_pools.cleanup
13
- end
14
-
15
- def all
16
- @subject.all(region: TEST_REGION)
17
- end
18
-
19
- def params
20
- { :name => resource_name,
21
- :port_range => "80-80",
22
- :region => TEST_REGION,
23
- :target => @target_pools.create.self_link }
24
- end
25
- end
@@ -1,15 +0,0 @@
1
- require "integration/factories/collection_factory"
2
-
3
- class GlobalAddressesFactory < CollectionFactory
4
- def initialize(example)
5
- super(Fog::Compute[:google].global_addresses, example)
6
- end
7
-
8
- def get(identity)
9
- @subject.get(identity)
10
- end
11
-
12
- def params
13
- { :name => resource_name }
14
- end
15
- end
@@ -1,20 +0,0 @@
1
- require "integration/factories/collection_factory"
2
- require "integration/factories/target_http_proxies_factory"
3
-
4
- class GlobalForwardingRulesFactory < CollectionFactory
5
- def initialize(example)
6
- @targets = TargetHttpProxiesFactory.new(example)
7
- super(Fog::Compute[:google].global_forwarding_rules, example)
8
- end
9
-
10
- def cleanup
11
- super
12
- @targets.cleanup
13
- end
14
-
15
- def params
16
- { :name => resource_name,
17
- :port_range => "80-80",
18
- :target => @targets.create.self_link }
19
- end
20
- end
@@ -1,11 +0,0 @@
1
- require "integration/factories/collection_factory"
2
-
3
- class HttpHealthChecksFactory < CollectionFactory
4
- def initialize(example)
5
- super(Fog::Compute[:google].http_health_checks, example)
6
- end
7
-
8
- def params
9
- { :name => resource_name }
10
- end
11
- end
@@ -1,16 +0,0 @@
1
- require "integration/factories/collection_factory"
2
-
3
- class ImagesFactory < CollectionFactory
4
- def initialize(example)
5
- super(Fog::Compute[:google].images, example)
6
- end
7
-
8
- def get(identity)
9
- @subject.get(identity, TEST_PROJECT)
10
- end
11
-
12
- def params
13
- { :name => resource_name,
14
- :raw_disk => { :source => TEST_RAW_DISK_SOURCE } }
15
- end
16
- end
@@ -1,30 +0,0 @@
1
- require "integration/factories/collection_factory"
2
- require "integration/factories/instance_template_factory"
3
-
4
- class InstanceGroupManagerFactory < CollectionFactory
5
- def initialize(example)
6
- super(Fog::Compute[:google].instance_group_managers, example)
7
- @instance_template = InstanceTemplateFactory.new(example)
8
- end
9
-
10
- def cleanup
11
- super
12
- @instance_template.cleanup
13
- end
14
-
15
- def get(identity)
16
- @subject.get(identity, TEST_ZONE)
17
- end
18
-
19
- def all
20
- @subject.all(zone: TEST_ZONE)
21
- end
22
-
23
- def params
24
- { :name => resource_name,
25
- :zone => TEST_ZONE,
26
- :base_instance_name => resource_name,
27
- :target_size => 1,
28
- :instance_template => @instance_template.create }
29
- end
30
- end
@@ -1,20 +0,0 @@
1
- require "integration/factories/collection_factory"
2
-
3
- class InstanceGroupsFactory < CollectionFactory
4
- def initialize(example)
5
- super(Fog::Compute[:google].instance_groups, example)
6
- end
7
-
8
- def get(identity)
9
- @subject.get(identity, TEST_ZONE)
10
- end
11
-
12
- def all
13
- @subject.all(zone: TEST_ZONE)
14
- end
15
-
16
- def params
17
- { :name => resource_name,
18
- :zone => TEST_ZONE }
19
- end
20
- end
@@ -1,24 +0,0 @@
1
- require "integration/factories/collection_factory"
2
-
3
- class InstanceTemplateFactory < CollectionFactory
4
- def initialize(example)
5
- super(Fog::Compute[:google].instance_templates, example)
6
- end
7
-
8
- def params
9
- {
10
- :name => resource_name,
11
- # TODO: Properties config is convoluted, needs to be refactored
12
- :properties => {
13
- :machine_type => TEST_MACHINE_TYPE,
14
- :disks => [{
15
- :boot => true,
16
- :auto_delete => true,
17
- :initialize_params =>
18
- { :source_image => "projects/ubuntu-os-cloud/global/images/ubuntu-1804-bionic-v20180522" }
19
- }],
20
- :network_interfaces => [{ :network => "global/networks/default" }]
21
- }
22
- }
23
- end
24
- end
@@ -1,14 +0,0 @@
1
- require "integration/factories/collection_factory"
2
-
3
- class NetworksFactory < CollectionFactory
4
- def initialize(example)
5
- super(Fog::Compute[:google].networks, example)
6
- end
7
-
8
- def params
9
- {
10
- :name => resource_name,
11
- :auto_create_subnetworks => true
12
- }
13
- end
14
- end
@@ -1,30 +0,0 @@
1
- require "integration/factories/collection_factory"
2
- require "integration/factories/disks_factory"
3
-
4
- class ServersFactory < CollectionFactory
5
- def initialize(example)
6
- @disks = DisksFactory.new(example)
7
- super(Fog::Compute[:google].servers, example)
8
- end
9
-
10
- def cleanup
11
- # Disk cleanup sometimes fails if server deletion has not been completed
12
- super(false)
13
- @disks.cleanup
14
- end
15
-
16
- def get(identity)
17
- @subject.get(identity, TEST_ZONE)
18
- end
19
-
20
- def all
21
- @subject.all(zone: TEST_ZONE)
22
- end
23
-
24
- def params
25
- { :name => resource_name,
26
- :zone => TEST_ZONE,
27
- :machine_type => TEST_MACHINE_TYPE,
28
- :disks => [@disks.create] }
29
- end
30
- end
@@ -1,20 +0,0 @@
1
- require "integration/factories/collection_factory"
2
- require "integration/factories/sql_instances_factory"
3
-
4
- class SqlCertsFactory < CollectionFactory
5
- def initialize(example)
6
- @instances = SqlInstancesFactory.new(example)
7
- super(Fog::Google[:sql].ssl_certs, example)
8
- end
9
-
10
- def cleanup
11
- # Certs will be cleaned up with the test instance.
12
- @instances.cleanup
13
- end
14
-
15
- def params
16
- # Certificate name should not be longer than 16 characters
17
- { :common_name => resource_name,
18
- :instance => @instances.create.name }
19
- end
20
- end
@@ -1,19 +0,0 @@
1
- require "integration/factories/collection_factory"
2
-
3
- class SqlInstancesFactory < CollectionFactory
4
- def initialize(example)
5
- super(Fog::Google[:sql].instances, example)
6
- end
7
-
8
- def cleanup
9
- super
10
- end
11
-
12
- def params
13
- # Name has a time suffix due to SQL resources API objects having
14
- # a _very_ long life on the backend (n(days)) after deletion.
15
- { :name => "#{resource_name}-#{Time.now.to_i}",
16
- :region => TEST_SQL_REGION,
17
- :tier => TEST_SQL_TIER }
18
- end
19
- end
@@ -1,23 +0,0 @@
1
- require "integration/factories/collection_factory"
2
- require "integration/factories/sql_instances_factory"
3
-
4
- class SqlUsersFactory < CollectionFactory
5
- def initialize(example)
6
- @instances = SqlInstancesFactory.new(example)
7
- super(Fog::Google[:sql].users, example)
8
- end
9
-
10
- def cleanup
11
- # Users will be cleaned up with the test instance.
12
- @instances.cleanup
13
- end
14
-
15
- def params
16
- # Username should not be longer than 16 characters
17
- { :name => resource_name[0..15],
18
- # TODO: Consider removing host when Users.list API issue is resolved
19
- # See https://github.com/fog/fog-google/issues/462
20
- :host => "%",
21
- :instance => @instances.create.name }
22
- end
23
- end
@@ -1,13 +0,0 @@
1
- require "integration/factories/collection_factory"
2
-
3
- class SslCertificatesFactory < CollectionFactory
4
- def initialize(example)
5
- super(Fog::Compute[:google].ssl_certificates, example)
6
- end
7
-
8
- def params
9
- { :name => resource_name,
10
- :certificate => TEST_PEM_CERTIFICATE,
11
- :private_key => TEST_PEM_CERTIFICATE_PRIVATE_KEY }
12
- end
13
- end