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,21 +0,0 @@
1
- Shindo.tests("Fog::Network[:openstack] | networks", ['openstack']) do
2
- @network = Fog::Network[:openstack].networks.create(:name => 'net_name',
3
- :shared => false,
4
- :admin_state_up => true,
5
- :tenant_id => 'tenant_id')
6
- @networks = Fog::Network[:openstack].networks
7
-
8
- tests('success') do
9
-
10
- tests('#all').succeeds do
11
- @networks.all
12
- end
13
-
14
- tests('#get').succeeds do
15
- @networks.get @network.id
16
- end
17
-
18
- end
19
-
20
- @network.destroy
21
- end
@@ -1,28 +0,0 @@
1
- Shindo.tests("Fog::Network[:openstack] | port", ['openstack']) do
2
-
3
- tests('success') do
4
-
5
- tests('#create').succeeds do
6
- @instance = Fog::Network[:openstack].ports.create(:name => 'port_name',
7
- :network_id => 'net_id',
8
- :fixed_ips => [],
9
- :mac_address => 'fa:16:3e:62:91:7f',
10
- :admin_state_up => true,
11
- :device_owner => 'device_owner',
12
- :device_id => 'device_id',
13
- :tenant_id => 'tenant_id')
14
- !@instance.id.nil?
15
- end
16
-
17
- tests('#update').succeeds do
18
- @instance.name = 'new_port_name'
19
- @instance.update
20
- end
21
-
22
- tests('#destroy').succeeds do
23
- @instance.destroy == true
24
- end
25
-
26
- end
27
-
28
- end
@@ -1,25 +0,0 @@
1
- Shindo.tests("Fog::Network[:openstack] | ports", ['openstack']) do
2
- @port = Fog::Network[:openstack].ports.create(:name => 'port_name',
3
- :network_id => 'net_id',
4
- :fixed_ips => [],
5
- :mac_address => 'fa:16:3e:62:91:7f',
6
- :admin_state_up => true,
7
- :device_owner => 'device_owner',
8
- :device_id => 'device_id',
9
- :tenant_id => 'tenant_id')
10
- @ports = Fog::Network[:openstack].ports
11
-
12
- tests('success') do
13
-
14
- tests('#all').succeeds do
15
- @ports.all
16
- end
17
-
18
- tests('#get').succeeds do
19
- @ports.get @port.id
20
- end
21
-
22
- end
23
-
24
- @port.destroy
25
- end
@@ -1,39 +0,0 @@
1
- Shindo.tests("Fog::Network[:openstack] | router", ['openstack']) do
2
-
3
- tests('success') do
4
-
5
- tests('#create').succeeds do
6
- @instance = Fog::Network[:openstack].routers.create(
7
- :name => 'router_name',
8
- :admin_state_up => true
9
- )
10
- !@instance.id.nil?
11
- end
12
-
13
- tests('#update') do
14
- test('router name') do
15
- @instance.name = 'new_name'
16
- @instance.update
17
- @instance.name == 'new_name'
18
- end
19
- # Needs code from issue #1598
20
- #test 'external_gateway_info' do
21
- # net = Fog::Network[:openstack].networks.create(
22
- # :name => 'net_name',
23
- # :shared => false,
24
- # :admin_state_up => true,
25
- # :tenant_id => 'tenant_id',
26
- # :router_external => true,
27
- # )
28
- # @instance.external_gateway_info = net
29
- # @instance.update
30
- #end
31
- end
32
-
33
- tests('#destroy').succeeds do
34
- @instance.destroy == true
35
- end
36
-
37
- end
38
-
39
- end
@@ -1,21 +0,0 @@
1
- Shindo.tests("Fog::Network[:openstack] | routers", ['openstack']) do
2
- @router = Fog::Network[:openstack].routers.create(
3
- :name => 'router_name',
4
- :admin_state_up => true
5
- )
6
- @routers = Fog::Network[:openstack].routers
7
-
8
- tests('success') do
9
-
10
- tests('#all').succeeds do
11
- @routers.all
12
- end
13
-
14
- tests('#get').succeeds do
15
- @routers.get @router.id
16
- end
17
-
18
- end
19
-
20
- @router.destroy
21
- end
@@ -1,27 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | security_group_rule model', ['openstack']) do
2
-
3
- @secgroup = Fog::Network[:openstack].security_groups.create({:name => "fogsecgroup"})
4
- attributes = {:security_group_id => @secgroup.id, :direction => "ingress"}
5
- model_tests(Fog::Network[:openstack].security_group_rules, attributes, true)
6
-
7
- tests('success') do
8
- tests('#create').succeeds do
9
- attributes = {
10
- :security_group_id => @secgroup.id,
11
- :direction => "ingress",
12
- :protocol => "tcp",
13
- :port_range_min => 22,
14
- :port_range_max => 22,
15
- :remote_ip_prefix => "0.0.0.0/0"
16
- }
17
- @secgrouprule = Fog::Network[:openstack].security_group_rules.create(attributes)
18
- @secgrouprule.wait_for { ready? } unless Fog.mocking?
19
- !@secgrouprule.id.nil?
20
- end
21
-
22
- tests('#destroy').succeeds do
23
- @secgrouprule.destroy
24
- end
25
- end
26
- @secgroup.destroy
27
- end
@@ -1,25 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | security_group_rules collection', ['openstack']) do
2
-
3
- @secgroup = Fog::Network[:openstack].security_groups.create({:name => "my_secgroup"})
4
- attributes = {:security_group_id => @secgroup.id, :direction => "ingress"}
5
- collection_tests(Fog::Network[:openstack].security_group_rules, attributes, true)
6
-
7
- tests('success') do
8
- attributes = {
9
- :security_group_id => @secgroup.id,
10
- :direction => "ingress",
11
- :protocol => "tcp",
12
- :port_range_min => 22,
13
- :port_range_max => 22,
14
- :remote_ip_prefix => "0.0.0.0/0"
15
- }
16
- @secgrouprule = Fog::Network[:openstack].security_group_rules.create(attributes)
17
-
18
- tests('#all(filter)').succeeds do
19
- secgrouprule = Fog::Network[:openstack].security_group_rules.all({:direction => "ingress"})
20
- secgrouprule.first.direction == "ingress"
21
- end
22
- @secgrouprule.destroy
23
- end
24
- @secgroup.destroy
25
- end
@@ -1,17 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | security_group model', ['openstack']) do
2
-
3
- model_tests(Fog::Network[:openstack].security_groups, {:name => "fogsecgroup"}, true)
4
-
5
- tests('success') do
6
- tests('#create').succeeds do
7
- attributes = {:name => "my_secgroup", :description => "my sec group desc"}
8
- @secgroup = Fog::Network[:openstack].security_groups.create(attributes)
9
- @secgroup.wait_for { ready? } unless Fog.mocking?
10
- !@secgroup.id.nil?
11
- end
12
-
13
- tests('#destroy').succeeds do
14
- @secgroup.destroy
15
- end
16
- end
17
- end
@@ -1,16 +0,0 @@
1
- Shindo.tests('Fog::Network[:openstack] | security_groups collection', ['openstack']) do
2
-
3
- attributes = {:name => "my_secgroup", :description => "my sec group desc"}
4
- collection_tests(Fog::Network[:openstack].security_groups, attributes, true)
5
-
6
- tests('success') do
7
- attributes = {:name => "fogsecgroup", :description => "fog sec group desc"}
8
- @secgroup = Fog::Network[:openstack].security_groups.create(attributes)
9
-
10
- tests('#all(filter)').succeeds do
11
- secgroup = Fog::Network[:openstack].security_groups.all({:name => "fogsecgroup"})
12
- secgroup.first.name == "fogsecgroup"
13
- end
14
- @secgroup.destroy
15
- end
16
- end
@@ -1,30 +0,0 @@
1
- Shindo.tests("Fog::Network[:openstack] | subnet", ['openstack']) do
2
-
3
- tests('success') do
4
-
5
- tests('#create').succeeds do
6
- @instance = Fog::Network[:openstack].subnets.create(:name => 'subnet_name',
7
- :network_id => 'net_id',
8
- :cidr => '10.2.2.0/24',
9
- :ip_version => 4,
10
- :gateway_ip => '10.2.2.1',
11
- :allocation_pools => [],
12
- :dns_nameservers => [],
13
- :host_routes => [],
14
- :enable_dhcp => true,
15
- :tenant_id => 'tenant_id')
16
- !@instance.id.nil?
17
- end
18
-
19
- tests('#update').succeeds do
20
- @instance.name = 'new_subnet_name'
21
- @instance.update
22
- end
23
-
24
- tests('#destroy').succeeds do
25
- @instance.destroy == true
26
- end
27
-
28
- end
29
-
30
- end
@@ -1,27 +0,0 @@
1
- Shindo.tests("Fog::Network[:openstack] | subnets", ['openstack']) do
2
- @subnet = Fog::Network[:openstack].subnets.create(:name => 'subnet_name',
3
- :network_id => 'net_id',
4
- :cidr => '10.2.2.0/24',
5
- :ip_version => 4,
6
- :gateway_ip => '10.2.2.1',
7
- :allocation_pools => [],
8
- :dns_nameservers => [],
9
- :host_routes => [],
10
- :enable_dhcp => true,
11
- :tenant_id => 'tenant_id')
12
- @subnets = Fog::Network[:openstack].subnets
13
-
14
- tests('success') do
15
-
16
- tests('#all').succeeds do
17
- @subnets.all
18
- end
19
-
20
- tests('#get').succeeds do
21
- @subnets.get @subnet.id
22
- end
23
-
24
- end
25
-
26
- @subnet.destroy
27
- end
@@ -1,27 +0,0 @@
1
- Shindo.tests("Fog::Network[:openstack] | vpn_service", ['openstack']) do
2
- tests('success') do
3
- tests('#create').succeeds do
4
- @instance = Fog::Network[:openstack].vpn_services.create(:subnet_id => 'foo',
5
- :router_id => 'bar',
6
- :name => 'test',
7
- :description => 'test',
8
- :admin_state_up => true,
9
- :tenant_id => 'tenant')
10
- !@instance.id.nil?
11
- end
12
-
13
- tests('#update').succeeds do
14
- @instance.subnet_id = 'new'
15
- @instance.router_id = 'new'
16
- @instance.name = 'rename'
17
- @instance.description = 'new'
18
- @instance.admin_state_up = false
19
- @instance.tenant_id = 'baz'
20
- @instance.update
21
- end
22
-
23
- tests('#destroy').succeeds do
24
- @instance.destroy == true
25
- end
26
- end
27
- end
@@ -1,22 +0,0 @@
1
- Shindo.tests("Fog::Network[:openstack] | vpn_services", ['openstack']) do
2
- @vpn_service = Fog::Network[:openstack].vpn_services.create(:subnet_id => 'foo',
3
- :router_id => 'bar',
4
- :name => 'test',
5
- :description => 'test',
6
- :admin_state_up => true,
7
- :tenant_id => 'tenant')
8
-
9
- @vpn_services = Fog::Network[:openstack].vpn_services
10
-
11
- tests('success') do
12
- tests('#all').succeeds do
13
- @vpn_services.all
14
- end
15
-
16
- tests('#get').succeeds do
17
- @vpn_services.get @vpn_service.id
18
- end
19
- end
20
-
21
- @vpn_service.destroy
22
- end
@@ -1,35 +0,0 @@
1
- Shindo.tests("Fog::NFV[:openstack] | vnf", ['openstack']) do
2
- tests('success') do
3
- tests('#create').succeeds do
4
- vnfd_data = {:attributes => {:vnfd => "template_name: sample-vnfd\ndescription: demo-example\n\nservice_prop"\
5
- "erties:\n Id: sample-vnfd\n vendor: tacker\n version: 1\n\nvdus:\n"\
6
- " vdu1:\n id: vdu1\n vm_image: cirros\n instance_type: m1.ti"\
7
- "ny\n\n network_interfaces:\n management:\n network: ne"\
8
- "t_mgmt\n management: true\n pkt_in:\n network: net"\
9
- "0\n pkt_out:\n network: net1\n\n placement_policy:\n "\
10
- " availability_zone: nova\n\n auto-scaling: noop\n\n config:"\
11
- "\n param0: key0\n param1: key1\n"},
12
- :service_types => [{:service_type => "vnfd"}],
13
- :mgmt_driver => "noop",
14
- :infra_driver => "heat"}
15
- auth = {"tenantName" => "admin", "passwordCredentials" => {"username" => "admin", "password" => "password"}}
16
- @vnfd = Fog::NFV[:openstack].vnfds.create(:vnfd => vnfd_data, :auth => auth)
17
- vnf_data = {:vnfd_id => @vnfd.id, :name => 'Test'}
18
- @vnf = Fog::NFV[:openstack].vnfs.create(:vnf => vnf_data, :auth => auth)
19
- end
20
-
21
- Fog::NFV[:openstack].vnfs.get(@vnf.id).wait_for { ready? }
22
-
23
- tests('#update').succeeds do
24
- @vnf.vnf = {:attributes => {:config => "vdus:\n vdu1:<sample_vdu_config> \n\n"}}
25
- @vnf.update
26
- end
27
-
28
- tests('#destroy').succeeds do
29
- sleep(10) unless Fog.mocking?
30
-
31
- @vnf.destroy
32
- @vnfd.destroy
33
- end
34
- end
35
- end
@@ -1,23 +0,0 @@
1
- Shindo.tests("Fog::NFV[:openstack] | vnf", ['openstack']) do
2
- tests('success') do
3
- tests('#create').succeeds do
4
- vnfd_data = {:attributes => {:vnfd => "template_name: sample-vnfd\ndescription: demo-example\n\nservice_prop"\
5
- "erties:\n Id: sample-vnfd\n vendor: tacker\n version: 1\n\nvdus:\n"\
6
- " vdu1:\n id: vdu1\n vm_image: cirros\n instance_type: m1.ti"\
7
- "ny\n\n network_interfaces:\n management:\n network: ne"\
8
- "t_mgmt\n management: true\n pkt_in:\n network: net"\
9
- "0\n pkt_out:\n network: net1\n\n placement_policy:\n "\
10
- " availability_zone: nova\n\n auto-scaling: noop\n\n config:"\
11
- "\n param0: key0\n param1: key1\n"},
12
- :service_types => [{:service_type => "vnfd"}],
13
- :mgmt_driver => "noop",
14
- :infra_driver => "heat"}
15
- auth = {"tenantName" => "admin", "passwordCredentials" => {"username" => "admin", "password" => "password"}}
16
- @vnfd = Fog::NFV[:openstack].vnfds.create(:vnfd => vnfd_data, :auth => auth)
17
- end
18
-
19
- tests('#destroy').succeeds do
20
- @vnfd.destroy == true
21
- end
22
- end
23
- end
@@ -1,31 +0,0 @@
1
- Shindo.tests("Fog::NFV[:openstack] | vnfs", ['openstack']) do
2
- vnfd_data = {:attributes => {:vnfd => "template_name: sample-vnfd\ndescription: demo-example\n\nservice_prop"\
3
- "erties:\n Id: sample-vnfd\n vendor: tacker\n version: 1\n\nvdus:\n"\
4
- " vdu1:\n id: vdu1\n vm_image: cirros\n instance_type: m1.ti"\
5
- "ny\n\n network_interfaces:\n management:\n network: ne"\
6
- "t_mgmt\n management: true\n pkt_in:\n network: net"\
7
- "0\n pkt_out:\n network: net1\n\n placement_policy:\n "\
8
- " availability_zone: nova\n\n auto-scaling: noop\n\n config:"\
9
- "\n param0: key0\n param1: key1\n"},
10
- :service_types => [{:service_type => "vnfd"}],
11
- :mgmt_driver => "noop",
12
- :infra_driver => "heat"}
13
- auth = {"tenantName" => "admin", "passwordCredentials" => {"username" => "admin", "password" => "password"}}
14
- @vnfd = Fog::NFV[:openstack].vnfds.create(:vnfd => vnfd_data, :auth => auth)
15
-
16
- tests('success') do
17
- tests('#find_by_id').succeeds do
18
- vnf = Fog::NFV[:openstack].vnfds.find_by_id(@vnfd.id)
19
- vnf.id == @vnfd.id
20
- end
21
-
22
- tests('#get').succeeds do
23
- vnf = Fog::NFV[:openstack].vnfds.get(@vnfd.id)
24
- vnf.id == @vnfd.id
25
- end
26
-
27
- tests('#destroy').succeeds do
28
- Fog::NFV[:openstack].vnfds.destroy(@vnfd.id)
29
- end
30
- end
31
- end
@@ -1,38 +0,0 @@
1
- Shindo.tests("Fog::NFV[:openstack] | vnfs", ['openstack']) do
2
- vnfd_data = {:attributes => {:vnfd => "template_name: sample-vnfd\ndescription: demo-example\n\nservice_prop"\
3
- "erties:\n Id: sample-vnfd\n vendor: tacker\n version: 1\n\nvdus:\n"\
4
- " vdu1:\n id: vdu1\n vm_image: cirros\n instance_type: m1.ti"\
5
- "ny\n\n network_interfaces:\n management:\n network: ne"\
6
- "t_mgmt\n management: true\n pkt_in:\n network: net"\
7
- "0\n pkt_out:\n network: net1\n\n placement_policy:\n "\
8
- " availability_zone: nova\n\n auto-scaling: noop\n\n config:"\
9
- "\n param0: key0\n param1: key1\n"},
10
- :service_types => [{:service_type => "vnfd"}],
11
- :mgmt_driver => "noop",
12
- :infra_driver => "heat"}
13
- auth = {"tenantName" => "admin", "passwordCredentials" => {"username" => "admin", "password" => "password"}}
14
- @vnfd = Fog::NFV[:openstack].vnfds.create(:vnfd => vnfd_data, :auth => auth)
15
- vnf_data = {:vnfd_id => @vnfd.id, :name => 'Test'}
16
- @vnf = Fog::NFV[:openstack].vnfs.create(:vnf => vnf_data, :auth => auth)
17
-
18
- Fog::NFV[:openstack].vnfs.get(@vnf.id).wait_for { ready? }
19
-
20
- tests('success') do
21
- tests('#find_by_id').succeeds do
22
- vnf = Fog::NFV[:openstack].vnfs.find_by_id(@vnf.id)
23
- vnf.id == @vnf.id
24
- end
25
-
26
- tests('#get').succeeds do
27
- vnf = Fog::NFV[:openstack].vnfs.get(@vnf.id)
28
- vnf.id == @vnf.id
29
- end
30
-
31
- tests('#destroy').succeeds do
32
- sleep(10) unless Fog.mocking?
33
-
34
- Fog::NFV[:openstack].vnfs.destroy(@vnf.id)
35
- Fog::NFV[:openstack].vnfds.destroy(@vnfd.id)
36
- end
37
- end
38
- end