Sha256: 9836bac62fc03e4faa2f4b36e6f938069aa8c127af223ddedbd196bf9650896f

Contents?: true

Size: 1.93 KB

Versions: 25

Compression:

Stored size: 1.93 KB

Contents

Shindo.tests('Fog::Compute[:google] | firewall requests', ['google']) do

  @google = Fog::Compute[:google]

  @insert_firewall_format = {
      'kind' => String,
      'id' => String,
      'selfLink' => String,
      'name' => String,
      'targetLink' => String,
      'status' => String,
      'user' => String,
      'progress' => Integer,
      'insertTime' => String,
      'startTime' => String,
      'operationType' => String
  }

  @get_firewall_format = {
      'kind' => String,
      'id' => String,
      'selfLink' => String,
      'creationTimestamp' => DateTime,
      'name' => String,
      'network' => String,
      'sourceRanges' => [],
      'allowed' => [],
  }

  @delete_firewall_format = {
      'kind' => String,
      'id' => String,
      'selfLink' => String,
      'name' => String,
      'targetLink' => String,
      'status' => String,
      'user' => String,
      'progress' => Integer,
      'targetId' => String,
      'insertTime' => String,
      'startTime' => String,
      'operationType' => String
  }

  @list_firewalls_format = {
      'kind' => String,
      'id' => String,
      'selfLink' => String,
      'items' => []
  }

  tests('success') do

    firewall_name = 'new-firewall-test'
    source_range = [ '10.0.0.0/8' ]
    allowed = [{
      "IPProtocol" => "tcp",
      "ports" => [ "1-65535" ]
    }, {
      "IPProtocol" => "udp",
      "ports" => [ "1-65535" ]
    }, {
      "IPProtocol" => "icmp"
    }]

    tests("#insert_firewall").formats(@insert_firewall_format) do
      @google.insert_firewall(firewall_name, source_range, allowed).body
    end

    # TODO: Get better matching for firewall responses.
    tests("#get_firewall").succeeds do
      @google.get_firewall(firewall_name)
    end

    tests("#list_firewalls").succeeds do
      @google.list_firewalls
    end

    tests("#delete_firewall").formats(@delete_firewall_format) do
      @google.delete_firewall(firewall_name).body
    end

  end

end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
fog-maestrodev-1.18.0.20131121075022 tests/google/requests/compute/firewall_tests.rb
fog-maestrodev-1.18.0.20131118164830 tests/google/requests/compute/firewall_tests.rb
fog-maestrodev-1.18.0.20131115184302 tests/google/requests/compute/firewall_tests.rb
fog-maestrodev-1.18.0.20131114200144 tests/google/requests/compute/firewall_tests.rb
gapinc-fog-1.12.1.2.1 tests/google/requests/compute/firewall_tests.rb
fog-maestrodev-1.18.0.20131112185232 tests/google/requests/compute/firewall_tests.rb
fog-maestrodev-1.18.0.20131111203459 tests/google/requests/compute/firewall_tests.rb
fog-1.18.0 tests/google/requests/compute/firewall_tests.rb
fog-1.17.0 tests/google/requests/compute/firewall_tests.rb
fog-1.16.0 tests/google/requests/compute/firewall_tests.rb
fog-maestrodev-1.15.0.20130927082724 tests/google/requests/compute/firewall_tests.rb
fog-maestrodev-1.15.0.20130829165835 tests/google/requests/compute/firewall_tests.rb
fog-1.15.0 tests/google/requests/compute/firewall_tests.rb
gapinc-fog-1.14.0 tests/google/requests/compute/firewall_tests.rb
fog-maestrodev-1.14.0.20130806165225 tests/google/requests/compute/firewall_tests.rb
fog-1.14.0 tests/google/requests/compute/firewall_tests.rb
fog-1.13.0 tests/google/requests/compute/firewall_tests.rb
gapinc-fog-1.12.1.2 tests/google/requests/compute/firewall_tests.rb
gapinc-fog-1.12.1.1 tests/google/requests/compute/firewall_tests.rb
gapinc-fog-1.12.1a tests/google/requests/compute/firewall_tests.rb