fog 1.35.0 → 1.36.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/CHANGELOG.md +50 -0
  4. data/fog.gemspec +6 -6
  5. data/lib/fog/digitalocean/models/compute/server.rb +0 -1
  6. data/lib/fog/digitalocean/requests/compute_v2/create_ssh_key.rb +10 -8
  7. data/lib/fog/digitalocean/requests/compute_v2/delete_ssh_key.rb +5 -1
  8. data/lib/fog/digitalocean/requests/compute_v2/list_ssh_keys.rb +6 -1
  9. data/lib/fog/glesys/models/compute/server.rb +0 -1
  10. data/lib/fog/joyent/compute.rb +6 -1
  11. data/lib/fog/linode/compute.rb +3 -0
  12. data/lib/fog/linode/models/compute/data_center.rb +1 -0
  13. data/lib/fog/linode/models/compute/flavor.rb +3 -0
  14. data/lib/fog/linode/models/compute/flavors.rb +8 -1
  15. data/lib/fog/linode/models/compute/image.rb +2 -0
  16. data/lib/fog/linode/models/compute/images.rb +2 -1
  17. data/lib/fog/linode/models/compute/kernel.rb +3 -0
  18. data/lib/fog/linode/models/compute/kernels.rb +14 -8
  19. data/lib/fog/linode/models/compute/node_balancer_flavor.rb +13 -0
  20. data/lib/fog/linode/models/compute/node_balancer_flavors.rb +27 -0
  21. data/lib/fog/linode/requests/compute/avail_kernels.rb +17 -18
  22. data/lib/fog/linode/requests/compute/avail_linodeplans.rb +4 -2
  23. data/lib/fog/linode/requests/compute/avail_nodebalancers.rb +42 -0
  24. data/lib/fog/linode/requests/compute/avail_stackscripts.rb +6 -11
  25. data/lib/fog/openstack/core.rb +22 -21
  26. data/lib/fog/openstack/models/baremetal/nodes.rb +1 -1
  27. data/lib/fog/openstack/models/identity_v3/domain.rb +6 -0
  28. data/lib/fog/openstack/models/identity_v3/domains.rb +19 -4
  29. data/lib/fog/openstack/models/identity_v3/project.rb +10 -0
  30. data/lib/fog/openstack/models/identity_v3/projects.rb +16 -3
  31. data/lib/fog/openstack/models/identity_v3/tokens.rb +1 -0
  32. data/lib/fog/openstack/models/storage/file.rb +9 -0
  33. data/lib/fog/openstack/requests/baremetal/delete_node.rb +1 -1
  34. data/lib/fog/rackspace/requests/load_balancers/create_node.rb +1 -1
  35. data/lib/fog/version.rb +1 -1
  36. data/lib/fog/vsphere/compute.rb +8 -0
  37. data/lib/fog/vsphere/models/compute/network.rb +1 -0
  38. data/lib/fog/vsphere/models/compute/process.rb +18 -0
  39. data/lib/fog/vsphere/models/compute/server.rb +29 -0
  40. data/lib/fog/vsphere/models/compute/snapshot.rb +35 -0
  41. data/lib/fog/vsphere/models/compute/snapshots.rb +27 -0
  42. data/lib/fog/vsphere/requests/compute/create_vm.rb +65 -2
  43. data/lib/fog/vsphere/requests/compute/list_child_snapshots.rb +71 -0
  44. data/lib/fog/vsphere/requests/compute/list_networks.rb +5 -4
  45. data/lib/fog/vsphere/requests/compute/list_processes.rb +41 -0
  46. data/lib/fog/vsphere/requests/compute/list_vm_snapshots.rb +66 -0
  47. data/lib/fog/vsphere/requests/compute/revert_to_snapshot.rb +30 -0
  48. data/lib/fog/vsphere/requests/compute/vm_clone.rb +2 -5
  49. data/lib/fog/vsphere/requests/compute/vm_take_snapshot.rb +37 -0
  50. data/lib/tasks/changelog_task.rb +1 -0
  51. data/spec/fog/openstack/identity_v3/authv3_a.yml +18 -18
  52. data/spec/fog/openstack/identity_v3/authv3_b.yml +18 -18
  53. data/spec/fog/openstack/identity_v3/authv3_c.yml +293 -55
  54. data/spec/fog/openstack/identity_v3/authv3_token.yml +89 -89
  55. data/spec/fog/openstack/identity_v3/authv3_unscoped.yml +325 -222
  56. data/spec/fog/openstack/identity_v3/authv3_unscoped_reauth.yml +587 -111
  57. data/spec/fog/openstack/identity_v3/common_setup.yml +30 -30
  58. data/spec/fog/openstack/identity_v3/idv3_credential.yml +17 -17
  59. data/spec/fog/openstack/identity_v3/idv3_credential_crud.yml +343 -106
  60. data/spec/fog/openstack/identity_v3/idv3_domain.yml +27 -122
  61. data/spec/fog/openstack/identity_v3/idv3_domain_crud.yml +75 -128
  62. data/spec/fog/openstack/identity_v3/idv3_domain_group_roles_mutation.yml +141 -141
  63. data/spec/fog/openstack/identity_v3/idv3_domain_roles_mutation.yml +326 -86
  64. data/spec/fog/openstack/identity_v3/idv3_endpoint.yml +221 -221
  65. data/spec/fog/openstack/identity_v3/idv3_endpoints_crud.yml +314 -314
  66. data/spec/fog/openstack/identity_v3/idv3_group_crud_mutation.yml +191 -188
  67. data/spec/fog/openstack/identity_v3/idv3_policy.yml +23 -23
  68. data/spec/fog/openstack/identity_v3/idv3_policy_crud.yml +67 -67
  69. data/spec/fog/openstack/identity_v3/idv3_project.yml +267 -161
  70. data/spec/fog/openstack/identity_v3/idv3_project_crud.yml +70 -145
  71. data/spec/fog/openstack/identity_v3/idv3_project_group_user_roles_mutation.yml +195 -243
  72. data/spec/fog/openstack/identity_v3/idv3_project_hier_crud_list.yml +203 -553
  73. data/spec/fog/openstack/identity_v3/idv3_role.yml +49 -49
  74. data/spec/fog/openstack/identity_v3/idv3_role_crud.yml +92 -92
  75. data/spec/fog/openstack/identity_v3/idv3_service.yml +61 -61
  76. data/spec/fog/openstack/identity_v3/idv3_services_crud.yml +111 -111
  77. data/spec/fog/openstack/identity_v3/idv3_token.yml +84 -84
  78. data/spec/fog/openstack/identity_v3/idv3_user_crud.yml +140 -125
  79. data/spec/fog/openstack/identity_v3/idv3_users.yml +98 -78
  80. data/spec/fog/openstack/network/common_setup.yml +84 -75
  81. data/spec/fog/openstack/network/subnets_crud.yml +75 -35
  82. data/spec/fog/openstack/shared_context.rb +5 -1
  83. data/tests/helper.rb +1 -0
  84. data/tests/linode/requests/compute/datacenter_tests.rb +2 -1
  85. data/tests/linode/requests/compute/kernel_tests.rb +2 -10
  86. data/tests/linode/requests/compute/linodeplans_tests.rb +10 -7
  87. data/tests/linode/requests/compute/nodebalancers_tests.rb +20 -0
  88. data/tests/openstack/models/storage/file_tests.rb +29 -0
  89. data/tests/rackspace/requests/load_balancers/node_tests.rb +7 -0
  90. data/tests/vsphere/models/compute/server_tests.rb +27 -1
  91. data/tests/vsphere/requests/compute/list_child_snapshots_tests.rb +10 -0
  92. data/tests/vsphere/requests/compute/list_vm_snapshots_tests.rb +10 -0
  93. data/tests/vsphere/requests/compute/revert_to_snapshot_tests.rb +15 -0
  94. data/tests/vsphere/requests/compute/vm_take_snapshot_tests.rb +19 -0
  95. metadata +41 -16
  96. data/spec/fog/openstack/identity_v3/authv3_project.yml +0 -98
@@ -5,16 +5,18 @@ http_interactions:
5
5
  uri: http://devstack.openstack.stack:9696/v2.0/networks
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"network":{"name":"foo-net12","shared":false}}'
8
+ string: '{"network":{"name":"foo-net12","shared":false}}'
9
9
  headers:
10
10
  User-Agent:
11
- - fog-core/1.32.0
11
+ - fog-core/1.32.1
12
+ Proxy-Connection:
13
+ - Keep-Alive
12
14
  Content-Type:
13
15
  - application/json
14
16
  Accept:
15
17
  - application/json
16
18
  X-Auth-Token:
17
- - 0afbf49d007a4d82850b853b703025d7
19
+ - 3b58d1663a9a49b2af240e68bfb08081
18
20
  response:
19
21
  status:
20
22
  code: 201
@@ -25,33 +27,43 @@ http_interactions:
25
27
  Content-Length:
26
28
  - '344'
27
29
  X-Openstack-Request-Id:
28
- - req-cc7677e6-9700-4215-b16d-d4a867db376b
30
+ - req-fdcd2d80-b5c1-4c2f-854b-b4723a66b777
29
31
  Date:
30
- - Thu, 16 Jul 2015 13:30:02 GMT
32
+ - Thu, 29 Oct 2015 10:19:42 GMT
33
+ X-Cache:
34
+ - MISS from i056593-vagrant
35
+ X-Cache-Lookup:
36
+ - MISS from i056593-vagrant:3128
37
+ Via:
38
+ - 1.1 i056593-vagrant (squid/3.3.8)
39
+ Connection:
40
+ - keep-alive
31
41
  body:
32
- encoding: US-ASCII
33
- string: ! '{"network": {"status": "ACTIVE", "subnets": [], "name": "foo-net12",
42
+ encoding: UTF-8
43
+ string: '{"network": {"status": "ACTIVE", "subnets": [], "name": "foo-net12",
34
44
  "provider:physical_network": null, "router:external": false, "tenant_id":
35
- "5b1c4e7218d94dc8879d542002ffbc48", "admin_state_up": true, "mtu": 0, "shared":
36
- false, "provider:network_type": "vxlan", "id": "0629b827-668a-443c-b73e-1725359350fb",
37
- "provider:segmentation_id": 1104}}'
45
+ "ded5a6e0922c4be59e7c15517cfb89ee", "admin_state_up": true, "mtu": 0, "shared":
46
+ false, "provider:network_type": "vxlan", "id": "212190ec-9075-45d6-b31e-e0649a79b356",
47
+ "provider:segmentation_id": 1045}}'
38
48
  http_version:
39
- recorded_at: Thu, 16 Jul 2015 13:30:19 GMT
49
+ recorded_at: Thu, 29 Oct 2015 10:19:38 GMT
40
50
  - request:
41
51
  method: post
42
52
  uri: http://devstack.openstack.stack:9696/v2.0/subnets
43
53
  body:
44
54
  encoding: UTF-8
45
- string: ! '{"subnet":{"network_id":"0629b827-668a-443c-b73e-1725359350fb","cidr":"172.16.0.0/16","ip_version":4,"name":"my-network","gateway_ip":null}}'
55
+ string: '{"subnet":{"network_id":"212190ec-9075-45d6-b31e-e0649a79b356","cidr":"172.16.0.0/16","ip_version":4,"name":"my-network","gateway_ip":null}}'
46
56
  headers:
47
57
  User-Agent:
48
- - fog-core/1.32.0
58
+ - fog-core/1.32.1
59
+ Proxy-Connection:
60
+ - Keep-Alive
49
61
  Content-Type:
50
62
  - application/json
51
63
  Accept:
52
64
  - application/json
53
65
  X-Auth-Token:
54
- - 0afbf49d007a4d82850b853b703025d7
66
+ - 3b58d1663a9a49b2af240e68bfb08081
55
67
  response:
56
68
  status:
57
69
  code: 201
@@ -62,34 +74,44 @@ http_interactions:
62
74
  Content-Length:
63
75
  - '452'
64
76
  X-Openstack-Request-Id:
65
- - req-295d5e91-514b-4980-85a4-adce351161a8
77
+ - req-6d6a0167-3c48-49e5-8bf4-10e6aa7f4873
66
78
  Date:
67
- - Thu, 16 Jul 2015 13:30:02 GMT
79
+ - Thu, 29 Oct 2015 10:19:42 GMT
80
+ X-Cache:
81
+ - MISS from i056593-vagrant
82
+ X-Cache-Lookup:
83
+ - MISS from i056593-vagrant:3128
84
+ Via:
85
+ - 1.1 i056593-vagrant (squid/3.3.8)
86
+ Connection:
87
+ - keep-alive
68
88
  body:
69
- encoding: US-ASCII
70
- string: ! '{"subnet": {"name": "my-network", "enable_dhcp": true, "network_id":
71
- "0629b827-668a-443c-b73e-1725359350fb", "tenant_id": "5b1c4e7218d94dc8879d542002ffbc48",
89
+ encoding: UTF-8
90
+ string: '{"subnet": {"name": "my-network", "enable_dhcp": true, "network_id":
91
+ "212190ec-9075-45d6-b31e-e0649a79b356", "tenant_id": "ded5a6e0922c4be59e7c15517cfb89ee",
72
92
  "dns_nameservers": [], "gateway_ip": null, "ipv6_ra_mode": null, "allocation_pools":
73
93
  [{"start": "172.16.0.1", "end": "172.16.255.254"}], "host_routes": [], "ip_version":
74
- 4, "ipv6_address_mode": null, "cidr": "172.16.0.0/16", "id": "11bef948-6df8-4fa3-8c21-3fbd3cc4ca6d",
94
+ 4, "ipv6_address_mode": null, "cidr": "172.16.0.0/16", "id": "3d936331-954b-4d47-9531-f27cea2921da",
75
95
  "subnetpool_id": null}}'
76
96
  http_version:
77
- recorded_at: Thu, 16 Jul 2015 13:30:19 GMT
97
+ recorded_at: Thu, 29 Oct 2015 10:19:38 GMT
78
98
  - request:
79
99
  method: delete
80
- uri: http://devstack.openstack.stack:9696/v2.0/subnets/11bef948-6df8-4fa3-8c21-3fbd3cc4ca6d
100
+ uri: http://devstack.openstack.stack:9696/v2.0/subnets/3d936331-954b-4d47-9531-f27cea2921da
81
101
  body:
82
102
  encoding: US-ASCII
83
103
  string: ''
84
104
  headers:
85
105
  User-Agent:
86
- - fog-core/1.32.0
106
+ - fog-core/1.32.1
107
+ Proxy-Connection:
108
+ - Keep-Alive
87
109
  Content-Type:
88
110
  - application/json
89
111
  Accept:
90
112
  - application/json
91
113
  X-Auth-Token:
92
- - 0afbf49d007a4d82850b853b703025d7
114
+ - 3b58d1663a9a49b2af240e68bfb08081
93
115
  response:
94
116
  status:
95
117
  code: 204
@@ -98,29 +120,39 @@ http_interactions:
98
120
  Content-Length:
99
121
  - '0'
100
122
  X-Openstack-Request-Id:
101
- - req-5c4205db-8183-4eeb-a702-e6e156f82db1
123
+ - req-e44101b5-1474-4796-85e5-2c451aec45b1
102
124
  Date:
103
- - Thu, 16 Jul 2015 13:30:03 GMT
125
+ - Thu, 29 Oct 2015 10:19:43 GMT
126
+ X-Cache:
127
+ - MISS from i056593-vagrant
128
+ X-Cache-Lookup:
129
+ - MISS from i056593-vagrant:3128
130
+ Via:
131
+ - 1.1 i056593-vagrant (squid/3.3.8)
132
+ Connection:
133
+ - keep-alive
104
134
  body:
105
- encoding: US-ASCII
135
+ encoding: UTF-8
106
136
  string: ''
107
137
  http_version:
108
- recorded_at: Thu, 16 Jul 2015 13:30:20 GMT
138
+ recorded_at: Thu, 29 Oct 2015 10:19:38 GMT
109
139
  - request:
110
140
  method: delete
111
- uri: http://devstack.openstack.stack:9696/v2.0/networks/0629b827-668a-443c-b73e-1725359350fb
141
+ uri: http://devstack.openstack.stack:9696/v2.0/networks/212190ec-9075-45d6-b31e-e0649a79b356
112
142
  body:
113
143
  encoding: US-ASCII
114
144
  string: ''
115
145
  headers:
116
146
  User-Agent:
117
- - fog-core/1.32.0
147
+ - fog-core/1.32.1
148
+ Proxy-Connection:
149
+ - Keep-Alive
118
150
  Content-Type:
119
151
  - application/json
120
152
  Accept:
121
153
  - application/json
122
154
  X-Auth-Token:
123
- - 0afbf49d007a4d82850b853b703025d7
155
+ - 3b58d1663a9a49b2af240e68bfb08081
124
156
  response:
125
157
  status:
126
158
  code: 204
@@ -129,12 +161,20 @@ http_interactions:
129
161
  Content-Length:
130
162
  - '0'
131
163
  X-Openstack-Request-Id:
132
- - req-f21f4c07-2e64-4920-a53d-19f221af0c99
164
+ - req-c8c52a10-08ea-4e1f-8915-b5fd33e4d874
133
165
  Date:
134
- - Thu, 16 Jul 2015 13:30:03 GMT
166
+ - Thu, 29 Oct 2015 10:19:43 GMT
167
+ X-Cache:
168
+ - MISS from i056593-vagrant
169
+ X-Cache-Lookup:
170
+ - MISS from i056593-vagrant:3128
171
+ Via:
172
+ - 1.1 i056593-vagrant (squid/3.3.8)
173
+ Connection:
174
+ - keep-alive
135
175
  body:
136
- encoding: US-ASCII
176
+ encoding: UTF-8
137
177
  string: ''
138
178
  http_version:
139
- recorded_at: Thu, 16 Jul 2015 13:30:20 GMT
179
+ recorded_at: Thu, 29 Oct 2015 10:19:38 GMT
140
180
  recorded_with: VCR 2.9.3
@@ -1,6 +1,7 @@
1
1
  require 'rspec/core'
2
2
  require 'rspec/expectations'
3
3
  require 'vcr'
4
+ require 'fog/openstack/core'
4
5
  require 'fog/openstack/identity'
5
6
  require 'fog/openstack/identity_v3'
6
7
  require 'fog/openstack/image'
@@ -73,6 +74,8 @@ RSpec.shared_context 'OpenStack specs with VCR' do
73
74
 
74
75
  # setup the service object
75
76
  VCR.use_cassette('common_setup') do
77
+ Fog::OpenStack.clear_token_cache
78
+
76
79
  if @service_class == Fog::Identity::OpenStack::V3 || @os_auth_url.end_with?('/v3')
77
80
  options = {
78
81
  :openstack_auth_url => "#{@os_auth_url}/auth/tokens",
@@ -95,7 +98,8 @@ RSpec.shared_context 'OpenStack specs with VCR' do
95
98
  # :openstack_project_domain => ENV['OS_PROJECT_DOMAIN_NAME'] || 'Default',
96
99
  }
97
100
  end
98
- @service = @service_class.new(options) unless @service
101
+ @service = @service_class.new(options)
102
+
99
103
  end
100
104
  end
101
105
 
@@ -3,6 +3,7 @@ ENV['FOG_CREDENTIAL'] = ENV['FOG_CREDENTIAL'] || 'default'
3
3
 
4
4
  require 'fog'
5
5
  require 'fog/bin' # for available_providers and registered_providers
6
+ require 'ostruct'
6
7
 
7
8
  Excon.defaults.merge!(:debug_request => true, :debug_response => true)
8
9
 
@@ -3,7 +3,8 @@ Shindo.tests('Fog::Compute[:linode] | datacenter requests', ['linode']) do
3
3
  @datacenters_format = Linode::Compute::Formats::BASIC.merge({
4
4
  'DATA' => [{
5
5
  'DATACENTERID' => Integer,
6
- 'LOCATION' => String
6
+ 'LOCATION' => String,
7
+ 'ABBR' => String
7
8
  }]
8
9
  })
9
10
 
@@ -4,24 +4,16 @@ Shindo.tests('Fog::Compute[:linode] | kernel requests', ['linode']) do
4
4
  'DATA' => [{
5
5
  'LABEL' => String,
6
6
  'ISXEN' => Integer,
7
+ 'ISKVM' => Integer,
7
8
  'ISPVOPS' => Integer,
8
9
  'KERNELID' => Integer
9
10
  }]
10
11
  })
11
12
 
12
13
  tests('success') do
13
- @kernel_id = nil
14
-
15
14
  tests('#avail_kernels').formats(@kernels_format) do
16
15
  pending if Fog.mocking?
17
- data = Fog::Compute[:linode].avail_kernels.body
18
- @kernel_id = data['DATA'].first['KERNELID']
19
- data
20
- end
21
-
22
- tests("@avail_kernels(#{@kernel_id})").formats(@kernels_format) do
23
- pending if Fog.mocking?
24
- Fog::Compute[:linode].avail_kernels(@kernel_id).body
16
+ Fog::Compute[:linode].avail_kernels.body
25
17
  end
26
18
  end
27
19
  end
@@ -3,12 +3,14 @@ Shindo.tests('Fog::Compute[:linode] | linodeplans requests', ['linode']) do
3
3
  @linodeplans_format = Linode::Compute::Formats::BASIC.merge({
4
4
  'DATA' => [{
5
5
  'AVAIL' => {
6
- '2' => Integer,
7
- '3' => Integer,
8
- '4' => Integer,
9
- '6' => Integer,
10
- '7' => Integer,
11
- '8' => Integer
6
+ '2' => Integer,
7
+ '3' => Integer,
8
+ '4' => Integer,
9
+ '6' => Integer,
10
+ '7' => Integer,
11
+ '8' => Integer,
12
+ '9' => Integer,
13
+ '10' => Integer
12
14
  },
13
15
  'DISK' => Integer,
14
16
  'PLANID' => Integer,
@@ -16,7 +18,8 @@ Shindo.tests('Fog::Compute[:linode] | linodeplans requests', ['linode']) do
16
18
  'RAM' => Integer,
17
19
  'LABEL' => String,
18
20
  'XFER' => Integer,
19
- 'CORES' => Integer
21
+ 'CORES' => Integer,
22
+ 'HOURLY' => Float
20
23
  }]
21
24
  })
22
25
 
@@ -0,0 +1,20 @@
1
+ Shindo.tests('Fog::Compute[:linode] | linodenodebalancers requests', ['linode']) do
2
+
3
+ @linodenodebalancers_format = Linode::Compute::Formats::BASIC.merge({
4
+ 'DATA' => [{
5
+ 'MONTHLY' => Float,
6
+ 'HOURLY' => Float,
7
+ 'CONNECTIONS' => Integer
8
+ }]
9
+ })
10
+
11
+ tests('success') do
12
+
13
+ tests('#avail_nodebalancers').formats(@linodenodebalancers_format) do
14
+ pending if Fog.mocking?
15
+ Fog::Compute[:linode].avail_nodebalancers.body
16
+ end
17
+
18
+ end
19
+
20
+ end
@@ -215,6 +215,35 @@ Shindo.tests('Fog::OpenStack::Storage | file', ['openstack']) do
215
215
 
216
216
  end
217
217
 
218
+ tests("#content_encoding") do
219
+
220
+ tests("#content_encoding should default to nil").returns(nil) do
221
+ @instance.save
222
+ @instance.content_encoding
223
+ end
224
+
225
+ @instance.content_encoding = 'gzip'
226
+ @instance.save
227
+ tests("#content_encoding should return the content encoding").returns('gzip') do
228
+ @instance.content_encoding
229
+ end
230
+ @instance.attributes.delete('content_encoding')
231
+
232
+ @instance.content_encoding = 'foo'
233
+ @instance.save
234
+ tests("#content_encoding= should update content_encoding").returns('bar') do
235
+ @instance.content_encoding = 'bar'
236
+ @instance.save
237
+ @instance.content_encoding
238
+ end
239
+
240
+ tests("#content_encoding= should not blow up on nil") do
241
+ @instance.content_encoding = nil
242
+ @instance.save
243
+ end
244
+
245
+ end
246
+
218
247
  end
219
248
 
220
249
  @directory.destroy
@@ -22,6 +22,13 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | node_tests', ['rackspace']) do
22
22
  data
23
23
  end
24
24
 
25
+ @lb.wait_for { ready? }
26
+ tests('#create_node with type').formats(NODES_FORMAT) do
27
+ data = @service.create_node(@lb.id, '1.1.1.4', 80, 'ENABLED', { :type => 'PRIMARY' }).body
28
+ @nodes_created << data['nodes'][0]['id']
29
+ data
30
+ end
31
+
25
32
  @lb.wait_for { ready? }
26
33
  tests("#list_nodes(#{@lb.id})").formats(NODES_FORMAT) do
27
34
  @service.list_nodes(@lb.id).body
@@ -1,5 +1,4 @@
1
1
  Shindo.tests('Fog::Compute[:vsphere] | server model', ['vsphere']) do
2
-
3
2
  servers = Fog::Compute[:vsphere].servers
4
3
  server = servers.last
5
4
 
@@ -10,6 +9,33 @@ Shindo.tests('Fog::Compute[:vsphere] | server model', ['vsphere']) do
10
9
  test(action) { server.respond_to? action }
11
10
  test("#{action} returns successfully") { server.send(action.to_sym) ? true : false }
12
11
  end
12
+ test('guest_processes') { server.respond_to? 'guest_processes' }
13
+ test('take_snapshot') do
14
+ test('responds') { server.respond_to? 'take_snapshot'}
15
+ test('returns successfully') { server.take_snapshot('name' => 'foobar').kind_of? Hash }
16
+ end
17
+ test('snapshots') do
18
+ test('responds') { server.respond_to? 'snapshots'}
19
+ test('returns successfully') { server.snapshots.kind_of? Fog::Compute::Vsphere::Snapshots }
20
+ end
21
+ test('find_snapshot') do
22
+ test('responds') { server.respond_to? 'find_snapshot'}
23
+ test('returns successfully') do
24
+ server.find_snapshot('snapshot-0101').kind_of? Fog::Compute::Vsphere::Snapshot
25
+ end
26
+ test('returns correct snapshot') do
27
+ server.find_snapshot('snapshot-0101').ref == 'snapshot-0101'
28
+ end
29
+ end
30
+ tests('revert_snapshot') do
31
+ test('responds') { server.respond_to? 'revert_snapshot'}
32
+ tests('returns correctly') do
33
+ test('when correct input given') { server.revert_snapshot('snapshot-0101').kind_of? Hash }
34
+ test('when incorrect input given') do
35
+ raises(ArgumentError) { server.revert_snapshot(1) }
36
+ end
37
+ end
38
+ end
13
39
  end
14
40
  tests('have attributes') do
15
41
  model_attribute_hash = server.attributes
@@ -0,0 +1,10 @@
1
+ Shindo.tests('Fog::Compute[:vsphere] | list_child_snapshots request', ['vsphere']) do
2
+
3
+ compute = Fog::Compute[:vsphere]
4
+
5
+ tests('The response should') do
6
+ response = compute.list_child_snapshots('snapshot-0101')
7
+ test('be a kind of Array') { response.kind_of? Array }
8
+ test('it should contains Hashes') { response.all? { |i| Hash === i } }
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ Shindo.tests('Fog::Compute[:vsphere] | list_vm_snapshots request', ['vsphere']) do
2
+
3
+ compute = Fog::Compute[:vsphere]
4
+
5
+ tests('The response should') do
6
+ response = compute.list_vm_snapshots('5032c8a5-9c5e-ba7a-3804-832a03e16381')
7
+ test('be a kind of Array') { response.kind_of? Array }
8
+ test('it should contains Hashes') { response.all? { |i| Hash === i } }
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ Shindo.tests('Fog::Compute[:vsphere] | revert_to_snapshot request', ['vsphere']) do
2
+
3
+ compute = Fog::Compute[:vsphere]
4
+
5
+ tests('The response should') do
6
+ response = compute.revert_to_snapshot(Fog::Compute::Vsphere::Snapshot.new(service: 1))
7
+ test('be a kind of Hash') { response.kind_of? Hash }
8
+ test('should have a task_state key') { response.key? 'state' }
9
+ end
10
+
11
+ tests('The expected options') do
12
+ raises(ArgumentError, 'raises ArgumentError when input param is missing') { compute.revert_to_snapshot(nil) }
13
+ end
14
+
15
+ end