Sha256: b2fe8219aadf7603eed7e3d9cf02d623b4b1726b0b88e32fa905c7f0d5795110

Contents?: true

Size: 1.95 KB

Versions: 61

Compression:

Stored size: 1.95 KB

Contents

Shindo.tests("Fog::Compute[:hp] | security group requests", ['hp']) do

  @security_groups_format = {
    'security_groups' => [{
      'rules'       => [Fog::Nullable::Hash],
      'tenant_id'   => String,
      'id'          => Integer,
      'name'        => String,
      'description' => String
    }]
  }

  @security_group_format = {
    'rules'       => [Fog::Nullable::Hash],
    'tenant_id'   => String,
    'id'          => Integer,
    'name'        => String,
    'description' => String
  }

  tests('success') do

    tests("#create_security_group('fog_security_group', 'tests group')").formats({'security_group' => @security_group_format}) do
      data = Fog::Compute[:hp].create_security_group('fog_security_group', 'tests group').body
      @sec_group_id = data['security_group']['id']
      data
    end

    tests("#get_security_group('#{@sec_group_id}')").formats({'security_group' => @security_group_format}) do
      Fog::Compute[:hp].get_security_group(@sec_group_id).body
    end

    tests("#list_security_groups").formats(@security_groups_format) do
      Fog::Compute[:hp].list_security_groups.body
    end


    tests("#delete_security_group('#{@sec_group_id}')").succeeds do
      Fog::Compute[:hp].delete_security_group(@sec_group_id).body
    end

  end

  tests('failure') do

    @security_group = Fog::Compute[:hp].security_groups.create(:name => 'fog_security_group_fail', :description => 'tests group')

    tests("duplicate #create_security_group(#{@security_group.name}, #{@security_group.description})").raises(Excon::Errors::BadRequest) do
      Fog::Compute[:hp].create_security_group(@security_group.name, @security_group.description)
    end

    tests("#get_security_group(0)").raises(Fog::Compute::HP::NotFound) do
      Fog::Compute[:hp].get_security_group(0)
    end

    tests("#delete_security_group(0)").raises(Fog::Compute::HP::NotFound) do
      Fog::Compute[:hp].delete_security_group(0)
    end

    @security_group.destroy

  end

end

Version data entries

61 entries across 61 versions & 6 rubygems

Version Path
fog-1.22.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.21.0 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/hp/requests/compute/security_group_tests.rb
fog-1.20.0 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/hp/requests/compute/security_group_tests.rb
fog-1.19.0 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/hp/requests/compute/security_group_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/hp/requests/compute/security_group_tests.rb