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.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -28
  3. data/docs/workflow.md +129 -0
  4. data/examples/workflow/workflow-examples.rb +387 -0
  5. data/gemfiles/Gemfile-1.9 +1 -0
  6. data/lib/fog/openstack.rb +5 -1
  7. data/lib/fog/openstack/baremetal.rb +14 -38
  8. data/lib/fog/openstack/compute.rb +4 -33
  9. data/lib/fog/openstack/core.rb +104 -50
  10. data/lib/fog/openstack/identity.rb +2 -1
  11. data/lib/fog/openstack/identity_v2.rb +0 -2
  12. data/lib/fog/openstack/identity_v3.rb +0 -2
  13. data/lib/fog/openstack/image_v1.rb +6 -6
  14. data/lib/fog/openstack/image_v2.rb +7 -6
  15. data/lib/fog/openstack/introspection.rb +10 -35
  16. data/lib/fog/openstack/metering.rb +16 -35
  17. data/lib/fog/openstack/monitoring.rb +5 -31
  18. data/lib/fog/openstack/network.rb +5 -34
  19. data/lib/fog/openstack/nfv.rb +10 -35
  20. data/lib/fog/openstack/orchestration.rb +5 -40
  21. data/lib/fog/openstack/planning.rb +11 -36
  22. data/lib/fog/openstack/requests/compute/get_limits.rb +8 -7
  23. data/lib/fog/openstack/requests/network/update_router.rb +1 -1
  24. data/lib/fog/openstack/requests/workflow_v2/create_action.rb +28 -0
  25. data/lib/fog/openstack/requests/workflow_v2/create_action_execution.rb +31 -0
  26. data/lib/fog/openstack/requests/workflow_v2/create_cron_trigger.rb +55 -0
  27. data/lib/fog/openstack/requests/workflow_v2/create_environment.rb +31 -0
  28. data/lib/fog/openstack/requests/workflow_v2/create_execution.rb +30 -0
  29. data/lib/fog/openstack/requests/workflow_v2/create_workbook.rb +28 -0
  30. data/lib/fog/openstack/requests/workflow_v2/create_workflow.rb +28 -0
  31. data/lib/fog/openstack/requests/workflow_v2/delete_action.rb +25 -0
  32. data/lib/fog/openstack/requests/workflow_v2/delete_action_execution.rb +25 -0
  33. data/lib/fog/openstack/requests/workflow_v2/delete_cron_trigger.rb +25 -0
  34. data/lib/fog/openstack/requests/workflow_v2/delete_environment.rb +25 -0
  35. data/lib/fog/openstack/requests/workflow_v2/delete_execution.rb +25 -0
  36. data/lib/fog/openstack/requests/workflow_v2/delete_workbook.rb +25 -0
  37. data/lib/fog/openstack/requests/workflow_v2/delete_workflow.rb +25 -0
  38. data/lib/fog/openstack/requests/workflow_v2/get_action.rb +27 -0
  39. data/lib/fog/openstack/requests/workflow_v2/get_action_execution.rb +26 -0
  40. data/lib/fog/openstack/requests/workflow_v2/get_cron_trigger.rb +28 -0
  41. data/lib/fog/openstack/requests/workflow_v2/get_environment.rb +28 -0
  42. data/lib/fog/openstack/requests/workflow_v2/get_execution.rb +26 -0
  43. data/lib/fog/openstack/requests/workflow_v2/get_task.rb +27 -0
  44. data/lib/fog/openstack/requests/workflow_v2/get_workbook.rb +28 -0
  45. data/lib/fog/openstack/requests/workflow_v2/get_workflow.rb +28 -0
  46. data/lib/fog/openstack/requests/workflow_v2/list_action_executions.rb +28 -0
  47. data/lib/fog/openstack/requests/workflow_v2/list_actions.rb +30 -0
  48. data/lib/fog/openstack/requests/workflow_v2/list_cron_triggers.rb +28 -0
  49. data/lib/fog/openstack/requests/workflow_v2/list_environments.rb +28 -0
  50. data/lib/fog/openstack/requests/workflow_v2/list_executions.rb +28 -0
  51. data/lib/fog/openstack/requests/workflow_v2/list_services.rb +28 -0
  52. data/lib/fog/openstack/requests/workflow_v2/list_tasks.rb +28 -0
  53. data/lib/fog/openstack/requests/workflow_v2/list_workbooks.rb +28 -0
  54. data/lib/fog/openstack/requests/workflow_v2/list_workflows.rb +30 -0
  55. data/lib/fog/openstack/requests/workflow_v2/rerun_task.rb +33 -0
  56. data/lib/fog/openstack/requests/workflow_v2/update_action.rb +28 -0
  57. data/lib/fog/openstack/requests/workflow_v2/update_action_execution.rb +33 -0
  58. data/lib/fog/openstack/requests/workflow_v2/update_environment.rb +31 -0
  59. data/lib/fog/openstack/requests/workflow_v2/update_execution.rb +33 -0
  60. data/lib/fog/openstack/requests/workflow_v2/update_workbook.rb +28 -0
  61. data/lib/fog/openstack/requests/workflow_v2/update_workflow.rb +28 -0
  62. data/lib/fog/openstack/requests/workflow_v2/validate_action.rb +28 -0
  63. data/lib/fog/openstack/requests/workflow_v2/validate_workbook.rb +28 -0
  64. data/lib/fog/openstack/requests/workflow_v2/validate_workflow.rb +28 -0
  65. data/lib/fog/openstack/storage.rb +4 -35
  66. data/lib/fog/openstack/version.rb +1 -1
  67. data/lib/fog/openstack/volume_v1.rb +7 -5
  68. data/lib/fog/openstack/volume_v2.rb +7 -5
  69. data/lib/fog/openstack/workflow.rb +12 -0
  70. data/lib/fog/openstack/workflow_v2.rb +160 -0
  71. metadata +48 -95
  72. data/lib/fog/openstack/common.rb +0 -44
  73. data/tests/openstack/models/compute/images_tests.rb +0 -13
  74. data/tests/openstack/models/compute/security_group_tests.rb +0 -54
  75. data/tests/openstack/models/compute/server_tests.rb +0 -220
  76. data/tests/openstack/models/compute/service_tests.rb +0 -17
  77. data/tests/openstack/models/image/image_tests.rb +0 -36
  78. data/tests/openstack/models/image/images_tests.rb +0 -19
  79. data/tests/openstack/models/network/floating_ip_tests.rb +0 -35
  80. data/tests/openstack/models/network/floating_ips_tests.rb +0 -19
  81. data/tests/openstack/models/network/ike_policies_tests.rb +0 -28
  82. data/tests/openstack/models/network/ike_policy_tests.rb +0 -36
  83. data/tests/openstack/models/network/ipsec_policies_tests.rb +0 -26
  84. data/tests/openstack/models/network/ipsec_policy_tests.rb +0 -36
  85. data/tests/openstack/models/network/ipsec_site_connection_tests.rb +0 -50
  86. data/tests/openstack/models/network/ipsec_site_connections_tests.rb +0 -32
  87. data/tests/openstack/models/network/lb_health_monitor_tests.rb +0 -52
  88. data/tests/openstack/models/network/lb_health_monitors_tests.rb +0 -21
  89. data/tests/openstack/models/network/lb_member_tests.rb +0 -28
  90. data/tests/openstack/models/network/lb_members_tests.rb +0 -21
  91. data/tests/openstack/models/network/lb_pool_tests.rb +0 -53
  92. data/tests/openstack/models/network/lb_pools_tests.rb +0 -20
  93. data/tests/openstack/models/network/lb_vip_tests.rb +0 -39
  94. data/tests/openstack/models/network/lb_vips_tests.rb +0 -21
  95. data/tests/openstack/models/network/network_tests.rb +0 -61
  96. data/tests/openstack/models/network/networks_tests.rb +0 -21
  97. data/tests/openstack/models/network/port_tests.rb +0 -28
  98. data/tests/openstack/models/network/ports_tests.rb +0 -25
  99. data/tests/openstack/models/network/router_tests.rb +0 -39
  100. data/tests/openstack/models/network/routers_tests.rb +0 -21
  101. data/tests/openstack/models/network/security_group_rule_tests.rb +0 -27
  102. data/tests/openstack/models/network/security_group_rules_tests.rb +0 -25
  103. data/tests/openstack/models/network/security_group_tests.rb +0 -17
  104. data/tests/openstack/models/network/security_groups_tests.rb +0 -16
  105. data/tests/openstack/models/network/subnet_tests.rb +0 -30
  106. data/tests/openstack/models/network/subnets_tests.rb +0 -27
  107. data/tests/openstack/models/network/vpn_service_tests.rb +0 -27
  108. data/tests/openstack/models/network/vpn_services_tests.rb +0 -22
  109. data/tests/openstack/models/nfv/vnf_tests.rb +0 -35
  110. data/tests/openstack/models/nfv/vnfd_tests.rb +0 -23
  111. data/tests/openstack/models/nfv/vnfds_tests.rb +0 -31
  112. data/tests/openstack/models/nfv/vnfs_tests.rb +0 -38
  113. data/tests/openstack/models/planning/.gitkeep +0 -0
  114. data/tests/openstack/models/planning/plan_tests.rb +0 -51
  115. data/tests/openstack/models/planning/plans_tests.rb +0 -18
  116. data/tests/openstack/models/planning/role_tests.rb +0 -14
  117. data/tests/openstack/models/storage/file_tests.rb +0 -251
  118. data/tests/openstack/requests/compute/address_tests.rb +0 -58
  119. data/tests/openstack/requests/compute/aggregate_tests.rb +0 -59
  120. data/tests/openstack/requests/compute/availability_zone_tests.rb +0 -18
  121. data/tests/openstack/requests/compute/flavor_tests.rb +0 -95
  122. data/tests/openstack/requests/compute/helper.rb +0 -41
  123. data/tests/openstack/requests/compute/image_tests.rb +0 -58
  124. data/tests/openstack/requests/compute/keypair_tests.rb +0 -30
  125. data/tests/openstack/requests/compute/limit_tests.rb +0 -59
  126. data/tests/openstack/requests/compute/quota_tests.rb +0 -60
  127. data/tests/openstack/requests/compute/security_group_tests.rb +0 -61
  128. data/tests/openstack/requests/compute/server_tests.rb +0 -289
  129. data/tests/openstack/requests/compute/service_tests.rb +0 -33
  130. data/tests/openstack/requests/compute/tenant_tests.rb +0 -19
  131. data/tests/openstack/requests/compute/volume_tests.rb +0 -38
  132. data/tests/openstack/requests/image/image_tests.rb +0 -135
  133. data/tests/openstack/requests/metering/event_tests.rb +0 -17
  134. data/tests/openstack/requests/metering/meter_tests.rb +0 -52
  135. data/tests/openstack/requests/metering/resource_tests.rb +0 -19
  136. data/tests/openstack/requests/network/ike_policy_tests.rb +0 -65
  137. data/tests/openstack/requests/network/ipsec_policy_tests.rb +0 -65
  138. data/tests/openstack/requests/network/ipsec_site_connection_tests.rb +0 -82
  139. data/tests/openstack/requests/network/lb_health_monitor_tests.rb +0 -93
  140. data/tests/openstack/requests/network/lb_member_tests.rb +0 -60
  141. data/tests/openstack/requests/network/lb_pool_tests.rb +0 -80
  142. data/tests/openstack/requests/network/lb_vip_tests.rb +0 -71
  143. data/tests/openstack/requests/network/network_tests.rb +0 -107
  144. data/tests/openstack/requests/network/port_tests.rb +0 -66
  145. data/tests/openstack/requests/network/quota_tests.rb +0 -65
  146. data/tests/openstack/requests/network/router_tests.rb +0 -73
  147. data/tests/openstack/requests/network/security_group_rule_tests.rb +0 -58
  148. data/tests/openstack/requests/network/security_group_tests.rb +0 -43
  149. data/tests/openstack/requests/network/subnet_tests.rb +0 -66
  150. data/tests/openstack/requests/network/vpn_service_tests.rb +0 -61
  151. data/tests/openstack/requests/nfv/vnf_tests.rb +0 -70
  152. data/tests/openstack/requests/nfv/vnfd_tests.rb +0 -44
  153. data/tests/openstack/requests/orchestration/stack_tests.rb +0 -64
  154. data/tests/openstack/requests/planning/.gitkeep +0 -0
  155. data/tests/openstack/requests/planning/plan_tests.rb +0 -65
  156. data/tests/openstack/requests/planning/role_tests.rb +0 -16
  157. data/tests/openstack/requests/storage/container_tests.rb +0 -64
  158. data/tests/openstack/requests/storage/large_object_tests.rb +0 -372
  159. data/tests/openstack/requests/storage/object_tests.rb +0 -208
  160. data/tests/openstack/requests/volume/availability_zone_tests.rb +0 -13
  161. data/tests/openstack/requests/volume/quota_tests.rb +0 -50
  162. data/tests/openstack/requests/volume/volume_type_tests.rb +0 -32
@@ -1,33 +0,0 @@
1
- Shindo.tests('Fog::Compute[:openstack] | service requests', ['openstack']) do
2
-
3
- @service_format = {
4
- "id" => Integer,
5
- "binary" => String,
6
- "host" => String,
7
- "state" => String,
8
- "status" => String,
9
- "updated_at" => String,
10
- "zone" => String,
11
- 'disabled_reason' => Fog::Nullable::String
12
- }
13
-
14
- tests('success') do
15
- tests('#list_services').data_matches_schema({'services' => [@service_format]}) do
16
- services = Fog::Compute[:openstack].list_services.body
17
- @service = services['services'].last
18
- services
19
- end
20
-
21
- tests('#disable_service').succeeds do
22
- Fog::Compute[:openstack].disable_service(@service['host'], @service['binary'])
23
- end
24
-
25
- tests('#disable_service_log_reason').succeeds do
26
- Fog::Compute[:openstack].disable_service_log_reason(@service['host'], @service['binary'], 'reason')
27
- end
28
-
29
- tests('#enable_service').succeeds do
30
- Fog::Compute[:openstack].enable_service(@service['host'], @service['binary'])
31
- end
32
- end
33
- end
@@ -1,19 +0,0 @@
1
- Shindo.tests('Fog::Compute[:openstack] | tenant requests', ['openstack']) do
2
-
3
- @tenant_format = {
4
- 'id' => String,
5
- 'name' => String,
6
- 'enabled' => Fog::Boolean,
7
- 'description' => Fog::Nullable::String
8
- }
9
-
10
- tests('success') do
11
- tests('#list_tenants').formats({'tenants_links' => Array, 'tenants' => [@tenant_format]}) do
12
- Fog::Compute[:openstack].list_tenants.body
13
- end
14
-
15
- tests('#set_tenant("admin")').succeeds do
16
- Fog::Compute[:openstack].set_tenant("admin")
17
- end
18
- end
19
- end
@@ -1,38 +0,0 @@
1
- require 'fog/openstack'
2
-
3
- Shindo.tests('Fog::Compute[:openstack] | volume requests', ['openstack']) do
4
-
5
- @volume_format = {
6
- 'id' => String,
7
- 'displayName' => String,
8
- 'size' => Integer,
9
- 'displayDescription' => String,
10
- 'status' => String,
11
- 'snapshotId' => Fog::Nullable::String,
12
- 'availabilityZone' => String,
13
- 'attachments' => Array,
14
- 'volumeType' => Fog::Nullable::String,
15
- 'createdAt' => String,
16
- 'metadata' => Hash
17
- }
18
-
19
- tests('success') do
20
- tests('#create_volume').data_matches_schema({'volume' => @volume_format}) do
21
- Fog::Compute[:openstack].create_volume('loud', 'this is a loud volume', 3).body
22
- end
23
-
24
- tests('#list_volumes').data_matches_schema({'volumes' => [@volume_format]}) do
25
- Fog::Compute[:openstack].list_volumes.body
26
- end
27
-
28
- tests('#get_volume_detail').data_matches_schema({'volume' => @volume_format}) do
29
- volume_id = Fog::Compute[:openstack].volumes.all.first.id
30
- Fog::Compute[:openstack].get_volume_details(volume_id).body
31
- end
32
-
33
- tests('#delete_volume').succeeds do
34
- volume_id = Fog::Compute[:openstack].volumes.all.first.id
35
- Fog::Compute[:openstack].delete_volume(volume_id)
36
- end
37
- end
38
- end
@@ -1,135 +0,0 @@
1
- Shindo.tests('Fog::Image[:openstack] | image requests', ['openstack']) do
2
- openstack = Fog::Identity[:openstack]
3
-
4
- @image_attributes = {
5
- :name => 'new image',
6
- :owner => openstack.current_tenant['id'],
7
- :is_public => true,
8
- :copy_from => 'http://website.com/image.iso',
9
- :disk_format => 'iso',
10
- :properties =>
11
- {:user_id => openstack.current_user['id'],
12
- :owner_id => openstack.current_tenant['id']},
13
- :container_format => 'bare' }
14
-
15
- @image_format = {
16
- 'name' => String,
17
- 'container_format' => String,
18
- 'disk_format' => String,
19
- 'checksum' => String,
20
- 'id' => String,
21
- 'size' => Integer
22
- }
23
-
24
- @detailed_image_format = {
25
- 'id' => String,
26
- 'name' => String,
27
- 'size' => Integer,
28
- 'disk_format' => String,
29
- 'container_format' => String,
30
- 'checksum' => String,
31
- 'min_disk' => Integer,
32
- 'created_at' => String,
33
- 'deleted_at' => Fog::Nullable::String,
34
- 'updated_at' => String,
35
- 'deleted' => Fog::Boolean,
36
- 'protected' => Fog::Boolean,
37
- 'is_public' => Fog::Boolean,
38
- 'status' => String,
39
- 'min_ram' => Integer,
40
- 'owner' => Fog::Nullable::String,
41
- 'properties' => Hash
42
- }
43
-
44
- @image_meta_format ={
45
- 'X-Image-Meta-Is_public'=>String,
46
- 'X-Image-Meta-Min_disk'=>Fog::Nullable::String,
47
- 'X-Image-Meta-Property-Ramdisk_id'=>Fog::Nullable::String,
48
- 'X-Image-Meta-Disk_format'=>Fog::Nullable::String,
49
- 'X-Image-Meta-Created_at'=>String,
50
- 'X-Image-Meta-Container_format'=>Fog::Nullable::String,
51
- 'Etag'=>String,
52
- 'Location'=>String,
53
- 'X-Image-Meta-Protected'=>String,
54
- 'Date'=>String,
55
- 'X-Image-Meta-Name'=>String,
56
- 'X-Image-Meta-Min_ram'=>String,
57
- 'Content-Type'=>String,
58
- 'X-Image-Meta-Updated_at'=>String,
59
- 'X-Image-Meta-Property-Kernel_id'=>Fog::Nullable::String,
60
- 'X-Image-Meta-Size'=>String,
61
- 'X-Image-Meta-Checksum'=>Fog::Nullable::String,
62
- 'X-Image-Meta-Deleted'=>String,
63
- 'Content-Length'=>String,
64
- 'X-Image-Meta-Status'=>String,
65
- 'X-Image-Meta-Owner'=>String,
66
- 'X-Image-Meta-Id'=>String
67
- }
68
-
69
- @image_members_format =[
70
- {'can_share'=>Fog::Nullable::Boolean,
71
- 'member_id'=>String
72
- }
73
- ]
74
-
75
- tests('success') do
76
- tests('#list_public_images').data_matches_schema({'images' => [@image_format]}) do
77
- Fog::Image[:openstack].list_public_images.body
78
- end
79
-
80
- tests('#list_public_images_detailed').data_matches_schema({'images' => [@detailed_image_format]}) do
81
- Fog::Image[:openstack].list_public_images_detailed.body
82
- end
83
-
84
- tests('#create_image').data_matches_schema({'image' => @detailed_image_format}) do
85
- begin
86
- if Fog.mocking?
87
- image_attributes = @image_attributes
88
- else
89
- require 'tempfile'
90
- image_attributes = @image_attributes.dup
91
- image_attributes.delete(:copy_from)
92
- test_iso = Tempfile.new(['fog_test_iso', '.iso'])
93
- test_iso.write Fog::Mock.random_hex(32)
94
- test_iso.close
95
- image_attributes[:location] = test_iso.path
96
- end
97
- @instance = Fog::Image[:openstack].create_image(image_attributes).body
98
- ensure
99
- test_iso.delete if test_iso
100
- end
101
- end
102
-
103
- tests('#get_image').data_matches_schema(@image_meta_format) do
104
- Fog::Image[:openstack].get_image(@instance['image']['id']).headers
105
- end
106
-
107
- tests('#update_image').data_matches_schema(@detailed_image_format) do
108
- Fog::Image[:openstack].update_image({:id => @instance['image']['id'],
109
- :name => 'edit image'}).body['image']
110
- end
111
-
112
- tests('#add_member_to_image').succeeds do
113
- Fog::Image[:openstack].add_member_to_image(
114
- @instance['image']['id'], @instance['image']['owner'])
115
- end
116
-
117
- tests('#get_image_members').succeeds do
118
- Fog::Image[:openstack].get_image_members(@instance['image']['id'])
119
- end
120
-
121
- tests('#get_shared_images').succeeds do
122
- Fog::Image[:openstack].get_shared_images(@instance['image']['owner'])
123
- end
124
-
125
- tests('#remove_member_from_image').succeeds do
126
- Fog::Image[:openstack].remove_member_from_image(
127
- @instance['image']['id'], @instance['image']['owner'])
128
- end
129
-
130
- tests('#delete_image').succeeds do
131
- Fog::Image[:openstack].delete_image(@instance['image']['id'])
132
- end
133
-
134
- end
135
- end
@@ -1,17 +0,0 @@
1
- Shindo.tests('Fog::Metering[:openstack] | event requests', ['openstack']) do
2
-
3
- @event_format = {
4
- 'message_id' => String,
5
- 'event_type' => String,
6
- }
7
-
8
- tests('success') do
9
- tests('#list_events').formats([@event_format]) do
10
- Fog::Metering[:openstack].list_events.body
11
- end
12
-
13
- tests('#get_event').formats(@event_format) do
14
- Fog::Metering[:openstack].get_event('test').body
15
- end
16
- end
17
- end
@@ -1,52 +0,0 @@
1
- Shindo.tests('Fog::Metering[:openstack] | meter requests', ['openstack']) do
2
-
3
- @sample_format = {
4
- 'counter_name' => String,
5
- 'user_id' => String,
6
- 'resource_id' => String,
7
- 'timestamp' => String,
8
- 'resource_metadata' => Hash,
9
- 'source' => String,
10
- 'counter_unit' => String,
11
- 'counter_volume' => Float,
12
- 'project_id' => String,
13
- 'message_id' => String,
14
- 'counter_type' => String
15
- }
16
-
17
- @meter_format = {
18
- 'user_id' => String,
19
- 'name' => String,
20
- 'resource_id' => String,
21
- 'project_id' => String,
22
- 'type' => String,
23
- 'unit' => String
24
- }
25
-
26
- @statistics_format = {
27
- 'count' => Integer,
28
- 'duration_start' => String,
29
- 'min' => Float,
30
- 'max' => Float,
31
- 'duration_end' => String,
32
- 'period' => Integer,
33
- 'period_end' => String,
34
- 'duration' => Float,
35
- 'period_start' => String,
36
- 'avg' => Float,
37
- 'sum' => Float
38
- }
39
- tests('success') do
40
- tests('#list_meters').formats([@meter_format]) do
41
- Fog::Metering[:openstack].list_meters.body
42
- end
43
-
44
- tests('#get_samples').formats([@sample_format]) do
45
- Fog::Metering[:openstack].get_samples('test').body
46
- end
47
-
48
- tests('#get_statistics').formats([@statistics_format]) do
49
- Fog::Metering[:openstack].get_statistics('test').body
50
- end
51
- end
52
- end
@@ -1,19 +0,0 @@
1
- Shindo.tests('Fog::Metering[:openstack] | resource requests', ['openstack']) do
2
-
3
- @resource_format = {
4
- 'resource_id' => String,
5
- 'project_id' => String,
6
- 'user_id' => String,
7
- 'metadata' => Hash,
8
- }
9
-
10
- tests('success') do
11
- tests('#list_resource').formats([@resource_format]) do
12
- Fog::Metering[:openstack].list_resources.body
13
- end
14
-
15
- tests('#get_resource').formats(@resource_format) do
16
- Fog::Metering[:openstack].get_resource('test').body
17
- end
18
- end
19
- end
@@ -1,65 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | ike_policy requests', ['openstack']) do
2
- @ike_policy_format = {
3
- 'id' => String,
4
- 'name' => String,
5
- 'description' => String,
6
- 'tenant_id' => String,
7
- 'auth_algorithm' => String,
8
- 'encryption_algorithm' => String,
9
- 'pfs' => String,
10
- 'phase1_negotiation_mode' => String,
11
- 'lifetime' => Hash,
12
- 'ike_version' => String
13
- }
14
-
15
- tests('success') do
16
- tests('#create_ike_policy').formats('ikepolicy' => @ike_policy_format) do
17
- attributes = {:name => 'test-ike-policy', :description => 'Test VPN IKE Policy',
18
- :tenant_id => 'tenant_id', :auth_algorithm => 'sha1',
19
- :encryption_algorithm => 'aes-256', :pfs => 'group5',
20
- :phase1_negotiation_mode => 'main', :lifetime => {'units' => 'seconds', 'value' => 3600},
21
- :ike_version => 'v1'
22
- }
23
- Fog::Network[:openstack].create_ike_policy(attributes).body
24
- end
25
-
26
- tests('#list_ike_policies').formats('ikepolicies' => [@ike_policy_format]) do
27
- Fog::Network[:openstack].list_ike_policies.body
28
- end
29
-
30
- tests('#get_ike_policy').formats('ikepolicy' => @ike_policy_format) do
31
- ike_policy_id = Fog::Network[:openstack].ike_policies.all.first.id
32
- Fog::Network[:openstack].get_ike_policy(ike_policy_id).body
33
- end
34
-
35
- tests('#update_ike_policy').formats('ikepolicy' => @ike_policy_format) do
36
- ike_policy_id = Fog::Network[:openstack].ike_policies.all.first.id
37
- attributes = {:name => 'rename-test-ike-policy', :description => 'Test VPN IKE Policy',
38
- :tenant_id => 'tenant_id', :auth_algorithm => 'sha1',
39
- :encryption_algorithm => 'aes-256', :pfs => 'group5',
40
- :phase1_negotiation_mode => 'main', :lifetime => {'units' => 'seconds', 'value' => 3600},
41
- :ike_version => 'v1'
42
- }
43
- Fog::Network[:openstack].update_ike_policy(ike_policy_id, attributes).body
44
- end
45
-
46
- tests('#delete_ike_policy').succeeds do
47
- ike_policy_id = Fog::Network[:openstack].ike_policies.all.first.id
48
- Fog::Network[:openstack].delete_ike_policy(ike_policy_id)
49
- end
50
- end
51
-
52
- tests('failure') do
53
- tests('#get_ike_policy').raises(Fog::Network::OpenStack::NotFound) do
54
- Fog::Network[:openstack].get_ike_policy(0)
55
- end
56
-
57
- tests('#update_ike_policy').raises(Fog::Network::OpenStack::NotFound) do
58
- Fog::Network[:openstack].update_ike_policy(0, {})
59
- end
60
-
61
- tests('#delete_ike_policy').raises(Fog::Network::OpenStack::NotFound) do
62
- Fog::Network[:openstack].delete_ike_policy(0)
63
- end
64
- end
65
- end
@@ -1,65 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | ipsec_policy requests', ['openstack']) do
2
- @ipsec_policy_format = {
3
- 'id' => String,
4
- 'name' => String,
5
- 'description' => String,
6
- 'tenant_id' => String,
7
- 'lifetime' => Hash,
8
- 'pfs' => String,
9
- 'transform_protocol' => String,
10
- 'auth_algorithm' => String,
11
- 'encapsulation_mode' => String,
12
- 'encryption_algorithm' => String
13
- }
14
-
15
- tests('success') do
16
- tests('#create_ipsec_policy').formats('ipsecpolicy' => @ipsec_policy_format) do
17
- attributes = {:name => 'test-ipsec-policy', :description => 'Test VPN ipsec Policy',
18
- :tenant_id => 'tenant_id', :auth_algorithm => 'sha1',
19
- :encryption_algorithm => 'aes-128', :pfs => 'group5',
20
- :transform_protocol => 'esp', :lifetime => {'units' => 'seconds', 'value' => 3600},
21
- :encapsulation_mode => 'tunnel'
22
- }
23
- Fog::Network[:openstack].create_ipsec_policy(attributes).body
24
- end
25
-
26
- tests('#list_ipsec_policies').formats('ipsecpolicies' => [@ipsec_policy_format]) do
27
- Fog::Network[:openstack].list_ipsec_policies.body
28
- end
29
-
30
- tests('#get_ipsec_policy').formats('ipsecpolicy' => @ipsec_policy_format) do
31
- ipsec_policy_id = Fog::Network[:openstack].ipsec_policies.all.first.id
32
- Fog::Network[:openstack].get_ipsec_policy(ipsec_policy_id).body
33
- end
34
-
35
- tests('#update_ipsec_policy').formats('ipsecpolicy' => @ipsec_policy_format) do
36
- ipsec_policy_id = Fog::Network[:openstack].ipsec_policies.all.first.id
37
- attributes = {:name => 'rename-test-ipsec-policy', :description => 'Test VPN ipsec Policy',
38
- :tenant_id => 'tenant_id', :auth_algorithm => 'sha1',
39
- :encryption_algorithm => 'aes-128', :pfs => 'group5',
40
- :transform_protocol => 'esp', :lifetime => {'units' => 'seconds', 'value' => 3600},
41
- :encapsulation_mode => 'tunnel'
42
- }
43
- Fog::Network[:openstack].update_ipsec_policy(ipsec_policy_id, attributes).body
44
- end
45
-
46
- tests('#delete_ipsec_policy').succeeds do
47
- ipsec_policy_id = Fog::Network[:openstack].ipsec_policies.all.first.id
48
- Fog::Network[:openstack].delete_ipsec_policy(ipsec_policy_id)
49
- end
50
- end
51
-
52
- tests('failure') do
53
- tests('#get_ipsec_policy').raises(Fog::Network::OpenStack::NotFound) do
54
- Fog::Network[:openstack].get_ipsec_policy(0)
55
- end
56
-
57
- tests('#update_ipsec_policy').raises(Fog::Network::OpenStack::NotFound) do
58
- Fog::Network[:openstack].update_ipsec_policy(0, {})
59
- end
60
-
61
- tests('#delete_ipsec_policy').raises(Fog::Network::OpenStack::NotFound) do
62
- Fog::Network[:openstack].delete_ipsec_policy(0)
63
- end
64
- end
65
- end