Sha256: 28c24c8f66702cd4c1aa16399609e13762cdd7bb0c5aa2541052cc9ad2a6a173

Contents?: true

Size: 1.52 KB

Versions: 145

Compression:

Stored size: 1.52 KB

Contents

Shindo.tests('Fog::Rackspace::LoadBalancers | monitor', ['rackspace']) do

  pending if Fog.mocking?

  given_a_load_balancer_service do
    given_a_load_balancer do
      tests('success') do

        @lb.wait_for { ready? }
        tests("#get_monitor(#{@lb.id})").formats(HEALTH_MONITOR_FORMAT) do
          @service.get_monitor(@lb.id).body
        end

        @lb.wait_for { ready? }
        tests("#set_monitor(#{@lb.id}, 'CONNECT', 5, 5, 5)").succeeds do
          @service.set_monitor(@lb.id, 'CONNECT', 5, 5, 5)
        end

        @lb.wait_for { ready? }
        tests("#set_monitor(#{@lb.id}, 'HTTP', 5, 5, 5, :path => '/', :body_regex => '^200$', :status_regex => '^2[0-9][0-9]$')").succeeds do
          @service.set_monitor(@lb.id, 'HTTP', 5, 5, 5, :path => '/', :body_regex => '^200$', :status_regex => '2[0-9][0-9]$')
        end

        @lb.wait_for { ready? }
        tests("#get_monitor(#{@lb.id})").formats(HEALTH_MONITOR_FORMAT) do
          @service.get_monitor(@lb.id).body
        end

        @lb.wait_for { ready? }
        tests("#remove_monitor()").succeeds do
          @service.remove_monitor(@lb.id)
        end
      end

      tests('failure') do
        tests("#set_monitor(#{@lb.id}, 'HTP', 5, 5, 5, 5)").raises(Fog::Rackspace::LoadBalancers::BadRequest) do
          @service.set_monitor(@lb.id, 5, 5, 5, 5)
        end

        tests("#remove_monitor(#{@lb.id}) => No Monitor").raises(Fog::Rackspace::LoadBalancers::ServiceError) do
          @service.remove_monitor(@lb.id)
        end
      end
    end
  end
end

Version data entries

145 entries across 143 versions & 22 rubygems

Version Path
fog-rackspace-0.1.6 tests/rackspace/requests/load_balancers/monitor_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/load_balancers/monitor_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/load_balancers/monitor_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-rackspace-0.1.5 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-rackspace-0.1.4 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-rackspace-0.1.3 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-rackspace-0.1.2 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-rackspace-0.1.1 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-rackspace-0.1.0 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-1.37.0 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-1.36.0 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-1.35.0 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-2.0.0.pre.0 tests/rackspace/requests/load_balancers/monitor_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-1.34.0 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-1.33.0 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-1.32.0 tests/rackspace/requests/load_balancers/monitor_tests.rb
fog-1.31.0 tests/rackspace/requests/load_balancers/monitor_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/rackspace/requests/load_balancers/monitor_tests.rb