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,66 +0,0 @@
|
|
1
|
-
Shindo.tests('Fog::Network[:openstack] | port requests', ['openstack']) do
|
2
|
-
|
3
|
-
@port_format = {
|
4
|
-
'id' => String,
|
5
|
-
'name' => String,
|
6
|
-
'network_id' => String,
|
7
|
-
'fixed_ips' => Array,
|
8
|
-
'mac_address' => String,
|
9
|
-
'status' => String,
|
10
|
-
'admin_state_up' => Fog::Boolean,
|
11
|
-
'device_owner' => String,
|
12
|
-
'device_id' => String,
|
13
|
-
'tenant_id' => String,
|
14
|
-
'security_groups' => Array,
|
15
|
-
'allowed_address_pairs' => Array
|
16
|
-
}
|
17
|
-
|
18
|
-
tests('success') do
|
19
|
-
tests('#create_port').formats({'port' => @port_format}) do
|
20
|
-
network_id = 'net_id'
|
21
|
-
attributes = {:name => 'port_name', :fixed_ips => [],
|
22
|
-
:mac_address => 'fa:16:3e:62:91:7f', :admin_state_up => true,
|
23
|
-
:device_owner => 'device_owner', :device_id => 'device_id',
|
24
|
-
:tenant_id => 'tenant_id' ,:security_groups => [],
|
25
|
-
:allowed_address_pairs => [] }
|
26
|
-
Fog::Network[:openstack].create_port(network_id, attributes).body
|
27
|
-
end
|
28
|
-
|
29
|
-
tests('#list_port').formats({'ports' => [@port_format]}) do
|
30
|
-
Fog::Network[:openstack].list_ports.body
|
31
|
-
end
|
32
|
-
|
33
|
-
tests('#get_port').formats({'port' => @port_format}) do
|
34
|
-
port_id = Fog::Network[:openstack].ports.all.first.id
|
35
|
-
Fog::Network[:openstack].get_port(port_id).body
|
36
|
-
end
|
37
|
-
|
38
|
-
tests('#update_port').formats({'port' => @port_format}) do
|
39
|
-
port_id = Fog::Network[:openstack].ports.all.first.id
|
40
|
-
attributes = {:name => 'port_name', :fixed_ips => [],
|
41
|
-
:admin_state_up => true, :device_owner => 'device_owner',
|
42
|
-
:device_id => 'device_id'}
|
43
|
-
Fog::Network[:openstack].update_port(port_id, attributes).body
|
44
|
-
end
|
45
|
-
|
46
|
-
tests('#delete_port').succeeds do
|
47
|
-
port_id = Fog::Network[:openstack].ports.all.first.id
|
48
|
-
Fog::Network[:openstack].delete_port(port_id)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
tests('failure') do
|
53
|
-
tests('#get_port').raises(Fog::Network::OpenStack::NotFound) do
|
54
|
-
Fog::Network[:openstack].get_port(0)
|
55
|
-
end
|
56
|
-
|
57
|
-
tests('#update_port').raises(Fog::Network::OpenStack::NotFound) do
|
58
|
-
Fog::Network[:openstack].update_port(0, {})
|
59
|
-
end
|
60
|
-
|
61
|
-
tests('#delete_port').raises(Fog::Network::OpenStack::NotFound) do
|
62
|
-
Fog::Network[:openstack].delete_port(0)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
Shindo.tests('Fog::Network[:openstack] | quota requests', ['openstack']) do
|
2
|
-
|
3
|
-
@tenant_id = Fog::Compute[:openstack].list_tenants.body['tenants'].first['id']
|
4
|
-
@quota_format = {
|
5
|
-
'subnet' => Fog::Nullable::Integer,
|
6
|
-
'router' => Fog::Nullable::Integer,
|
7
|
-
'port' => Fog::Nullable::Integer,
|
8
|
-
'network' => Fog::Nullable::Integer,
|
9
|
-
'floatingip' => Fog::Nullable::Integer
|
10
|
-
}
|
11
|
-
|
12
|
-
@quotas_format = [{
|
13
|
-
'subnet' => Fog::Nullable::Integer,
|
14
|
-
'router' => Fog::Nullable::Integer,
|
15
|
-
'port' => Fog::Nullable::Integer,
|
16
|
-
'network' => Fog::Nullable::Integer,
|
17
|
-
'floatingip' => Fog::Nullable::Integer,
|
18
|
-
'tenant_id' => Fog::Nullable::String
|
19
|
-
}]
|
20
|
-
|
21
|
-
tests('success') do
|
22
|
-
|
23
|
-
tests('#get_quotas').formats({ 'quotas' => @quotas_format }) do
|
24
|
-
Fog::Network[:openstack].get_quotas.body
|
25
|
-
end
|
26
|
-
|
27
|
-
tests('#get_quota').formats(@quota_format) do
|
28
|
-
@quota = Fog::Network[:openstack].get_quota(@tenant_id).body['quota']
|
29
|
-
end
|
30
|
-
|
31
|
-
tests('#update_quota') do
|
32
|
-
|
33
|
-
new_values = @quota.merge({
|
34
|
-
'volumes' => @quota['subnet']/2,
|
35
|
-
'snapshots' => @quota['router']/2
|
36
|
-
})
|
37
|
-
|
38
|
-
succeeds do
|
39
|
-
Fog::Network[:openstack].update_quota(@tenant_id, new_values.clone)
|
40
|
-
end
|
41
|
-
|
42
|
-
returns(new_values, 'returns new values') do
|
43
|
-
Fog::Network[:openstack].get_quota(@tenant_id).body['quota']
|
44
|
-
end
|
45
|
-
|
46
|
-
# set quota back to old values
|
47
|
-
succeeds do
|
48
|
-
Fog::Network[:openstack].update_quota(@tenant_id, @quota.clone)
|
49
|
-
end
|
50
|
-
|
51
|
-
# ensure old values are restored
|
52
|
-
returns(@quota, 'old values restored') do
|
53
|
-
Fog::Network[:openstack].get_quota(@tenant_id).body['quota']
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
tests('#delete_quota') do
|
59
|
-
succeeds do
|
60
|
-
Fog::Network[:openstack].delete_quota(@tenant_id)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
end
|
@@ -1,73 +0,0 @@
|
|
1
|
-
Shindo.tests('Fog::Network[:openstack] | router requests', ['openstack']) do
|
2
|
-
|
3
|
-
@router_format = {
|
4
|
-
:id => String,
|
5
|
-
:name => String,
|
6
|
-
:status => String,
|
7
|
-
:admin_state_up => Fog::Boolean,
|
8
|
-
:tenant_id => String,
|
9
|
-
:external_gateway_info => Fog::Nullable::Hash,
|
10
|
-
}
|
11
|
-
|
12
|
-
tests('success') do
|
13
|
-
tests('#create_router').formats({'router' => @router_format}) do
|
14
|
-
attributes = {
|
15
|
-
:admin_state_up => true,
|
16
|
-
:tenant_id => 'tenant_id'
|
17
|
-
}
|
18
|
-
Fog::Network[:openstack].create_router('router_name', attributes).body
|
19
|
-
end
|
20
|
-
|
21
|
-
tests('#list_routers').formats({'routers' => [@router_format]}) do
|
22
|
-
Fog::Network[:openstack].list_routers.body
|
23
|
-
end
|
24
|
-
|
25
|
-
tests('#get_router').formats({'router' => @router_format}) do
|
26
|
-
router_id = Fog::Network[:openstack].routers.all.first.id
|
27
|
-
Fog::Network[:openstack].get_router(router_id).body
|
28
|
-
end
|
29
|
-
|
30
|
-
tests('#update_router').formats({'router' => @router_format}) do
|
31
|
-
router_id = Fog::Network[:openstack].routers.all.first.id
|
32
|
-
attributes = {
|
33
|
-
:name => 'net_name',
|
34
|
-
:external_gateway_info => { :network_id => 'net_id' },
|
35
|
-
:status => 'ACTIVE',
|
36
|
-
:admin_state_up => true
|
37
|
-
}
|
38
|
-
Fog::Network[:openstack].update_router(router_id, attributes).body
|
39
|
-
end
|
40
|
-
|
41
|
-
tests('#update_router_with_network').formats({'router' => @router_format}) do
|
42
|
-
router_id = Fog::Network[:openstack].routers.all.first.id
|
43
|
-
net = Fog::Network[:openstack].networks.first
|
44
|
-
attributes = {
|
45
|
-
:name => 'net_name',
|
46
|
-
:external_gateway_info => net,
|
47
|
-
:status => 'ACTIVE',
|
48
|
-
:admin_state_up => true
|
49
|
-
}
|
50
|
-
Fog::Network[:openstack].update_router(router_id, attributes).body
|
51
|
-
end
|
52
|
-
|
53
|
-
tests('#delete_router').succeeds do
|
54
|
-
router_id = Fog::Network[:openstack].routers.all.last.id
|
55
|
-
Fog::Network[:openstack].delete_router(router_id)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
tests('failure') do
|
60
|
-
tests('#get_router').raises(Fog::Network::OpenStack::NotFound) do
|
61
|
-
Fog::Network[:openstack].get_router(0)
|
62
|
-
end
|
63
|
-
|
64
|
-
tests('#update_router').raises(Fog::Network::OpenStack::NotFound) do
|
65
|
-
Fog::Network[:openstack].update_router(0, {})
|
66
|
-
end
|
67
|
-
|
68
|
-
tests('#delete_router').raises(Fog::Network::OpenStack::NotFound) do
|
69
|
-
Fog::Network[:openstack].delete_router(0)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
Shindo.tests('Fog::Network[:openstack] | security_grouprule requests', ['openstack']) do
|
2
|
-
|
3
|
-
@security_group_rule_format = {
|
4
|
-
"id" => String,
|
5
|
-
"remote_group_id" => Fog::Nullable::String,
|
6
|
-
"direction" => String,
|
7
|
-
"remote_ip_prefix" => Fog::Nullable::String,
|
8
|
-
"protocol" => Fog::Nullable::String,
|
9
|
-
"ethertype" => String,
|
10
|
-
"port_range_max" => Fog::Nullable::Integer,
|
11
|
-
"port_range_min" => Fog::Nullable::Integer,
|
12
|
-
"security_group_id" => String,
|
13
|
-
"tenant_id" => String
|
14
|
-
}
|
15
|
-
|
16
|
-
tests('success') do
|
17
|
-
attributes = {:name => "my_security_group", :description => "tests group"}
|
18
|
-
data = Fog::Network[:openstack].create_security_group(attributes).body["security_group"]
|
19
|
-
@sec_group_id = data["id"]
|
20
|
-
@sec_group_rule_id = nil
|
21
|
-
|
22
|
-
tests("#create_security_group_rule(#{@sec_group_id}, 'ingress', attributes)").formats(@security_group_rule_format) do
|
23
|
-
attributes = {
|
24
|
-
:remote_ip_prefix => "0.0.0.0/0",
|
25
|
-
:protocol => "tcp",
|
26
|
-
:port_range_min => 22,
|
27
|
-
:port_range_max => 22
|
28
|
-
}
|
29
|
-
data = Fog::Network[:openstack].create_security_group_rule(@sec_group_id, 'ingress', attributes).body["security_group_rule"]
|
30
|
-
@sec_group_rule_id = data["id"]
|
31
|
-
data
|
32
|
-
end
|
33
|
-
|
34
|
-
tests("#get_security_group_rule('#{@sec_group_rule_id}')").formats(@security_group_rule_format) do
|
35
|
-
Fog::Network[:openstack].get_security_group_rule(@sec_group_rule_id).body["security_group_rule"]
|
36
|
-
end
|
37
|
-
|
38
|
-
tests("#list_security_group_rules").formats("security_group_rules" => [@security_group_rule_format]) do
|
39
|
-
Fog::Network[:openstack].list_security_group_rules.body
|
40
|
-
end
|
41
|
-
|
42
|
-
tests("#delete_security_group_rule('#{@sec_group_rule_id}')").succeeds do
|
43
|
-
Fog::Network[:openstack].delete_security_group_rule(@sec_group_rule_id)
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
tests('failure') do
|
49
|
-
tests('#get_security_group_rule(0)').raises(Fog::Network::OpenStack::NotFound) do
|
50
|
-
Fog::Network[:openstack].get_security_group_rule(0)
|
51
|
-
end
|
52
|
-
|
53
|
-
tests('#delete_security_group_rule(0)').raises(Fog::Network::OpenStack::NotFound) do
|
54
|
-
Fog::Network[:openstack].delete_security_group_rule(0)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
Fog::Network[:openstack].delete_security_group(@sec_group_id)
|
58
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
Shindo.tests('Fog::Network[:openstack] | security_group requests', ['openstack']) do
|
2
|
-
|
3
|
-
@security_group_format = {
|
4
|
-
"id" => String,
|
5
|
-
"name" => String,
|
6
|
-
"description" => String,
|
7
|
-
"tenant_id" => String,
|
8
|
-
"security_group_rules" => [Hash]
|
9
|
-
}
|
10
|
-
|
11
|
-
tests('success') do
|
12
|
-
@sec_group_id = nil
|
13
|
-
|
14
|
-
tests("#create_security_group('fog_security_group', 'tests group')").formats(@security_group_format) do
|
15
|
-
attributes = {:name => "fog_security_group", :description => "tests group"}
|
16
|
-
data = Fog::Network[:openstack].create_security_group(attributes).body["security_group"]
|
17
|
-
@sec_group_id = data["id"]
|
18
|
-
data
|
19
|
-
end
|
20
|
-
|
21
|
-
tests("#get_security_group('#{@sec_group_id}')").formats(@security_group_format) do
|
22
|
-
Fog::Network[:openstack].get_security_group(@sec_group_id).body["security_group"]
|
23
|
-
end
|
24
|
-
|
25
|
-
tests("#list_security_groups").formats('security_groups' => [@security_group_format]) do
|
26
|
-
Fog::Network[:openstack].list_security_groups.body
|
27
|
-
end
|
28
|
-
|
29
|
-
tests("#delete_security_group('#{@sec_group_id}')").succeeds do
|
30
|
-
Fog::Network[:openstack].delete_security_group(@sec_group_id)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
tests('failure') do
|
35
|
-
tests("#get_security_group(0)").raises(Fog::Network::OpenStack::NotFound) do
|
36
|
-
Fog::Network[:openstack].get_security_group(0)
|
37
|
-
end
|
38
|
-
|
39
|
-
tests("#delete_security_group(0)").raises(Fog::Network::OpenStack::NotFound) do
|
40
|
-
Fog::Network[:openstack].delete_security_group(0)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
Shindo.tests('Fog::Network[:openstack] | subnet requests', ['openstack']) do
|
2
|
-
|
3
|
-
@subnet_format = {
|
4
|
-
'id' => String,
|
5
|
-
'name' => String,
|
6
|
-
'network_id' => String,
|
7
|
-
'cidr' => String,
|
8
|
-
'ip_version' => Integer,
|
9
|
-
'gateway_ip' => String,
|
10
|
-
'allocation_pools' => Array,
|
11
|
-
'dns_nameservers' => Array,
|
12
|
-
'host_routes' => Array,
|
13
|
-
'enable_dhcp' => Fog::Boolean,
|
14
|
-
'tenant_id' => String,
|
15
|
-
}
|
16
|
-
|
17
|
-
tests('success') do
|
18
|
-
tests('#create_subnet').formats({'subnet' => @subnet_format}) do
|
19
|
-
network_id = 'net_id'
|
20
|
-
cidr = '10.2.2.0/24'
|
21
|
-
ip_version = 4
|
22
|
-
attributes = {:name => 'subnet_name', :gateway_ip => '10.2.2.1',
|
23
|
-
:allocation_pools => [], :dns_nameservers => [],
|
24
|
-
:host_routes => [], :enable_dhcp => true,
|
25
|
-
:tenant_id => 'tenant_id'}
|
26
|
-
Fog::Network[:openstack].create_subnet(network_id, cidr, ip_version, attributes).body
|
27
|
-
end
|
28
|
-
|
29
|
-
tests('#list_subnet').formats({'subnets' => [@subnet_format]}) do
|
30
|
-
Fog::Network[:openstack].list_subnets.body
|
31
|
-
end
|
32
|
-
|
33
|
-
tests('#get_subnet').formats({'subnet' => @subnet_format}) do
|
34
|
-
subnet_id = Fog::Network[:openstack].subnets.all.first.id
|
35
|
-
Fog::Network[:openstack].get_subnet(subnet_id).body
|
36
|
-
end
|
37
|
-
|
38
|
-
tests('#update_subnet').formats({'subnet' => @subnet_format}) do
|
39
|
-
subnet_id = Fog::Network[:openstack].subnets.all.first.id
|
40
|
-
attributes = {:name => 'subnet_name', :gateway_ip => '10.2.2.1',
|
41
|
-
:allocation_pools => [], :dns_nameservers => [],
|
42
|
-
:host_routes => [], :enable_dhcp => true}
|
43
|
-
Fog::Network[:openstack].update_subnet(subnet_id, attributes).body
|
44
|
-
end
|
45
|
-
|
46
|
-
tests('#delete_subnet').succeeds do
|
47
|
-
subnet_id = Fog::Network[:openstack].subnets.all.first.id
|
48
|
-
Fog::Network[:openstack].delete_subnet(subnet_id)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
tests('failure') do
|
53
|
-
tests('#get_subnet').raises(Fog::Network::OpenStack::NotFound) do
|
54
|
-
Fog::Network[:openstack].get_subnet(0)
|
55
|
-
end
|
56
|
-
|
57
|
-
tests('#update_subnet').raises(Fog::Network::OpenStack::NotFound) do
|
58
|
-
Fog::Network[:openstack].update_subnet(0, {})
|
59
|
-
end
|
60
|
-
|
61
|
-
tests('#delete_subnet').raises(Fog::Network::OpenStack::NotFound) do
|
62
|
-
Fog::Network[:openstack].delete_subnet(0)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
Shindo.tests('Fog::Network[:openstack] | vpn_service requests', ['openstack']) do
|
2
|
-
@vpn_service_format = {
|
3
|
-
'id' => String,
|
4
|
-
'subnet_id' => String,
|
5
|
-
'router_id' => String,
|
6
|
-
'name' => String,
|
7
|
-
'description' => String,
|
8
|
-
'status' => String,
|
9
|
-
'admin_state_up' => Fog::Boolean,
|
10
|
-
'tenant_id' => String,
|
11
|
-
'external_v4_ip' => String,
|
12
|
-
'external_v6_ip' => String
|
13
|
-
}
|
14
|
-
|
15
|
-
tests('success') do
|
16
|
-
tests('#create_vpn_service').formats('vpnservice' => @vpn_service_format) do
|
17
|
-
subnet_id = 'subnet_id'
|
18
|
-
router_id = 'router_id'
|
19
|
-
|
20
|
-
attributes = {:name => 'test-vpn-service', :description => 'Test VPN Service',
|
21
|
-
:admin_state_up => true, :tenant_id => 'tenant_id'}
|
22
|
-
Fog::Network[:openstack].create_vpn_service(subnet_id, router_id, attributes).body
|
23
|
-
end
|
24
|
-
|
25
|
-
tests('#list_vpn_services').formats('vpnservices' => [@vpn_service_format]) do
|
26
|
-
Fog::Network[:openstack].list_vpn_services.body
|
27
|
-
end
|
28
|
-
|
29
|
-
tests('#get_vpn_service').formats('vpnservice' => @vpn_service_format) do
|
30
|
-
vpn_service_id = Fog::Network[:openstack].vpn_services.all.first.id
|
31
|
-
Fog::Network[:openstack].get_vpn_service(vpn_service_id).body
|
32
|
-
end
|
33
|
-
|
34
|
-
tests('#update_vpn_service').formats('vpnservice' => @vpn_service_format) do
|
35
|
-
vpn_service_id = Fog::Network[:openstack].vpn_services.all.first.id
|
36
|
-
attributes = {:name => 'renamed-test-vpn-service', :description => 'Test VPN Service',
|
37
|
-
:admin_state_up => true, :tenant_id => 'tenant_id',
|
38
|
-
:subnet_id => 'subnet_id', :router_id => 'router_id'}
|
39
|
-
Fog::Network[:openstack].update_vpn_service(vpn_service_id, attributes).body
|
40
|
-
end
|
41
|
-
|
42
|
-
tests('#delete_vpn_service').succeeds do
|
43
|
-
vpn_servcice_id = Fog::Network[:openstack].vpn_services.all.first.id
|
44
|
-
Fog::Network[:openstack].delete_vpn_service(vpn_servcice_id)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
tests('failure') do
|
49
|
-
tests('#get_vpn_service').raises(Fog::Network::OpenStack::NotFound) do
|
50
|
-
Fog::Network[:openstack].get_vpn_service(0)
|
51
|
-
end
|
52
|
-
|
53
|
-
tests('#update_lb_pool').raises(Fog::Network::OpenStack::NotFound) do
|
54
|
-
Fog::Network[:openstack].update_lb_pool(0, {})
|
55
|
-
end
|
56
|
-
|
57
|
-
tests('#delete_vpn_service').raises(Fog::Network::OpenStack::NotFound) do
|
58
|
-
Fog::Network[:openstack].delete_vpn_service(0)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
@@ -1,70 +0,0 @@
|
|
1
|
-
Shindo.tests('@vnf | NFV vnfs requests', ['openstack']) do
|
2
|
-
@nfv = Fog::NFV::OpenStack.new
|
3
|
-
|
4
|
-
@vnfs_create = {
|
5
|
-
"status" => String,
|
6
|
-
"description" => String,
|
7
|
-
"tenant_id" => String,
|
8
|
-
"name" => String,
|
9
|
-
"instance_id" => String,
|
10
|
-
"mgmt_url" => Fog::Nullable::String,
|
11
|
-
"attributes" => Hash,
|
12
|
-
"id" => String,
|
13
|
-
"vnfd_id" => String,
|
14
|
-
}
|
15
|
-
|
16
|
-
@vnfs = {
|
17
|
-
"status" => String,
|
18
|
-
"description" => String,
|
19
|
-
"tenant_id" => String,
|
20
|
-
"name" => String,
|
21
|
-
"instance_id" => String,
|
22
|
-
"mgmt_url" => Fog::Nullable::String,
|
23
|
-
"attributes" => Hash,
|
24
|
-
"id" => String,
|
25
|
-
}
|
26
|
-
|
27
|
-
tests('success') do
|
28
|
-
tests('#create_vnfs').data_matches_schema('vnf' => @vnfs_create) do
|
29
|
-
vnfd_data = {:attributes => {:vnfd => "template_name: sample-vnfd\ndescription: demo-example\n\nservice_prop"\
|
30
|
-
"erties:\n Id: sample-vnfd\n vendor: tacker\n version: 1\n\nvdus:\n"\
|
31
|
-
" vdu1:\n id: vdu1\n vm_image: cirros\n instance_type: m1.ti"\
|
32
|
-
"ny\n\n network_interfaces:\n management:\n network: ne"\
|
33
|
-
"t_mgmt\n management: true\n pkt_in:\n network: net"\
|
34
|
-
"0\n pkt_out:\n network: net1\n\n placement_policy:\n "\
|
35
|
-
" availability_zone: nova\n\n auto-scaling: noop\n\n config:"\
|
36
|
-
"\n param0: key0\n param1: key1\n"},
|
37
|
-
:service_types => [{:service_type => "vnfd"}],
|
38
|
-
:mgmt_driver => "noop",
|
39
|
-
:infra_driver => "heat"}
|
40
|
-
auth = {"tenantName" => "admin", "passwordCredentials" => {"username" => "admin", "password" => "password"}}
|
41
|
-
@vnfd_body = @nfv.create_vnfd(:vnfd => vnfd_data, :auth => auth).body
|
42
|
-
vnf_data = {:vnfd_id => @vnfd_body["vnfd"]["id"], :name => 'Test'}
|
43
|
-
auth = {"tenantName" => "admin", "passwordCredentials" => {"username" => "admin", "password" => "password"}}
|
44
|
-
@vnf_body = @nfv.create_vnf(:vnf => vnf_data, :auth => auth).body
|
45
|
-
end
|
46
|
-
|
47
|
-
Fog::NFV[:openstack].vnfs.get(@vnf_body["vnf"]["id"]).wait_for { ready? }
|
48
|
-
|
49
|
-
tests('#list_vnfs').data_matches_schema('vnfs' => [@vnfs]) do
|
50
|
-
@nfv.list_vnfs.body
|
51
|
-
end
|
52
|
-
|
53
|
-
tests('#get_vnfs').data_matches_schema('vnf' => @vnfs) do
|
54
|
-
@nfv.get_vnf(@vnf_body["vnf"]["id"]).body
|
55
|
-
end
|
56
|
-
|
57
|
-
tests('#update_vnfs').data_matches_schema('vnf' => @vnfs) do
|
58
|
-
vnf_data = {:attributes => {:config => "vdus:\n vdu1:<sample_vdu_config> \n\n"}}
|
59
|
-
auth = {"tenantName" => "admin", "passwordCredentials" => {"username" => "admin", "password" => "password"}}
|
60
|
-
@nfv.update_vnf(@vnf_body["vnf"]["id"], :vnf => vnf_data, :auth => auth).body
|
61
|
-
end
|
62
|
-
|
63
|
-
tests('#delete_vnfs').succeeds do
|
64
|
-
sleep(10) unless Fog.mocking?
|
65
|
-
|
66
|
-
@nfv.delete_vnf(@vnf_body["vnf"]["id"])
|
67
|
-
@nfv.delete_vnfd(@vnfd_body["vnfd"]["id"])
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|