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/security_group_rule_tests.rb
Josh Lane & Jason Hansen 722b33cdad [cloudstack|security_groups] add groups and rules
* add volume tests back into tests/cloudstack/models/
* represent rules as a resource
* fix job representations
2012-07-18 12:59:16 -07:00

29 lines
943 B
Ruby

def security_group_rule_tests(connection, params, direction, mocks_implemented = true)
@security_group = connection.security_groups.create(params[:security_group_attributes])
rule_params = params[:security_group_rule_attributes].merge(:security_group_id => @security_group.id, :direction => direction)
model_tests(connection.security_group_rules, rule_params, mocks_implemented) do
if Fog.mocking? && !mocks_implemented
pending
end
end
@security_group.destroy
end
provider, config = :cloudstack, compute_providers[:cloudstack]
Shindo.tests("Fog::Compute[:#{provider}] | security_group_rules | ingress", [provider.to_s]) do
security_group_rule_tests(Fog::Compute[:cloudstack], config, "ingress", config[:mocked])
end
Shindo.tests("Fog::Compute[:#{provider}] | security_group_rules | egress", [provider.to_s]) do
security_group_rule_tests(Fog::Compute[:cloudstack], config, "egress", config[:mocked])
end