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
ns-fog-1.22.10 tests/hp/requests/compute_v2/server_security_group_tests.rb
ns-fog-1.22.9 tests/hp/requests/compute_v2/server_security_group_tests.rb
ns-fog-1.22.8 tests/hp/requests/compute_v2/server_security_group_tests.rb
ns-fog-1.22.7 tests/hp/requests/compute_v2/server_security_group_tests.rb
ns-fog-1.22.6 tests/hp/requests/compute_v2/server_security_group_tests.rb
fog-1.23.0 tests/hp/requests/compute_v2/server_security_group_tests.rb
ns-fog-1.22.4 tests/hp/requests/compute_v2/server_security_group_tests.rb
ns-fog-1.22.3 tests/hp/requests/compute_v2/server_security_group_tests.rb
ns-fog-1.22.2 tests/hp/requests/compute_v2/server_security_group_tests.rb
fog-1.22.1 tests/hp/requests/compute_v2/server_security_group_tests.rb