Sha256: 71fc4aa0d2dbd6662da20c7392d129815c0c6bf77dc664fc03d2ec905e832d88

Contents?: true

Size: 1.55 KB

Versions: 20

Compression:

Stored size: 1.55 KB

Contents

Shindo.tests("Fog::Compute[:brightbox] | firewall rule requests", ["brightbox"]) do
  tests("success") do
    pending if Fog.mocking?

    unless Fog.mocking?
      policy = Fog::Compute[:brightbox].firewall_policies.create
    end

    create_options = {
      :firewall_policy => policy.id,
      :destination => "127.0.0.1"
    }

    tests("#create_firewall_rule(#{create_options.inspect})") do
      result = Fog::Compute[:brightbox].create_firewall_rule(create_options)
      @firewall_rule_id = result["id"]
      data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, :allow_extra_keys => true) { result }
    end

    tests("#get_firewall_rule('#{@firewall_rule_id}')") do
      data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, :allow_extra_keys => true) do
        Fog::Compute[:brightbox].get_firewall_rule(@firewall_rule_id)
      end
    end

    update_options = { :source => nil, :destination => "127.0.0.1" }
    tests("#update_firewall_rule('#{@firewall_rule_id}', #{update_options.inspect})") do
      data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, :allow_extra_keys => true) do
        Fog::Compute[:brightbox].update_firewall_rule(@firewall_rule_id, update_options)
      end
    end

    tests("#delete_firewall_rule('#{@firewall_rule_id}')") do
      result = Fog::Compute[:brightbox].delete_firewall_rule(@firewall_rule_id)
      data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, :allow_extra_keys => true) { result }
    end

    unless Fog.mocking?
      policy.destroy
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
fog-brightbox-1.10.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.9.1 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.9.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.8.2 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.8.1 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.8.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.7.3 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.7.2 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.7.1 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.7.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.6.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.5.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.5.0.rc1 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.4.2 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.4.1 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.4.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.3.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.2.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.1.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.0.0 tests/brightbox/requests/compute/firewall_rule_tests.rb