Sha256: 49f47fdcc09be4c0d7045bd37b4a9bdbcaf2447e506f9ea774658e485df0d851

Contents?: true

Size: 1.94 KB

Versions: 30

Compression:

Stored size: 1.94 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

30 entries across 30 versions & 4 rubygems

Version Path
fog-1.38.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.37.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.36.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.35.0 tests/hp/requests/compute/security_group_tests.rb
fog-2.0.0.pre.0 tests/hp/requests/compute/security_group_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/hp/requests/compute/security_group_tests.rb
fog-1.34.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.33.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.32.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.31.0 tests/hp/requests/compute/security_group_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/hp/requests/compute/security_group_tests.rb
fog-1.30.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.29.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.28.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.27.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.26.0 tests/hp/requests/compute/security_group_tests.rb
fog-1.25.0 tests/hp/requests/compute/security_group_tests.rb
nsidc-fog-1.24.1 tests/hp/requests/compute/security_group_tests.rb
fog-1.24.0 tests/hp/requests/compute/security_group_tests.rb
ns-fog-1.22.11 tests/hp/requests/compute/security_group_tests.rb