Sha256: 068f25cda925203dd55e6487cd42f701a43433eb07cd925f2618561e01ea37d4

Contents?: true

Size: 1.21 KB

Versions: 30

Compression:

Stored size: 1.21 KB

Contents

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

  service = Fog::Compute.new(:provider => 'HP', :version => :v2)

  @base_image_id = ENV['BASE_IMAGE_ID'] || '7f60b54c-cd15-433f-8bed-00acbcd25a17'

  tests('success') do

    @server_name = 'fogsecgrouptests'
    @server_id = nil

    # create a server without a sec group
    data = service.create_server(@server_name, 100, @base_image_id).body['server']
    @server_id = data['id']

    # now add the 'default' sec group to the server
    tests("#add_security_group(#{@server_id}, 'default')").succeeds do
      service.add_security_group(@server_id, 'default')
    end

    # now remove the 'default' sec group to the server
    tests("#remove_security_group(#{@server_id}, 'default')").succeeds do
      service.remove_security_group(@server_id, 'default')
    end

    service.delete_server(@server_id)

  end

  tests('failure') do

    tests("#add_security_group(0, 'default')").raises(Fog::Compute::HPV2::NotFound) do
      service.add_security_group(0, 'default')
    end

    tests("#remove_security_group(0, 'default')").raises(Fog::Compute::HPV2::NotFound) do
      service.remove_security_group(0, 'default')
    end

  end

end

Version data entries

30 entries across 30 versions & 4 rubygems

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