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
No EOL
730 B
Ruby

Shindo.tests('HP::Network | networking subnets model', ['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