2013-09-29 16:27:58 -04:00
|
|
|
Shindo.tests('Compute::VcloudDirector | network requests', ['vclouddirector']) do
|
|
|
|
|
|
|
|
GET_NETWORK_FORMAT = {
|
|
|
|
:type => String,
|
|
|
|
:name => String,
|
|
|
|
:href => String,
|
|
|
|
:id => String,
|
|
|
|
:description => Fog::Nullable::String,
|
|
|
|
:is_inherited => Fog::Boolean,
|
|
|
|
:gateway => String,
|
|
|
|
:netmask => String,
|
2013-10-01 11:23:23 -04:00
|
|
|
:dns1 => Fog::Nullable::String,
|
|
|
|
:dns2 => Fog::Nullable::String,
|
|
|
|
:dns_suffix => Fog::Nullable::String,
|
2013-09-29 16:27:58 -04:00
|
|
|
:ip_ranges => [{
|
|
|
|
:start_address => String,
|
|
|
|
:end_address => String
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
|
|
|
@service = Fog::Compute::VcloudDirector.new
|
2013-10-08 13:46:06 -04:00
|
|
|
@org = VcloudDirector::Compute::Helper.current_org(@service)
|
2013-09-29 16:27:58 -04:00
|
|
|
|
|
|
|
tests('#get_network').data_matches_schema(GET_NETWORK_FORMAT) do
|
|
|
|
link = @org[:Link].detect do |l|
|
|
|
|
l[:rel] == 'down' && l[:type] == 'application/vnd.vmware.vcloud.orgNetwork+xml'
|
|
|
|
end
|
2013-10-08 13:46:06 -04:00
|
|
|
@network_id = link[:href].split('/').last
|
|
|
|
@service.get_network(@network_id).body
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('#get_network_metadata').data_matches_schema(VcloudDirector::Compute::Schema::METADATA_TYPE) do
|
|
|
|
pending if Fog.mocking?
|
|
|
|
@service.get_network_metadata(@network_id).body
|
2013-09-29 16:27:58 -04:00
|
|
|
end
|
|
|
|
|
2013-10-13 15:46:41 -04:00
|
|
|
tests('Retrieve non-existent OrgNetwork').raises(Fog::Compute::VcloudDirector::Forbidden) do
|
2013-09-29 16:27:58 -04:00
|
|
|
@service.get_network('00000000-0000-0000-0000-000000000000')
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|