1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/hp/models/network/subnets_tests.rb

22 lines
735 B
Ruby
Raw Normal View History

2013-04-08 16:45:54 -04:00
Shindo.tests('HP::Network | networking subnets collection', ['hp', 'networking', 'subnet']) do
@network = HP[:network].networks.create(:name => 'my_network')
attributes = {:name => 'my_subnet', :network_id => @network.id, :cidr => '11.11.11.11/11', :ip_version => 4}
collection_tests(HP[:network].subnets, attributes, true)
tests('success') do
attributes = {:name => 'fogsubnet', :network_id => @network.id, :cidr => '12.12.12.12/12', :ip_version => 4}
@subnet = HP[:network].subnets.create(attributes)
tests('#all(filter)').succeeds do
subnets = HP[:network].subnets.all({:cidr => '12.12.12.12/12'})
subnets.first.cidr == '12.12.12.12/12'
end
@subnet.destroy
end
@network.destroy
end