2012-12-17 05:59:51 -05:00
|
|
|
Shindo.tests('Fog::Compute[:brightbox] | firewall policy requests', ['brightbox']) do
|
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
pending if Fog.mocking?
|
|
|
|
|
|
|
|
create_options = {
|
|
|
|
:name => "Fog test policy A"
|
|
|
|
}
|
|
|
|
|
|
|
|
tests("#create_firewall_policy(#{create_options.inspect})") do
|
|
|
|
result = Fog::Compute[:brightbox].create_firewall_policy(create_options)
|
|
|
|
@firewall_policy_id = result["id"]
|
2013-01-23 10:08:24 -05:00
|
|
|
data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, {:allow_extra_keys => true}) { result }
|
2012-12-17 05:59:51 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#list_firewall_policies()") do
|
2013-01-23 10:08:24 -05:00
|
|
|
data_matches_schema(Brightbox::Compute::Formats::Collection::FIREWALL_POLICIES, {:allow_extra_keys => true}) do
|
2012-12-17 05:59:51 -05:00
|
|
|
Fog::Compute[:brightbox].list_firewall_policies
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#get_firewall_policy('#{@firewall_policy_id}')") do
|
2013-01-23 10:08:24 -05:00
|
|
|
data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, {:allow_extra_keys => true}) do
|
2012-12-17 05:59:51 -05:00
|
|
|
Fog::Compute[:brightbox].get_firewall_policy(@firewall_policy_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-12-17 05:16:59 -05:00
|
|
|
update_options = {:name => "Fog test policy B"}
|
|
|
|
tests("#update_firewall_policy('#{@firewall_policy_id}', #{update_options.inspect})") do
|
|
|
|
result = Fog::Compute[:brightbox].update_firewall_policy(@firewall_policy_id, update_options)
|
2013-01-23 10:08:24 -05:00
|
|
|
data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, {:allow_extra_keys => true}) { result }
|
2012-12-17 05:16:59 -05:00
|
|
|
returns("Fog test policy B") { result["name"] }
|
|
|
|
end
|
|
|
|
|
2012-12-17 05:59:51 -05:00
|
|
|
tests("#destroy_firewall_policy('#{@firewall_policy_id}')") do
|
|
|
|
result = Fog::Compute[:brightbox].destroy_firewall_policy(@firewall_policy_id)
|
2013-01-23 10:08:24 -05:00
|
|
|
data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, {:allow_extra_keys => true}) { result }
|
2012-12-17 05:59:51 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|