fog-google 1.8.2 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (297) hide show
  1. checksums.yaml +5 -5
  2. data/.fog.example +1 -3
  3. data/.rubocop.yml +3 -3
  4. data/.travis.yml +5 -3
  5. data/CHANGELOG.md +126 -2
  6. data/CONTRIBUTING.md +0 -1
  7. data/README.md +59 -8
  8. data/SECURITY.md +16 -0
  9. data/ci/README.md +8 -8
  10. data/ci/build-head-pipeline.yml +173 -0
  11. data/ci/credentials.yml.template +0 -2
  12. data/ci/docker-image/Dockerfile +3 -3
  13. data/ci/{pipeline.yml → integration-pipeline.yml} +0 -33
  14. data/ci/pipeline-dev.yml +58 -0
  15. data/ci/tasks/run-int.sh +20 -3
  16. data/ci/tasks/run-int.yml +3 -1
  17. data/examples/sql/flags.rb +10 -6
  18. data/examples/sql/instances.rb +38 -34
  19. data/examples/sql/operations.rb +20 -16
  20. data/examples/sql/ssl_certs.rb +32 -28
  21. data/examples/sql/tiers.rb +10 -6
  22. data/fog-google.gemspec +3 -3
  23. data/lib/fog/compute/google.rb +5 -5
  24. data/lib/fog/compute/google/mock.rb +2 -1
  25. data/lib/fog/compute/google/models/address.rb +15 -2
  26. data/lib/fog/compute/google/models/disk.rb +6 -2
  27. data/lib/fog/compute/google/models/images.rb +6 -1
  28. data/lib/fog/compute/google/models/instance_groups.rb +2 -2
  29. data/lib/fog/compute/google/models/server.rb +33 -9
  30. data/lib/fog/compute/google/real.rb +2 -1
  31. data/lib/fog/compute/google/requests/abandon_instances.rb +2 -0
  32. data/lib/fog/compute/google/requests/add_backend_service_backends.rb +2 -0
  33. data/lib/fog/compute/google/requests/add_instance_group_instances.rb +2 -0
  34. data/lib/fog/compute/google/requests/add_server_access_config.rb +2 -0
  35. data/lib/fog/compute/google/requests/add_target_pool_health_checks.rb +2 -0
  36. data/lib/fog/compute/google/requests/add_target_pool_instances.rb +2 -0
  37. data/lib/fog/compute/google/requests/attach_disk.rb +2 -0
  38. data/lib/fog/compute/google/requests/create_disk_snapshot.rb +2 -0
  39. data/lib/fog/compute/google/requests/delete_address.rb +2 -0
  40. data/lib/fog/compute/google/requests/delete_backend_service.rb +2 -0
  41. data/lib/fog/compute/google/requests/delete_disk.rb +2 -0
  42. data/lib/fog/compute/google/requests/delete_firewall.rb +2 -0
  43. data/lib/fog/compute/google/requests/delete_forwarding_rule.rb +2 -0
  44. data/lib/fog/compute/google/requests/delete_global_address.rb +2 -0
  45. data/lib/fog/compute/google/requests/delete_global_forwarding_rule.rb +2 -0
  46. data/lib/fog/compute/google/requests/delete_global_operation.rb +2 -0
  47. data/lib/fog/compute/google/requests/delete_http_health_check.rb +2 -0
  48. data/lib/fog/compute/google/requests/delete_image.rb +2 -0
  49. data/lib/fog/compute/google/requests/delete_instance_group.rb +2 -0
  50. data/lib/fog/compute/google/requests/delete_instance_group_manager.rb +2 -0
  51. data/lib/fog/compute/google/requests/delete_instance_template.rb +2 -0
  52. data/lib/fog/compute/google/requests/delete_network.rb +2 -0
  53. data/lib/fog/compute/google/requests/delete_region_operation.rb +2 -0
  54. data/lib/fog/compute/google/requests/delete_route.rb +2 -0
  55. data/lib/fog/compute/google/requests/delete_server.rb +2 -0
  56. data/lib/fog/compute/google/requests/delete_server_access_config.rb +2 -0
  57. data/lib/fog/compute/google/requests/delete_snapshot.rb +2 -0
  58. data/lib/fog/compute/google/requests/delete_ssl_certificate.rb +2 -0
  59. data/lib/fog/compute/google/requests/delete_subnetwork.rb +2 -0
  60. data/lib/fog/compute/google/requests/delete_target_http_proxy.rb +2 -0
  61. data/lib/fog/compute/google/requests/delete_target_https_proxy.rb +2 -0
  62. data/lib/fog/compute/google/requests/delete_target_instance.rb +2 -0
  63. data/lib/fog/compute/google/requests/delete_target_pool.rb +2 -0
  64. data/lib/fog/compute/google/requests/delete_url_map.rb +2 -0
  65. data/lib/fog/compute/google/requests/delete_zone_operation.rb +2 -0
  66. data/lib/fog/compute/google/requests/deprecate_image.rb +2 -0
  67. data/lib/fog/compute/google/requests/detach_disk.rb +2 -0
  68. data/lib/fog/compute/google/requests/expand_subnetwork_ip_cidr_range.rb +2 -0
  69. data/lib/fog/compute/google/requests/get_address.rb +2 -0
  70. data/lib/fog/compute/google/requests/get_backend_service_health.rb +2 -0
  71. data/lib/fog/compute/google/requests/get_disk.rb +2 -0
  72. data/lib/fog/compute/google/requests/get_disk_type.rb +2 -0
  73. data/lib/fog/compute/google/requests/get_firewall.rb +2 -0
  74. data/lib/fog/compute/google/requests/get_forwarding_rule.rb +2 -0
  75. data/lib/fog/compute/google/requests/get_global_address.rb +2 -0
  76. data/lib/fog/compute/google/requests/get_global_forwarding_rule.rb +2 -0
  77. data/lib/fog/compute/google/requests/get_global_operation.rb +2 -0
  78. data/lib/fog/compute/google/requests/get_http_health_check.rb +2 -0
  79. data/lib/fog/compute/google/requests/get_image.rb +2 -0
  80. data/lib/fog/compute/google/requests/get_image_from_family.rb +2 -0
  81. data/lib/fog/compute/google/requests/get_instance_group.rb +2 -0
  82. data/lib/fog/compute/google/requests/get_instance_group_manager.rb +2 -0
  83. data/lib/fog/compute/google/requests/get_instance_template.rb +2 -0
  84. data/lib/fog/compute/google/requests/get_machine_type.rb +2 -0
  85. data/lib/fog/compute/google/requests/get_network.rb +2 -0
  86. data/lib/fog/compute/google/requests/get_project.rb +2 -0
  87. data/lib/fog/compute/google/requests/get_region.rb +2 -0
  88. data/lib/fog/compute/google/requests/get_route.rb +2 -0
  89. data/lib/fog/compute/google/requests/get_server.rb +2 -0
  90. data/lib/fog/compute/google/requests/get_server_serial_port_output.rb +2 -0
  91. data/lib/fog/compute/google/requests/get_snapshot.rb +2 -0
  92. data/lib/fog/compute/google/requests/get_ssl_certificate.rb +2 -0
  93. data/lib/fog/compute/google/requests/get_subnetwork.rb +2 -0
  94. data/lib/fog/compute/google/requests/get_target_http_proxy.rb +2 -0
  95. data/lib/fog/compute/google/requests/get_target_https_proxy.rb +2 -0
  96. data/lib/fog/compute/google/requests/get_target_instance.rb +2 -0
  97. data/lib/fog/compute/google/requests/get_target_pool.rb +2 -0
  98. data/lib/fog/compute/google/requests/get_target_pool_health.rb +2 -0
  99. data/lib/fog/compute/google/requests/get_url_map.rb +2 -0
  100. data/lib/fog/compute/google/requests/get_zone.rb +2 -0
  101. data/lib/fog/compute/google/requests/get_zone_operation.rb +2 -0
  102. data/lib/fog/compute/google/requests/insert_address.rb +2 -0
  103. data/lib/fog/compute/google/requests/insert_backend_service.rb +2 -0
  104. data/lib/fog/compute/google/requests/insert_disk.rb +8 -5
  105. data/lib/fog/compute/google/requests/insert_firewall.rb +2 -0
  106. data/lib/fog/compute/google/requests/insert_forwarding_rule.rb +2 -0
  107. data/lib/fog/compute/google/requests/insert_global_address.rb +2 -0
  108. data/lib/fog/compute/google/requests/insert_global_forwarding_rule.rb +2 -0
  109. data/lib/fog/compute/google/requests/insert_http_health_check.rb +2 -0
  110. data/lib/fog/compute/google/requests/insert_image.rb +2 -0
  111. data/lib/fog/compute/google/requests/insert_instance_group.rb +2 -0
  112. data/lib/fog/compute/google/requests/insert_instance_group_manager.rb +2 -0
  113. data/lib/fog/compute/google/requests/insert_instance_template.rb +2 -0
  114. data/lib/fog/compute/google/requests/insert_network.rb +2 -0
  115. data/lib/fog/compute/google/requests/insert_route.rb +2 -0
  116. data/lib/fog/compute/google/requests/insert_server.rb +6 -0
  117. data/lib/fog/compute/google/requests/insert_ssl_certificate.rb +2 -0
  118. data/lib/fog/compute/google/requests/insert_subnetwork.rb +2 -0
  119. data/lib/fog/compute/google/requests/insert_target_http_proxy.rb +2 -0
  120. data/lib/fog/compute/google/requests/insert_target_https_proxy.rb +2 -0
  121. data/lib/fog/compute/google/requests/insert_target_instance.rb +2 -0
  122. data/lib/fog/compute/google/requests/insert_target_pool.rb +2 -0
  123. data/lib/fog/compute/google/requests/insert_url_map.rb +2 -0
  124. data/lib/fog/compute/google/requests/invalidate_url_map_cache.rb +2 -0
  125. data/lib/fog/compute/google/requests/list_addresses.rb +2 -0
  126. data/lib/fog/compute/google/requests/list_aggregated_addresses.rb +2 -0
  127. data/lib/fog/compute/google/requests/list_aggregated_disk_types.rb +2 -0
  128. data/lib/fog/compute/google/requests/list_aggregated_disks.rb +2 -0
  129. data/lib/fog/compute/google/requests/list_aggregated_forwarding_rules.rb +2 -0
  130. data/lib/fog/compute/google/requests/list_aggregated_instance_group_managers.rb +2 -0
  131. data/lib/fog/compute/google/requests/list_aggregated_instance_groups.rb +2 -0
  132. data/lib/fog/compute/google/requests/list_aggregated_machine_types.rb +2 -0
  133. data/lib/fog/compute/google/requests/list_aggregated_servers.rb +2 -0
  134. data/lib/fog/compute/google/requests/list_aggregated_subnetworks.rb +2 -0
  135. data/lib/fog/compute/google/requests/list_aggregated_target_instances.rb +2 -0
  136. data/lib/fog/compute/google/requests/list_aggregated_target_pools.rb +2 -0
  137. data/lib/fog/compute/google/requests/list_disk_types.rb +2 -0
  138. data/lib/fog/compute/google/requests/list_disks.rb +2 -0
  139. data/lib/fog/compute/google/requests/list_firewalls.rb +2 -0
  140. data/lib/fog/compute/google/requests/list_forwarding_rules.rb +2 -0
  141. data/lib/fog/compute/google/requests/list_global_addresses.rb +2 -0
  142. data/lib/fog/compute/google/requests/list_global_forwarding_rules.rb +2 -0
  143. data/lib/fog/compute/google/requests/list_global_operations.rb +2 -0
  144. data/lib/fog/compute/google/requests/list_http_health_checks.rb +2 -0
  145. data/lib/fog/compute/google/requests/list_images.rb +2 -0
  146. data/lib/fog/compute/google/requests/list_instance_group_instances.rb +2 -0
  147. data/lib/fog/compute/google/requests/list_instance_group_managers.rb +2 -0
  148. data/lib/fog/compute/google/requests/list_instance_groups.rb +2 -0
  149. data/lib/fog/compute/google/requests/list_instance_templates.rb +2 -0
  150. data/lib/fog/compute/google/requests/list_machine_types.rb +2 -0
  151. data/lib/fog/compute/google/requests/list_networks.rb +2 -0
  152. data/lib/fog/compute/google/requests/list_region_operations.rb +2 -0
  153. data/lib/fog/compute/google/requests/list_regions.rb +2 -0
  154. data/lib/fog/compute/google/requests/list_routes.rb +2 -0
  155. data/lib/fog/compute/google/requests/list_servers.rb +2 -0
  156. data/lib/fog/compute/google/requests/list_snapshots.rb +2 -0
  157. data/lib/fog/compute/google/requests/list_ssl_certificates.rb +2 -0
  158. data/lib/fog/compute/google/requests/list_subnetworks.rb +2 -0
  159. data/lib/fog/compute/google/requests/list_target_http_proxies.rb +2 -0
  160. data/lib/fog/compute/google/requests/list_target_https_proxies.rb +2 -0
  161. data/lib/fog/compute/google/requests/list_target_instances.rb +2 -0
  162. data/lib/fog/compute/google/requests/list_target_pools.rb +2 -0
  163. data/lib/fog/compute/google/requests/list_url_maps.rb +2 -0
  164. data/lib/fog/compute/google/requests/list_zone_operations.rb +2 -0
  165. data/lib/fog/compute/google/requests/list_zones.rb +2 -0
  166. data/lib/fog/compute/google/requests/patch_firewall.rb +2 -0
  167. data/lib/fog/compute/google/requests/patch_url_map.rb +2 -0
  168. data/lib/fog/compute/google/requests/recreate_instances.rb +2 -0
  169. data/lib/fog/compute/google/requests/remove_instance_group_instances.rb +2 -0
  170. data/lib/fog/compute/google/requests/remove_target_pool_health_checks.rb +2 -0
  171. data/lib/fog/compute/google/requests/remove_target_pool_instance.rb +2 -0
  172. data/lib/fog/compute/google/requests/remove_target_pool_instances.rb +2 -0
  173. data/lib/fog/compute/google/requests/reset_server.rb +2 -0
  174. data/lib/fog/compute/google/requests/reset_windows_password.rb +154 -0
  175. data/lib/fog/compute/google/requests/set_common_instance_metadata.rb +2 -0
  176. data/lib/fog/compute/google/requests/set_forwarding_rule_target.rb +2 -0
  177. data/lib/fog/compute/google/requests/set_global_forwarding_rule_target.rb +2 -0
  178. data/lib/fog/compute/google/requests/set_instance_template.rb +2 -0
  179. data/lib/fog/compute/google/requests/set_server_disk_auto_delete.rb +2 -0
  180. data/lib/fog/compute/google/requests/set_server_machine_type.rb +23 -0
  181. data/lib/fog/compute/google/requests/set_server_metadata.rb +3 -1
  182. data/lib/fog/compute/google/requests/set_server_scheduling.rb +2 -0
  183. data/lib/fog/compute/google/requests/set_server_tags.rb +2 -0
  184. data/lib/fog/compute/google/requests/set_snapshot_labels.rb +2 -0
  185. data/lib/fog/compute/google/requests/set_subnetwork_private_ip_google_access.rb +2 -0
  186. data/lib/fog/compute/google/requests/set_target_http_proxy_url_map.rb +2 -0
  187. data/lib/fog/compute/google/requests/set_target_https_proxy_ssl_certificates.rb +2 -0
  188. data/lib/fog/compute/google/requests/set_target_https_proxy_url_map.rb +2 -0
  189. data/lib/fog/compute/google/requests/set_target_pool_backup.rb +2 -0
  190. data/lib/fog/compute/google/requests/start_server.rb +2 -0
  191. data/lib/fog/compute/google/requests/stop_server.rb +2 -0
  192. data/lib/fog/compute/google/requests/update_firewall.rb +2 -0
  193. data/lib/fog/compute/google/requests/update_http_health_check.rb +2 -0
  194. data/lib/fog/compute/google/requests/update_url_map.rb +2 -0
  195. data/lib/fog/compute/google/requests/validate_url_map.rb +2 -0
  196. data/lib/fog/dns/google.rb +1 -1
  197. data/lib/fog/dns/google/requests/create_change.rb +2 -0
  198. data/lib/fog/dns/google/requests/create_managed_zone.rb +2 -0
  199. data/lib/fog/dns/google/requests/delete_managed_zone.rb +2 -0
  200. data/lib/fog/dns/google/requests/get_change.rb +2 -0
  201. data/lib/fog/dns/google/requests/get_managed_zone.rb +2 -0
  202. data/lib/fog/dns/google/requests/get_project.rb +2 -0
  203. data/lib/fog/dns/google/requests/list_changes.rb +2 -0
  204. data/lib/fog/dns/google/requests/list_managed_zones.rb +2 -0
  205. data/lib/fog/dns/google/requests/list_resource_record_sets.rb +2 -0
  206. data/lib/fog/google/models/sql/ssl_cert.rb +7 -1
  207. data/lib/fog/google/models/sql/user.rb +2 -0
  208. data/lib/fog/google/monitoring.rb +2 -1
  209. data/lib/fog/google/pubsub.rb +1 -1
  210. data/lib/fog/google/requests/monitoring/create_metric_descriptor.rb +2 -0
  211. data/lib/fog/google/requests/monitoring/create_timeseries.rb +3 -1
  212. data/lib/fog/google/requests/monitoring/delete_metric_descriptor.rb +2 -0
  213. data/lib/fog/google/requests/monitoring/get_metric_descriptor.rb +2 -0
  214. data/lib/fog/google/requests/monitoring/list_monitored_resource_descriptors.rb +2 -0
  215. data/lib/fog/google/requests/monitoring/list_timeseries.rb +2 -0
  216. data/lib/fog/google/requests/pubsub/pull_subscription.rb +5 -1
  217. data/lib/fog/google/requests/sql/clone_instance.rb +2 -0
  218. data/lib/fog/google/requests/sql/delete_backup_run.rb +2 -0
  219. data/lib/fog/google/requests/sql/delete_instance.rb +2 -0
  220. data/lib/fog/google/requests/sql/delete_ssl_cert.rb +2 -0
  221. data/lib/fog/google/requests/sql/delete_user.rb +3 -1
  222. data/lib/fog/google/requests/sql/export_instance.rb +2 -0
  223. data/lib/fog/google/requests/sql/get_backup_run.rb +2 -0
  224. data/lib/fog/google/requests/sql/get_instance.rb +2 -0
  225. data/lib/fog/google/requests/sql/get_operation.rb +2 -0
  226. data/lib/fog/google/requests/sql/get_ssl_cert.rb +2 -0
  227. data/lib/fog/google/requests/sql/import_instance.rb +2 -0
  228. data/lib/fog/google/requests/sql/insert_backup_run.rb +2 -0
  229. data/lib/fog/google/requests/sql/insert_instance.rb +2 -0
  230. data/lib/fog/google/requests/sql/insert_ssl_cert.rb +2 -0
  231. data/lib/fog/google/requests/sql/insert_user.rb +2 -0
  232. data/lib/fog/google/requests/sql/list_backup_runs.rb +2 -0
  233. data/lib/fog/google/requests/sql/list_flags.rb +2 -0
  234. data/lib/fog/google/requests/sql/list_instances.rb +2 -0
  235. data/lib/fog/google/requests/sql/list_operations.rb +2 -0
  236. data/lib/fog/google/requests/sql/list_ssl_certs.rb +2 -0
  237. data/lib/fog/google/requests/sql/list_tiers.rb +2 -0
  238. data/lib/fog/google/requests/sql/list_users.rb +2 -0
  239. data/lib/fog/google/requests/sql/reset_instance_ssl_config.rb +2 -0
  240. data/lib/fog/google/requests/sql/restart_instance.rb +2 -0
  241. data/lib/fog/google/requests/sql/restore_instance_backup.rb +2 -0
  242. data/lib/fog/google/requests/sql/update_instance.rb +2 -0
  243. data/lib/fog/google/requests/sql/update_user.rb +2 -0
  244. data/lib/fog/google/shared.rb +115 -55
  245. data/lib/fog/google/sql.rb +1 -1
  246. data/lib/fog/google/version.rb +1 -1
  247. data/lib/fog/storage/google_json.rb +5 -1
  248. data/lib/fog/storage/google_json/mock.rb +6 -0
  249. data/lib/fog/storage/google_json/real.rb +106 -3
  250. data/lib/fog/storage/google_json/requests/copy_object.rb +2 -0
  251. data/lib/fog/storage/google_json/requests/delete_bucket.rb +2 -0
  252. data/lib/fog/storage/google_json/requests/delete_object.rb +2 -0
  253. data/lib/fog/storage/google_json/requests/get_bucket.rb +2 -0
  254. data/lib/fog/storage/google_json/requests/get_bucket_acl.rb +2 -0
  255. data/lib/fog/storage/google_json/requests/get_object.rb +2 -0
  256. data/lib/fog/storage/google_json/requests/get_object_acl.rb +2 -0
  257. data/lib/fog/storage/google_json/requests/get_object_metadata.rb +2 -0
  258. data/lib/fog/storage/google_json/requests/list_bucket_acl.rb +2 -0
  259. data/lib/fog/storage/google_json/requests/list_buckets.rb +2 -0
  260. data/lib/fog/storage/google_json/requests/list_object_acl.rb +2 -0
  261. data/lib/fog/storage/google_json/requests/list_objects.rb +2 -0
  262. data/lib/fog/storage/google_json/requests/put_bucket.rb +2 -0
  263. data/lib/fog/storage/google_json/requests/put_bucket_acl.rb +2 -0
  264. data/lib/fog/storage/google_json/requests/put_object.rb +2 -0
  265. data/lib/fog/storage/google_json/requests/put_object_acl.rb +2 -0
  266. data/lib/fog/storage/google_json/utils.rb +1 -1
  267. data/lib/fog/storage/google_xml/models/file.rb +1 -1
  268. data/lib/fog/storage/google_xml/requests/get_bucket.rb +0 -1
  269. data/lib/fog/storage/google_xml/requests/head_object.rb +7 -6
  270. data/lib/fog/storage/google_xml/requests/put_bucket_acl.rb +2 -0
  271. data/tasks/changelog.rake +37 -0
  272. data/tasks/test.rake +6 -2
  273. data/test/helpers/integration_test_helper.rb +17 -6
  274. data/test/helpers/test_helper.rb +1 -0
  275. data/test/integration/compute/core_compute/test_servers.rb +40 -0
  276. data/test/integration/compute/core_compute/test_zones.rb +1 -1
  277. data/test/integration/compute/core_networking/test_addresses.rb +23 -0
  278. data/test/integration/factories/{sql_v1_certs_factory.rb → sql_certs_factory.rb} +3 -3
  279. data/test/integration/factories/{sql_v1_instances_factory.rb → sql_instances_factory.rb} +3 -3
  280. data/test/integration/factories/{sql_v1_users_factory.rb → sql_users_factory.rb} +6 -3
  281. data/test/integration/monitoring/test_metric_descriptors.rb +2 -0
  282. data/test/integration/monitoring/test_timeseries.rb +14 -26
  283. data/test/integration/pubsub/test_pubsub_models.rb +3 -3
  284. data/test/integration/pubsub/test_pubsub_requests.rb +2 -2
  285. data/test/integration/sql/{sqlv1/test_v1_certs.rb → test_certs.rb} +3 -3
  286. data/test/integration/sql/{sqlv1/test_common_flags.rb → test_common_flags.rb} +0 -0
  287. data/test/integration/sql/{sqlv1/test_common_tiers.rb → test_common_tiers.rb} +0 -0
  288. data/test/integration/sql/{sqlv1/test_coverage.rb → test_coverage.rb} +1 -1
  289. data/test/integration/sql/{sqlv2/test_v2_instances.rb → test_instances.rb} +22 -2
  290. data/test/integration/sql/{sqlv1/test_v1_users.rb → test_users.rb} +4 -4
  291. data/test/integration/test_authentication.rb +0 -7
  292. data/test/unit/storage/test_common_xml_collections.rb +11 -0
  293. data/test/unit/storage/test_json_requests.rb +0 -1
  294. metadata +50 -31
  295. data/test/integration/factories/sql_v2_instances_factory.rb +0 -19
  296. data/test/integration/sql/sqlv1/test_v1_instances.rb +0 -31
  297. data/test/integration/sql/sqlv2/test_coverage.rb +0 -6
@@ -23,7 +23,9 @@ module Fog
23
23
  class Mock
24
24
  def copy_object(_source_bucket, _source_object,
25
25
  _target_bucket, _target_object, _options = {})
26
+ # :no-coverage:
26
27
  Fog::Mock.not_implemented
28
+ # :no-coverage:
27
29
  end
28
30
  end
29
31
  end
@@ -13,7 +13,9 @@ module Fog
13
13
 
14
14
  class Mock
15
15
  def delete_bucket(_bucket_name)
16
+ # :no-coverage:
16
17
  Fog::Mock.not_implemented
18
+ # :no-coverage:
17
19
  end
18
20
  end
19
21
  end
@@ -14,7 +14,9 @@ module Fog
14
14
 
15
15
  class Mock
16
16
  def delete_object(_bucket_name, _object_name)
17
+ # :no-coverage:
17
18
  Fog::Mock.not_implemented
19
+ # :no-coverage:
18
20
  end
19
21
  end
20
22
  end
@@ -33,7 +33,9 @@ module Fog
33
33
 
34
34
  class Mock
35
35
  def get_bucket(_bucket_name, _options = {})
36
+ # :no-coverage:
36
37
  Fog::Mock.not_implemented
38
+ # :no-coverage:
37
39
  end
38
40
  end
39
41
  end
@@ -22,7 +22,9 @@ module Fog
22
22
 
23
23
  class Mock
24
24
  def get_bucket_acl(_bucket_name, _entity)
25
+ # :no-coverage:
25
26
  Fog::Mock.not_implemented
27
+ # :no-coverage:
26
28
  end
27
29
  end
28
30
  end
@@ -75,7 +75,9 @@ module Fog
75
75
 
76
76
  class Mock
77
77
  def get_object(_bucket_name, _object_name, _options = {})
78
+ # :no-coverage:
78
79
  Fog::Mock.not_implemented
80
+ # :no-coverage:
79
81
  end
80
82
  end
81
83
  end
@@ -25,7 +25,9 @@ module Fog
25
25
 
26
26
  class Mock
27
27
  def get_object_acl(_bucket_name, _object_name)
28
+ # :no-coverage:
28
29
  Fog::Mock.not_implemented
30
+ # :no-coverage:
29
31
  end
30
32
  end
31
33
  end
@@ -22,7 +22,9 @@ module Fog
22
22
 
23
23
  class Mock
24
24
  def get_object_metadata(_bucket_name, _object_name, _options = {})
25
+ # :no-coverage:
25
26
  Fog::Mock.not_implemented
27
+ # :no-coverage:
26
28
  end
27
29
  end
28
30
  end
@@ -16,7 +16,9 @@ module Fog
16
16
 
17
17
  class Mock
18
18
  def list_bucket_acl(_bucket_name)
19
+ # :no-coverage:
19
20
  Fog::Mock.not_implemented
21
+ # :no-coverage:
20
22
  end
21
23
  end
22
24
  end
@@ -20,7 +20,9 @@ module Fog
20
20
  end
21
21
  class Mock
22
22
  def list_buckets
23
+ # :no-coverage:
23
24
  Fog::Mock.not_implemented
25
+ # :no-coverage:
24
26
  end
25
27
  end
26
28
  end
@@ -19,7 +19,9 @@ module Fog
19
19
 
20
20
  class Mock
21
21
  def list_object_acl(_bucket_name, _object_name)
22
+ # :no-coverage:
22
23
  Fog::Mock.not_implemented
24
+ # :no-coverage:
23
25
  end
24
26
  end
25
27
  end
@@ -38,7 +38,9 @@ module Fog
38
38
 
39
39
  class Mock
40
40
  def list_objects(_bucket, _options = {})
41
+ # :no-coverage:
41
42
  Fog::Mock.not_implemented
43
+ # :no-coverage:
42
44
  end
43
45
  end
44
46
  end
@@ -32,7 +32,9 @@ module Fog
32
32
 
33
33
  class Mock
34
34
  def put_bucket(_bucket_name, _options = {})
35
+ # :no-coverage:
35
36
  Fog::Mock.not_implemented
37
+ # :no-coverage:
36
38
  end
37
39
  end
38
40
  end
@@ -19,7 +19,9 @@ module Fog
19
19
 
20
20
  class Mock
21
21
  def put_bucket_acl(_bucket_name, _acl)
22
+ # :no-coverage:
22
23
  Fog::Mock.not_implemented
24
+ # :no-coverage:
23
25
  end
24
26
  end
25
27
  end
@@ -92,7 +92,9 @@ module Fog
92
92
 
93
93
  class Mock
94
94
  def put_object(_bucket_name, _object_name, _data, _options = {})
95
+ # :no-coverage:
95
96
  Fog::Mock.not_implemented
97
+ # :no-coverage:
96
98
  end
97
99
  end
98
100
  end
@@ -25,7 +25,9 @@ module Fog
25
25
 
26
26
  class Mock
27
27
  def put_object_acl(_bucket_name, _object_name, _acl)
28
+ # :no-coverage:
28
29
  Fog::Mock.not_implemented
30
+ # :no-coverage:
29
31
  end
30
32
  end
31
33
  end
@@ -27,7 +27,7 @@ module Fog
27
27
  query = filtered.map { |k, v| [k.to_s, Fog::Google.escape(v)].join("=") }
28
28
  end
29
29
 
30
- query << "GoogleAccessId=#{@client.issuer}"
30
+ query << "GoogleAccessId=#{google_access_id}"
31
31
  query << "Signature=#{CGI.escape(signature(params))}"
32
32
  query << "Expires=#{params[:headers]['Date']}"
33
33
  "#{params[:host]}/#{params[:path]}?#{query.join('&')}"
@@ -51,7 +51,7 @@ module Fog
51
51
 
52
52
  remove_method :metadata
53
53
  def metadata
54
- attributes.reject { |key, _value| key.to_s =~ /^x-goog-meta-/ }
54
+ attributes.select { |key, _value| key.to_s =~ /^x-goog-meta-/ }
55
55
  end
56
56
 
57
57
  remove_method :metadata=
@@ -1,4 +1,3 @@
1
- require "pp"
2
1
  module Fog
3
2
  module Storage
4
3
  class GoogleXML
@@ -33,12 +33,13 @@ module Fog
33
33
  headers["If-Modified-Since"] = Fog::Time.at(options["If-Modified-Since"].to_i).to_date_header if options["If-Modified-Since"]
34
34
  headers["If-Unmodified-Since"] = Fog::Time.at(options["If-Unmodified-Since"].to_i).to_date_header if options["If-Modified-Since"]
35
35
  headers.merge!(options)
36
- request(:expects => [200, 206],
37
- :headers => headers,
38
- :host => "#{bucket_name}.#{@host}",
39
- :method => "HEAD",
40
- :path => Fog::Google.escape(object_name),
41
- :query => query)
36
+ request(:expects => [200, 206],
37
+ :headers => headers,
38
+ :host => "#{bucket_name}.#{@host}",
39
+ :idempotent => true,
40
+ :method => "HEAD",
41
+ :path => Fog::Google.escape(object_name),
42
+ :query => query)
42
43
  end
43
44
  end
44
45
 
@@ -3,7 +3,9 @@ module Fog
3
3
  class GoogleXML
4
4
  class Mock
5
5
  def put_bucket_acl(_bucket_name, _acl)
6
+ # :no-coverage:
6
7
  Fog::Mock.not_implemented
8
+ # :no-coverage:
7
9
  end
8
10
  end
9
11
 
@@ -0,0 +1,37 @@
1
+ require "fileutils"
2
+
3
+ # Helper method to insert text after a line that matches the regex
4
+ def insert_after_line(file, insert, regex = /^## Next/)
5
+ tempfile = File.open("#{file}.tmp", "w")
6
+ f = File.new(file)
7
+ f.each do |line|
8
+ tempfile << line
9
+ next unless line =~ regex
10
+
11
+ tempfile << "\n"
12
+ tempfile << insert
13
+ tempfile << "\n"
14
+ end
15
+ f.close
16
+ tempfile.close
17
+
18
+ FileUtils.mv("#{file}.tmp", file)
19
+ end
20
+
21
+ # Extracts all changes that have been made after the latest pushed tag
22
+ def changes_since_last_tag
23
+ `git --no-pager log $(git describe --tags --abbrev=0)..HEAD --grep="Merge" --pretty=format:"%t - %s%n%b%n"`
24
+ end
25
+
26
+ # Extracts all github users contributed since last tag
27
+ def users_since_last_tag
28
+ `git --no-pager log $(git describe --tags --abbrev=0)..HEAD --grep="Merge" --pretty=format:"%s" | cut -d' ' -f 6 | cut -d/ -f1 | uniq`
29
+ end
30
+
31
+ namespace :changelog do
32
+ task :generate do
33
+ insert_after_line("CHANGELOG.md", changes_since_last_tag, /^## Next/)
34
+ printf("Users contributed since last release:\n")
35
+ printf(users_since_last_tag)
36
+ end
37
+ end
@@ -86,10 +86,14 @@ namespace :test do
86
86
  end
87
87
 
88
88
  desc "Run SQL API tests"
89
- task :compute => SQL_TEST_TASKS
89
+ task :sql => SQL_TEST_TASKS
90
90
 
91
91
  desc "Run SQL API tests in parallel"
92
- multitask :compute_parallel => SQL_TEST_TASKS
92
+ multitask :sql_parallel => SQL_TEST_TASKS
93
+
94
+ # TODO(temikus): Remove after v1 is renamed in pipeline
95
+ desc "Run SQL API tests - v1 compat alias"
96
+ task :"sql-sqlv2" => :sql
93
97
 
94
98
  Rake::TestTask.new do |t|
95
99
  t.name = "sql"
@@ -1,5 +1,6 @@
1
1
  require "helpers/test_helper"
2
2
  require "helpers/test_collection"
3
+ require "retriable"
3
4
 
4
5
  # Use :test credentials in ~/.fog for live integration testing
5
6
  # XXX not sure if this will work on Travis CI or not
@@ -22,13 +23,10 @@ TEST_IMAGE_FAMILY = "debian-9".freeze
22
23
 
23
24
  # XXX This depends on a public image in gs://fog-test-bucket; there may be a better way to do this
24
25
  # The image was created like so: https://cloud.google.com/compute/docs/images#export_an_image_to_google_cloud_storage
25
- TEST_RAW_DISK_SOURCE = "http://storage.googleapis.com/fog-test-bucket/fog-test-raw-disk-source.image.tar.gz".freeze
26
+ TEST_RAW_DISK_SOURCE = "https://storage.googleapis.com/fog-testing-bucket/fog-test-raw-disk-source.image.tar.gz".freeze
26
27
 
27
- TEST_SQL_TIER_FIRST = "D1".freeze
28
- TEST_SQL_REGION_FIRST = "us-central".freeze
29
-
30
- TEST_SQL_TIER_SECOND = "db-n1-standard-1".freeze
31
- TEST_SQL_REGION_SECOND = TEST_REGION
28
+ TEST_SQL_TIER = "db-n1-standard-1".freeze
29
+ TEST_SQL_REGION = TEST_REGION
32
30
 
33
31
  # Test certificate/key for SSL Proxy tests, generated via:
34
32
  # $ openssl genrsa -out example.key 2048
@@ -90,8 +88,21 @@ wLjafhPTSAIS0jijglJ7uzaSbFUW11fw1/EIqIFNe0R0Xf9lsyPxFA==
90
88
  -----END RSA PRIVATE KEY-----
91
89
  KEY
92
90
 
91
+ # Retry module config - standard retriable gem settings
92
+ # see: https://github.com/kamui/retriable
93
+ RETRIABLE_TRIES = 3
94
+ RETRIABLE_BASE_INTERVAL = 50
95
+
93
96
  class FogIntegrationTest < MiniTest::Test
94
97
  def namespaced_name
95
98
  "#{self.class}_#{name}"
96
99
  end
100
+
101
+ def retry_on(klass)
102
+ Retriable.retriable(on: klass,
103
+ tries: RETRIABLE_TRIES,
104
+ base_interval: RETRIABLE_BASE_INTERVAL) do
105
+ yield
106
+ end
107
+ end
97
108
  end
@@ -5,6 +5,7 @@ if ENV["COVERAGE"]
5
5
 
6
6
  require 'codecov'
7
7
  SimpleCov.formatter = SimpleCov::Formatter::Codecov
8
+ SimpleCov.skip_token('no-coverage')
8
9
 
9
10
  SimpleCov.start do
10
11
  add_filter "/test/"
@@ -20,6 +20,22 @@ class TestServers < FogIntegrationTest
20
20
  super
21
21
  end
22
22
 
23
+ def test_set_machine_type
24
+ server = @factory.create
25
+ server.stop
26
+ server.wait_for { stopped? }
27
+ server.set_machine_type("n1-standard-2", false)
28
+ assert_equal "n1-standard-2", server.machine_type.split("/")[-1]
29
+ end
30
+
31
+ def test_set_machine_type_fail
32
+ server = @factory.create
33
+ server.wait_for { ready? }
34
+ assert_raises Fog::Errors::Error do
35
+ server.set_machine_type("n1-standard-2", false)
36
+ end
37
+ end
38
+
23
39
  def test_set_metadata
24
40
  server = @factory.create
25
41
  server.wait_for { ready? }
@@ -28,6 +44,15 @@ class TestServers < FogIntegrationTest
28
44
  { :key => "baz", :value => "foo" }], server.metadata[:items]
29
45
  end
30
46
 
47
+ def test_add_ssh_key
48
+ key = "ssh-rsa IAMNOTAREALSSHKEYAMA=="
49
+ username = "test_user"
50
+ server = @factory.create
51
+ server.add_ssh_key(username, key, false)
52
+ assert_equal [{ :key => "ssh-keys",
53
+ :value => "test_user:ssh-rsa IAMNOTAREALSSHKEYAMA== test_user" }], server.metadata[:items]
54
+ end
55
+
31
56
  def test_bootstrap
32
57
  key = "ssh-rsa IAMNOTAREALSSHKEYAMA== user@host.subdomain.example.com"
33
58
  user = "username"
@@ -106,4 +131,19 @@ class TestServers < FogIntegrationTest
106
131
 
107
132
  assert server.ready?
108
133
  end
134
+
135
+ def test_reset_windows_password
136
+ win_disk = @disks.create(
137
+ :name => "fog-test-1-testservers-test-reset-windows-password-2",
138
+ :source_image => "windows-server-1909-dc-core-v20200310",
139
+ :size_gb => 32
140
+ )
141
+ server = @factory.create(:disks => [win_disk])
142
+ server.wait_for { ready? }
143
+ server.reset_windows_password("test_user")
144
+ serial_output = server.serial_port_output(:port => 4)
145
+
146
+ assert_includes(serial_output, "encryptedPassword")
147
+ assert_includes(serial_output, "\"userName\":\"test_user\"")
148
+ end
109
149
  end
@@ -20,7 +20,7 @@ class TestZones < FogIntegrationTest
20
20
  # This tests only in last zone since not all zones contain all machine types
21
21
  ZONES.each do |name|
22
22
  zone = @subject.get(name)
23
- refute_nil(zone, "zones.get() should not return nil")
23
+ refute_nil(zone, "zones.get(#{name}) should not return nil")
24
24
  assert(zone.up?, "zones.up? should return up, unless there's an outage")
25
25
  end
26
26
  end
@@ -32,6 +32,29 @@ class TestAddresses < FogIntegrationTest
32
32
  @subject.get(address.name, TEST_REGION).status,
33
33
  "Address should now be in use"
34
34
  )
35
+
36
+ address.reload
37
+
38
+ assert_equal(
39
+ server,
40
+ address.server,
41
+ "Address.server should return an associated server object"
42
+ )
43
+
44
+ address.server = nil
45
+ address.reload
46
+ assert_nil(
47
+ address.server,
48
+ "Address should not be associated with a server after disassociation"
49
+ )
50
+
51
+ address.server = server
52
+ address.reload
53
+ assert_equal(
54
+ server,
55
+ address.server,
56
+ "Address should be associated with a server after association"
57
+ )
35
58
  end
36
59
 
37
60
  def test_bad_get
@@ -1,9 +1,9 @@
1
1
  require "integration/factories/collection_factory"
2
- require "integration/factories/sql_v1_instances_factory"
2
+ require "integration/factories/sql_instances_factory"
3
3
 
4
- class SqlV1CertsFactory < CollectionFactory
4
+ class SqlCertsFactory < CollectionFactory
5
5
  def initialize(example)
6
- @instances = SqlV1InstancesFactory.new(example)
6
+ @instances = SqlInstancesFactory.new(example)
7
7
  super(Fog::Google[:sql].ssl_certs, example)
8
8
  end
9
9