fog-openstack 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -28
- data/docs/workflow.md +129 -0
- data/examples/workflow/workflow-examples.rb +387 -0
- data/gemfiles/Gemfile-1.9 +1 -0
- data/lib/fog/openstack.rb +5 -1
- data/lib/fog/openstack/baremetal.rb +14 -38
- data/lib/fog/openstack/compute.rb +4 -33
- data/lib/fog/openstack/core.rb +104 -50
- data/lib/fog/openstack/identity.rb +2 -1
- data/lib/fog/openstack/identity_v2.rb +0 -2
- data/lib/fog/openstack/identity_v3.rb +0 -2
- data/lib/fog/openstack/image_v1.rb +6 -6
- data/lib/fog/openstack/image_v2.rb +7 -6
- data/lib/fog/openstack/introspection.rb +10 -35
- data/lib/fog/openstack/metering.rb +16 -35
- data/lib/fog/openstack/monitoring.rb +5 -31
- data/lib/fog/openstack/network.rb +5 -34
- data/lib/fog/openstack/nfv.rb +10 -35
- data/lib/fog/openstack/orchestration.rb +5 -40
- data/lib/fog/openstack/planning.rb +11 -36
- data/lib/fog/openstack/requests/compute/get_limits.rb +8 -7
- data/lib/fog/openstack/requests/network/update_router.rb +1 -1
- data/lib/fog/openstack/requests/workflow_v2/create_action.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/create_action_execution.rb +31 -0
- data/lib/fog/openstack/requests/workflow_v2/create_cron_trigger.rb +55 -0
- data/lib/fog/openstack/requests/workflow_v2/create_environment.rb +31 -0
- data/lib/fog/openstack/requests/workflow_v2/create_execution.rb +30 -0
- data/lib/fog/openstack/requests/workflow_v2/create_workbook.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/create_workflow.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_action.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_action_execution.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_cron_trigger.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_environment.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_execution.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_workbook.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_workflow.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/get_action.rb +27 -0
- data/lib/fog/openstack/requests/workflow_v2/get_action_execution.rb +26 -0
- data/lib/fog/openstack/requests/workflow_v2/get_cron_trigger.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/get_environment.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/get_execution.rb +26 -0
- data/lib/fog/openstack/requests/workflow_v2/get_task.rb +27 -0
- data/lib/fog/openstack/requests/workflow_v2/get_workbook.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/get_workflow.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_action_executions.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_actions.rb +30 -0
- data/lib/fog/openstack/requests/workflow_v2/list_cron_triggers.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_environments.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_executions.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_services.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_tasks.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_workbooks.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_workflows.rb +30 -0
- data/lib/fog/openstack/requests/workflow_v2/rerun_task.rb +33 -0
- data/lib/fog/openstack/requests/workflow_v2/update_action.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/update_action_execution.rb +33 -0
- data/lib/fog/openstack/requests/workflow_v2/update_environment.rb +31 -0
- data/lib/fog/openstack/requests/workflow_v2/update_execution.rb +33 -0
- data/lib/fog/openstack/requests/workflow_v2/update_workbook.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/update_workflow.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/validate_action.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/validate_workbook.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/validate_workflow.rb +28 -0
- data/lib/fog/openstack/storage.rb +4 -35
- data/lib/fog/openstack/version.rb +1 -1
- data/lib/fog/openstack/volume_v1.rb +7 -5
- data/lib/fog/openstack/volume_v2.rb +7 -5
- data/lib/fog/openstack/workflow.rb +12 -0
- data/lib/fog/openstack/workflow_v2.rb +160 -0
- metadata +48 -95
- data/lib/fog/openstack/common.rb +0 -44
- data/tests/openstack/models/compute/images_tests.rb +0 -13
- data/tests/openstack/models/compute/security_group_tests.rb +0 -54
- data/tests/openstack/models/compute/server_tests.rb +0 -220
- data/tests/openstack/models/compute/service_tests.rb +0 -17
- data/tests/openstack/models/image/image_tests.rb +0 -36
- data/tests/openstack/models/image/images_tests.rb +0 -19
- data/tests/openstack/models/network/floating_ip_tests.rb +0 -35
- data/tests/openstack/models/network/floating_ips_tests.rb +0 -19
- data/tests/openstack/models/network/ike_policies_tests.rb +0 -28
- data/tests/openstack/models/network/ike_policy_tests.rb +0 -36
- data/tests/openstack/models/network/ipsec_policies_tests.rb +0 -26
- data/tests/openstack/models/network/ipsec_policy_tests.rb +0 -36
- data/tests/openstack/models/network/ipsec_site_connection_tests.rb +0 -50
- data/tests/openstack/models/network/ipsec_site_connections_tests.rb +0 -32
- data/tests/openstack/models/network/lb_health_monitor_tests.rb +0 -52
- data/tests/openstack/models/network/lb_health_monitors_tests.rb +0 -21
- data/tests/openstack/models/network/lb_member_tests.rb +0 -28
- data/tests/openstack/models/network/lb_members_tests.rb +0 -21
- data/tests/openstack/models/network/lb_pool_tests.rb +0 -53
- data/tests/openstack/models/network/lb_pools_tests.rb +0 -20
- data/tests/openstack/models/network/lb_vip_tests.rb +0 -39
- data/tests/openstack/models/network/lb_vips_tests.rb +0 -21
- data/tests/openstack/models/network/network_tests.rb +0 -61
- data/tests/openstack/models/network/networks_tests.rb +0 -21
- data/tests/openstack/models/network/port_tests.rb +0 -28
- data/tests/openstack/models/network/ports_tests.rb +0 -25
- data/tests/openstack/models/network/router_tests.rb +0 -39
- data/tests/openstack/models/network/routers_tests.rb +0 -21
- data/tests/openstack/models/network/security_group_rule_tests.rb +0 -27
- data/tests/openstack/models/network/security_group_rules_tests.rb +0 -25
- data/tests/openstack/models/network/security_group_tests.rb +0 -17
- data/tests/openstack/models/network/security_groups_tests.rb +0 -16
- data/tests/openstack/models/network/subnet_tests.rb +0 -30
- data/tests/openstack/models/network/subnets_tests.rb +0 -27
- data/tests/openstack/models/network/vpn_service_tests.rb +0 -27
- data/tests/openstack/models/network/vpn_services_tests.rb +0 -22
- data/tests/openstack/models/nfv/vnf_tests.rb +0 -35
- data/tests/openstack/models/nfv/vnfd_tests.rb +0 -23
- data/tests/openstack/models/nfv/vnfds_tests.rb +0 -31
- data/tests/openstack/models/nfv/vnfs_tests.rb +0 -38
- data/tests/openstack/models/planning/.gitkeep +0 -0
- data/tests/openstack/models/planning/plan_tests.rb +0 -51
- data/tests/openstack/models/planning/plans_tests.rb +0 -18
- data/tests/openstack/models/planning/role_tests.rb +0 -14
- data/tests/openstack/models/storage/file_tests.rb +0 -251
- data/tests/openstack/requests/compute/address_tests.rb +0 -58
- data/tests/openstack/requests/compute/aggregate_tests.rb +0 -59
- data/tests/openstack/requests/compute/availability_zone_tests.rb +0 -18
- data/tests/openstack/requests/compute/flavor_tests.rb +0 -95
- data/tests/openstack/requests/compute/helper.rb +0 -41
- data/tests/openstack/requests/compute/image_tests.rb +0 -58
- data/tests/openstack/requests/compute/keypair_tests.rb +0 -30
- data/tests/openstack/requests/compute/limit_tests.rb +0 -59
- data/tests/openstack/requests/compute/quota_tests.rb +0 -60
- data/tests/openstack/requests/compute/security_group_tests.rb +0 -61
- data/tests/openstack/requests/compute/server_tests.rb +0 -289
- data/tests/openstack/requests/compute/service_tests.rb +0 -33
- data/tests/openstack/requests/compute/tenant_tests.rb +0 -19
- data/tests/openstack/requests/compute/volume_tests.rb +0 -38
- data/tests/openstack/requests/image/image_tests.rb +0 -135
- data/tests/openstack/requests/metering/event_tests.rb +0 -17
- data/tests/openstack/requests/metering/meter_tests.rb +0 -52
- data/tests/openstack/requests/metering/resource_tests.rb +0 -19
- data/tests/openstack/requests/network/ike_policy_tests.rb +0 -65
- data/tests/openstack/requests/network/ipsec_policy_tests.rb +0 -65
- data/tests/openstack/requests/network/ipsec_site_connection_tests.rb +0 -82
- data/tests/openstack/requests/network/lb_health_monitor_tests.rb +0 -93
- data/tests/openstack/requests/network/lb_member_tests.rb +0 -60
- data/tests/openstack/requests/network/lb_pool_tests.rb +0 -80
- data/tests/openstack/requests/network/lb_vip_tests.rb +0 -71
- data/tests/openstack/requests/network/network_tests.rb +0 -107
- data/tests/openstack/requests/network/port_tests.rb +0 -66
- data/tests/openstack/requests/network/quota_tests.rb +0 -65
- data/tests/openstack/requests/network/router_tests.rb +0 -73
- data/tests/openstack/requests/network/security_group_rule_tests.rb +0 -58
- data/tests/openstack/requests/network/security_group_tests.rb +0 -43
- data/tests/openstack/requests/network/subnet_tests.rb +0 -66
- data/tests/openstack/requests/network/vpn_service_tests.rb +0 -61
- data/tests/openstack/requests/nfv/vnf_tests.rb +0 -70
- data/tests/openstack/requests/nfv/vnfd_tests.rb +0 -44
- data/tests/openstack/requests/orchestration/stack_tests.rb +0 -64
- data/tests/openstack/requests/planning/.gitkeep +0 -0
- data/tests/openstack/requests/planning/plan_tests.rb +0 -65
- data/tests/openstack/requests/planning/role_tests.rb +0 -16
- data/tests/openstack/requests/storage/container_tests.rb +0 -64
- data/tests/openstack/requests/storage/large_object_tests.rb +0 -372
- data/tests/openstack/requests/storage/object_tests.rb +0 -208
- data/tests/openstack/requests/volume/availability_zone_tests.rb +0 -13
- data/tests/openstack/requests/volume/quota_tests.rb +0 -50
- data/tests/openstack/requests/volume/volume_type_tests.rb +0 -32
@@ -1,220 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Compute[:openstack] | server", ['openstack']) do
|
2
|
-
|
3
|
-
tests('success') do
|
4
|
-
|
5
|
-
tests('#floating_ips').succeeds do
|
6
|
-
fog = Fog::Compute[:openstack]
|
7
|
-
net = Fog::Network[:openstack]
|
8
|
-
flavor = fog.flavors.first.id
|
9
|
-
image = fog.images.first.id
|
10
|
-
|
11
|
-
server = fog.servers.new(:name => 'test server',
|
12
|
-
:flavor_ref => flavor,
|
13
|
-
:image_ref => image)
|
14
|
-
server.save
|
15
|
-
|
16
|
-
ip1 = net.floating_ips.create(:floating_network_id => 'f0000000-0000-0000-0000\
|
17
|
-
-000000000000',
|
18
|
-
:fixed_ip_address => '192.168.11.3')
|
19
|
-
|
20
|
-
server.associate_address(ip1.fixed_ip_address)
|
21
|
-
server.reload
|
22
|
-
|
23
|
-
returns( ["192.168.11.3"] ) { server.floating_ip_addresses }
|
24
|
-
end
|
25
|
-
|
26
|
-
tests('#security_groups').succeeds do
|
27
|
-
fog = Fog::Compute[:openstack]
|
28
|
-
|
29
|
-
begin
|
30
|
-
my_group = fog.security_groups.create(:name => 'my_group',
|
31
|
-
:description => 'my group')
|
32
|
-
|
33
|
-
flavor = fog.flavors.first.id
|
34
|
-
image = fog.images.first.id
|
35
|
-
|
36
|
-
server = fog.servers.new(:name => 'test server',
|
37
|
-
:flavor_ref => flavor,
|
38
|
-
:image_ref => image)
|
39
|
-
|
40
|
-
server.security_groups = my_group
|
41
|
-
|
42
|
-
server.save
|
43
|
-
|
44
|
-
found_groups = server.security_groups
|
45
|
-
returns(1) { found_groups.length }
|
46
|
-
|
47
|
-
group = found_groups.first
|
48
|
-
returns('my_group') { group.name }
|
49
|
-
returns(server.service) { group.service }
|
50
|
-
ensure
|
51
|
-
unless Fog.mocking? then
|
52
|
-
server.destroy if server
|
53
|
-
|
54
|
-
begin
|
55
|
-
fog.servers.get(server.id).wait_for do false end
|
56
|
-
rescue Fog::Errors::Error
|
57
|
-
# ignore, server went away
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
my_group.destroy if my_group
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
tests('#failed') do
|
66
|
-
|
67
|
-
fog = Fog::Compute[:openstack]
|
68
|
-
|
69
|
-
flavor = fog.flavors.first.id
|
70
|
-
image = fog.images.first.id
|
71
|
-
|
72
|
-
tests('successful server').returns(false) do
|
73
|
-
server = fog.servers.new( :name => 'test server',
|
74
|
-
:flavor_ref => flavor,
|
75
|
-
:image_ref => image,
|
76
|
-
:state => 'success' )
|
77
|
-
server.failed?
|
78
|
-
end
|
79
|
-
|
80
|
-
tests('failed server').returns(true) do
|
81
|
-
server = fog.servers.new( :name => 'test server',
|
82
|
-
:flavor_ref => flavor,
|
83
|
-
:image_ref => image,
|
84
|
-
:state => 'ERROR' )
|
85
|
-
server.failed?
|
86
|
-
end
|
87
|
-
|
88
|
-
end
|
89
|
-
|
90
|
-
tests('#metadata').succeeds do
|
91
|
-
fog = Fog::Compute[:openstack]
|
92
|
-
|
93
|
-
begin
|
94
|
-
flavor = fog.flavors.first.id
|
95
|
-
image = fog.images.first.id
|
96
|
-
|
97
|
-
server = fog.servers.new(:name => 'test server',
|
98
|
-
:metadata => {"foo" => "bar"},
|
99
|
-
:flavor_ref => flavor,
|
100
|
-
:image_ref => image)
|
101
|
-
|
102
|
-
server.save
|
103
|
-
|
104
|
-
returns(1) { server.metadata.length }
|
105
|
-
|
106
|
-
server.metadata.each do |datum|
|
107
|
-
datum.value = 'foo'
|
108
|
-
datum.save
|
109
|
-
datum.destroy
|
110
|
-
end
|
111
|
-
|
112
|
-
ensure
|
113
|
-
unless Fog.mocking? then
|
114
|
-
server.destroy if server
|
115
|
-
|
116
|
-
begin
|
117
|
-
fog.servers.get(server.id).wait_for do false end
|
118
|
-
rescue Fog::Errors::Error
|
119
|
-
# ignore, server went away
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
tests('#resize').succeeds do
|
127
|
-
fog = Fog::Compute[:openstack]
|
128
|
-
|
129
|
-
begin
|
130
|
-
flavor = fog.flavors.first.id
|
131
|
-
image = fog.images.first.id
|
132
|
-
|
133
|
-
server = fog.servers.new(:name => 'test server',
|
134
|
-
:flavor_ref => flavor,
|
135
|
-
:image_ref => image)
|
136
|
-
|
137
|
-
server.save
|
138
|
-
|
139
|
-
flavor_resize = fog.flavors[1].id
|
140
|
-
server.resize(flavor_resize)
|
141
|
-
server.wait_for { server.state == "VERIFY_RESIZE" } unless Fog.mocking?
|
142
|
-
server.revert_resize
|
143
|
-
server.wait_for { server.state == "ACTIVE" } unless Fog.mocking?
|
144
|
-
server.resize(flavor_resize)
|
145
|
-
server.wait_for { server.state == "VERIFY_RESIZE" } unless Fog.mocking?
|
146
|
-
server.confirm_resize
|
147
|
-
|
148
|
-
ensure
|
149
|
-
unless Fog.mocking? then
|
150
|
-
server.destroy if server
|
151
|
-
|
152
|
-
begin
|
153
|
-
fog.servers.get(server.id).wait_for do false end
|
154
|
-
rescue Fog::Errors::Error
|
155
|
-
# ignore, server went away
|
156
|
-
end
|
157
|
-
end
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
tests('#volumes').succeeds do
|
162
|
-
fog = Fog::Compute[:openstack]
|
163
|
-
|
164
|
-
begin
|
165
|
-
volume = fog.volumes.new(:name => 'test volume',
|
166
|
-
:description => 'test volume',
|
167
|
-
:size => 1)
|
168
|
-
volume.save
|
169
|
-
volume.wait_for { volume.status == 'available' } unless Fog.mocking?
|
170
|
-
|
171
|
-
flavor = fog.flavors.first.id
|
172
|
-
image = fog.images.first.id
|
173
|
-
|
174
|
-
server = fog.servers.new(:name => 'test server',
|
175
|
-
:flavor_ref => flavor,
|
176
|
-
:image_ref => image)
|
177
|
-
|
178
|
-
server.save
|
179
|
-
server.wait_for { server.state == "ACTIVE" } unless Fog.mocking?
|
180
|
-
|
181
|
-
server.attach_volume(volume.id, '/dev/vdc')
|
182
|
-
volume.wait_for { volume.status == 'in-use' } unless Fog.mocking?
|
183
|
-
|
184
|
-
found_volumes = server.volumes
|
185
|
-
returns(1) { found_volumes.length }
|
186
|
-
|
187
|
-
volume = found_volumes.first
|
188
|
-
returns('test volume') { volume.name }
|
189
|
-
|
190
|
-
found_attachments = server.volume_attachments
|
191
|
-
returns(1) { found_attachments.length }
|
192
|
-
|
193
|
-
attachment = found_attachments.first
|
194
|
-
returns('/dev/vdc') { attachment['device'] }
|
195
|
-
|
196
|
-
server.detach_volume(volume.id)
|
197
|
-
volume.wait_for { volume.status == 'available' } unless Fog.mocking?
|
198
|
-
|
199
|
-
found_volumes = server.volumes
|
200
|
-
returns(0) { found_volumes.length }
|
201
|
-
|
202
|
-
found_attachments = server.volume_attachments
|
203
|
-
returns(0) { found_attachments.length }
|
204
|
-
ensure
|
205
|
-
unless Fog.mocking? then
|
206
|
-
server.destroy if server
|
207
|
-
volume.destroy if volume
|
208
|
-
|
209
|
-
begin
|
210
|
-
fog.servers.get(server.id).wait_for do false end
|
211
|
-
fog.volumes.get(volume.id).wait_for do false end
|
212
|
-
rescue Fog::Errors::Error
|
213
|
-
# ignore, server went away
|
214
|
-
end
|
215
|
-
end
|
216
|
-
end
|
217
|
-
end
|
218
|
-
|
219
|
-
end
|
220
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Compute[:openstack] | services", ['openstack']) do
|
2
|
-
tests('success') do
|
3
|
-
tests('#all').succeeds do
|
4
|
-
services = Fog::Compute[:openstack].services.all
|
5
|
-
@service = services.first
|
6
|
-
end
|
7
|
-
|
8
|
-
tests('#get').succeeds do
|
9
|
-
service = Fog::Compute[:openstack].services.get(@service.id)
|
10
|
-
%w(id binary host).all? do |attr|
|
11
|
-
attr1 = service.send(attr.to_sym)
|
12
|
-
attr2 = @service.send(attr.to_sym)
|
13
|
-
attr1 == attr2
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Image[:openstack] | image", ['openstack']) do
|
2
|
-
|
3
|
-
tests('success') do
|
4
|
-
tests('#create').succeeds do
|
5
|
-
@instance = Fog::Image[:openstack].images.create(:name => 'test image')
|
6
|
-
!@instance.id.nil?
|
7
|
-
end
|
8
|
-
|
9
|
-
tests('#update').succeeds do
|
10
|
-
@instance.name = 'edit test image'
|
11
|
-
@instance.update
|
12
|
-
@instance.name == 'edit test image'
|
13
|
-
end
|
14
|
-
|
15
|
-
tests('#get image metadata').succeeds do
|
16
|
-
@instance.metadata
|
17
|
-
end
|
18
|
-
|
19
|
-
tests('#add member').succeeds do
|
20
|
-
@instance.add_member(@instance.owner)
|
21
|
-
end
|
22
|
-
|
23
|
-
tests('#show members').succeeds do
|
24
|
-
@instance.members
|
25
|
-
end
|
26
|
-
|
27
|
-
tests('#remove member').succeeds do
|
28
|
-
@instance.remove_member(@instance.owner)
|
29
|
-
end
|
30
|
-
|
31
|
-
tests('#destroy').succeeds do
|
32
|
-
@instance.destroy == true
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Image[:openstack] | images", ['openstack']) do
|
2
|
-
@instance = Fog::Image[:openstack].create_image({:name => "model test image"}).body
|
3
|
-
|
4
|
-
tests('success') do
|
5
|
-
tests('#find_by_id').succeeds do
|
6
|
-
image = Fog::Image[:openstack].images.find_by_id(@instance['image']['id'])
|
7
|
-
image.id == @instance['image']['id']
|
8
|
-
end
|
9
|
-
|
10
|
-
tests('#get').succeeds do
|
11
|
-
image = Fog::Image[:openstack].images.get(@instance['image']['id'])
|
12
|
-
image.id == @instance['image']['id']
|
13
|
-
end
|
14
|
-
|
15
|
-
tests('#destroy').succeeds do
|
16
|
-
Fog::Image[:openstack].images.destroy(@instance['image']['id'])
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Network[:openstack] | floating_ip", ['openstack']) do
|
2
|
-
|
3
|
-
tests('success') do
|
4
|
-
|
5
|
-
tests('#create').succeeds do
|
6
|
-
@instance = Fog::Network[:openstack].floating_ips.create(:floating_network_id => 'f0000000-0000-0000-0000-000000000000')
|
7
|
-
|
8
|
-
!@instance.id.nil?
|
9
|
-
end
|
10
|
-
|
11
|
-
tests('#update').succeeds do
|
12
|
-
@instance.port_id = 'p0000000-0000-0000-0000-000000000000'
|
13
|
-
@instance.update
|
14
|
-
end
|
15
|
-
|
16
|
-
tests('#destroy').succeeds do
|
17
|
-
@instance.destroy == true
|
18
|
-
end
|
19
|
-
|
20
|
-
tests('#associate').succeeds do
|
21
|
-
port_id = 'p0000000-0000-0000-0000-000000000000'
|
22
|
-
fixed_ip_address = '8.8.8.8'
|
23
|
-
@instance.associate(port_id, fixed_ip_address)
|
24
|
-
returns(port_id) { @instance.port_id }
|
25
|
-
returns(fixed_ip_address) { @instance.fixed_ip_address }
|
26
|
-
end
|
27
|
-
|
28
|
-
tests('#disassociate').succeeds do
|
29
|
-
fixed_ip_address = '8.8.8.8'
|
30
|
-
@instance.disassociate(fixed_ip_address)
|
31
|
-
returns(nil) { @instance.port_id }
|
32
|
-
returns(nil) { @instance.fixed_ip_address }
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Network[:openstack] | floating_ips", ['openstack']) do
|
2
|
-
@floating_ip = Fog::Network[:openstack].floating_ips.create(:floating_network_id => 'f0000000-0000-0000-0000-000000000000')
|
3
|
-
|
4
|
-
@floating_ips = Fog::Network[:openstack].floating_ips
|
5
|
-
|
6
|
-
tests('success') do
|
7
|
-
|
8
|
-
tests('#all').succeeds do
|
9
|
-
@floating_ips.all
|
10
|
-
end
|
11
|
-
|
12
|
-
tests('#get').succeeds do
|
13
|
-
@floating_ips.get @floating_ip.id
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
@floating_ip.destroy
|
19
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Network[:openstack] | ike_policies", ['openstack']) do
|
2
|
-
@ike_policy = Fog::Network[:openstack].ike_policies.create(:name => 'test-ike-policy',
|
3
|
-
:description => 'Test VPN IKE Policy',
|
4
|
-
:tenant_id => 'tenant_id',
|
5
|
-
:auth_algorithm => 'sha1',
|
6
|
-
:encryption_algorithm => 'aes-256',
|
7
|
-
:pfs => 'group5',
|
8
|
-
:phase1_negotiation_mode => 'main',
|
9
|
-
:lifetime => {
|
10
|
-
'units' => 'seconds',
|
11
|
-
'value' => 3600
|
12
|
-
},
|
13
|
-
:ike_version => 'v1')
|
14
|
-
|
15
|
-
@ike_policies = Fog::Network[:openstack].ike_policies
|
16
|
-
|
17
|
-
tests('success') do
|
18
|
-
tests('#all').succeeds do
|
19
|
-
@ike_policies.all
|
20
|
-
end
|
21
|
-
|
22
|
-
tests('#get').succeeds do
|
23
|
-
@ike_policies.get(@ike_policy.id)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
@ike_policy.destroy
|
28
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Network[:openstack] | ike_policy", ['openstack']) do
|
2
|
-
tests('success') do
|
3
|
-
tests('#create').succeeds do
|
4
|
-
@instance = Fog::Network[:openstack].ike_policies.create(:name => 'test-ike-policy',
|
5
|
-
:description => 'Test VPN IKE Policy',
|
6
|
-
:tenant_id => 'tenant_id',
|
7
|
-
:auth_algorithm => 'sha1',
|
8
|
-
:encryption_algorithm => 'aes-256',
|
9
|
-
:pfs => 'group5',
|
10
|
-
:phase1_negotiation_mode => 'main',
|
11
|
-
:lifetime => {
|
12
|
-
'units' => 'seconds',
|
13
|
-
'value' => 3600
|
14
|
-
},
|
15
|
-
:ike_version => 'v1')
|
16
|
-
!@instance.id.nil?
|
17
|
-
end
|
18
|
-
|
19
|
-
tests('#update').succeeds do
|
20
|
-
@instance.name = 'rename-test-ike-policy'
|
21
|
-
@instance.description = 'Test VPN IKE Policy'
|
22
|
-
@instance.tenant_id = 'baz'
|
23
|
-
@instance.auth_algorithm = 'sha512'
|
24
|
-
@instance.encryption_algorithm = 'aes-512'
|
25
|
-
@pfs = 'group1'
|
26
|
-
@phase1_negotiation_mode = 'main'
|
27
|
-
@ike_version = 'v1'
|
28
|
-
@lifetime = {'units' => 'seconds', 'value' => 3600}
|
29
|
-
@instance.update
|
30
|
-
end
|
31
|
-
|
32
|
-
tests('#destroy').succeeds do
|
33
|
-
@instance.destroy == true
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Network[:openstack] | ipsec_policies", ['openstack']) do
|
2
|
-
params = {:name => 'test-ipsec-policy',
|
3
|
-
:description => 'Test VPN ipsec Policy',
|
4
|
-
:tenant_id => 'tenant_id',
|
5
|
-
:auth_algorithm => 'sha1',
|
6
|
-
:encryption_algorithm => 'aes-128',
|
7
|
-
:pfs => 'group5',
|
8
|
-
:transform_protocol => 'esp',
|
9
|
-
:lifetime => {'units' => 'seconds', 'value' => 3600},
|
10
|
-
:encapsulation_mode => 'tunnel'}
|
11
|
-
@ipsec_policy = Fog::Network[:openstack].ipsec_policies.create(params)
|
12
|
-
|
13
|
-
@ipsec_policies = Fog::Network[:openstack].ipsec_policies
|
14
|
-
|
15
|
-
tests('success') do
|
16
|
-
tests('#all').succeeds do
|
17
|
-
@ipsec_policies.all
|
18
|
-
end
|
19
|
-
|
20
|
-
tests('#get').succeeds do
|
21
|
-
@ipsec_policies.get(@ipsec_policy.id)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
@ipsec_policy.destroy
|
26
|
-
end
|