diff --git a/lib/fog/vcloud/models/compute/network.rb b/lib/fog/vcloud/models/compute/network.rb index d3ce0479a..47706f9aa 100644 --- a/lib/fog/vcloud/models/compute/network.rb +++ b/lib/fog/vcloud/models/compute/network.rb @@ -11,6 +11,7 @@ module Fog attribute :description, :aliases => :Description attribute :configuration, :aliases => :Configuration + attribute :provider_info, :aliases => :ProviderInfo attribute :links, :aliases => :Link, :type => :array diff --git a/tests/vcloud/data/api_+_v1.0_+_vApp_+_vm-2 b/tests/vcloud/data/api_+_v1.0_+_vApp_+_vm-2 index 12b0b8195..892ceca6d 100644 --- a/tests/vcloud/data/api_+_v1.0_+_vApp_+_vm-2 +++ b/tests/vcloud/data/api_+_v1.0_+_vApp_+_vm-2 @@ -127,6 +127,13 @@ 00:50:56:01:02:03 POOL + + 1 + 192.168.3.102 + true + 00:50:56:01:02:04 + POOL + diff --git a/tests/vcloud/models/compute/network_tests.rb b/tests/vcloud/models/compute/network_tests.rb index dbe39b795..469a2ef02 100644 --- a/tests/vcloud/models/compute/network_tests.rb +++ b/tests/vcloud/models/compute/network_tests.rb @@ -18,7 +18,26 @@ Shindo.tests("Vcloud::Compute | network", ['vcloud']) do tests("configuration") do tests("parent network").returns("ParentNetwork1") { instance.configuration[:ParentNetwork][:name]} tests("dns").returns("172.0.0.2") { instance.configuration[:IpScope][:Dns1]} + + tests("#fence_mode").returns("natRouted") { instance.configuration[:FenceMode] } + + tests("features") do + tests("dhcp_service") do + tests("#is_enabled").returns("false") { instance.configuration[:Features][:DhcpService][:IsEnabled] } + tests("ip_range") do + tests("#start_address").returns("192.168.0.151") { instance.configuration[:Features][:DhcpService][:IpRange][:StartAddress] } + end + end + tests("firewall_server") do + tests("is_enabled").returns("true"){ instance.configuration[:Features][:FirewallService][:IsEnabled] } + end + tests("nat_service") do + tests("is_enabled").returns("false"){ instance.configuration[:Features][:NatService][:IsEnabled] } + end + end end + + tests("features") end tests("an external network") do @@ -31,6 +50,7 @@ Shindo.tests("Vcloud::Compute | network", ['vcloud']) do tests("#href").returns("https://vcloud.example.com/api/v1.0/admin/network/2") { instance.href } tests("#name").returns("ParentNetwork1") { instance.name } tests("#description").returns("Internet Connection") { instance.description } + tests("#provider_info").returns("NETWORK:dvportgroup-230 on com.vmware.vcloud.entity.vimserver:35935555") { instance.provider_info } tests("configuration") do tests("dns").returns("172.0.0.2") { instance.configuration[:IpScope][:Dns1]} diff --git a/tests/vcloud/models/compute/server_tests.rb b/tests/vcloud/models/compute/server_tests.rb index e8c6318b3..eb9b90e65 100644 --- a/tests/vcloud/models/compute/server_tests.rb +++ b/tests/vcloud/models/compute/server_tests.rb @@ -38,6 +38,9 @@ Shindo.tests("Vcloud::Compute | server", ['vcloud']) do tests("#on?").returns(false) { instance.on? } tests("#off?").returns(true) { instance.off? } + tests("#network_connections") do + tests("#size").returns(2) { instance.network_connections.size } + end #old tests tests("#server.new('#{Vcloud::Compute::TestSupport::template}')").returns(true) do