Sha256: cb29ae0c5dbf33ba083d85f9975a905c499f03712924f5604d5b77fed8e03732

Contents?: true

Size: 1.56 KB

Versions: 16

Compression:

Stored size: 1.56 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("#destroy_firewall_rule('#{@firewall_rule_id}')") do
      result = Fog::Compute[:brightbox].destroy_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

16 entries across 14 versions & 3 rubygems

Version Path
fog-brightbox-1.0.0.rc2 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-1.0.0.rc1 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-0.16.1 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-0.16.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-brightbox-0.15.0/tests/brightbox/requests/compute/firewall_rule_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-brightbox-0.15.0/tests/brightbox/requests/compute/firewall_rule_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-brightbox-0.15.0/tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-0.15.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-0.14.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-0.13.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-0.12.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-0.11.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-0.10.1 tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-0.10.0 tests/brightbox/requests/compute/firewall_rule_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-brightbox-0.9.0/tests/brightbox/requests/compute/firewall_rule_tests.rb
fog-brightbox-0.9.0 tests/brightbox/requests/compute/firewall_rule_tests.rb