1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/cloudstack/compute/models/server_tests.rb
2012-07-18 16:46:45 -07:00

18 lines
646 B
Ruby

provider, config = :cloudstack, compute_providers[:cloudstack]
Shindo.tests("Fog::Compute[:#{provider}] | servers + security_groups", [provider.to_s]) do
connection = Fog::Compute[provider]
@security_group = connection.security_groups.create(config[:security_group_attributes])
@server = connection.servers.create(config[:server_attributes].merge(:security_groups => [@security_group]))
tests('#security_group').succeeds do
@server.wait_for { ready? }
@server.security_groups.map(&:id) == [@security_group.id]
end
tests('#destroy').succeeds do
@server.destroy.wait_for { ready? }
@security_group.destroy
end
end