mirror of
				https://github.com/fog/fog.git
				synced 2022-11-09 13:51:43 -05:00 
			
		
		
		
	Merge branch 'brightbox'
Conflicts: tests/brightbox/helper.rb tests/brightbox/requests/compute/account_tests.rb tests/brightbox/requests/compute/api_client_tests.rb tests/brightbox/requests/compute/cloud_ip_tests.rb tests/brightbox/requests/compute/image_tests.rb tests/brightbox/requests/compute/interface_tests.rb tests/brightbox/requests/compute/server_tests.rb tests/brightbox/requests/compute/server_type_tests.rb tests/brightbox/requests/compute/user_tests.rb tests/brightbox/requests/compute/zone_tests.rb
This commit is contained in:
		
						commit
						2c3e22f4b6
					
				
					 17 changed files with 395 additions and 4 deletions
				
			
		
							
								
								
									
										62
									
								
								tests/brightbox/requests/compute/load_balancer_tests.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								tests/brightbox/requests/compute/load_balancer_tests.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,62 @@
 | 
			
		|||
Shindo.tests('Brightbox::Compute | load balancer requests', ['brightbox']) do
 | 
			
		||||
 | 
			
		||||
  tests('success') do
 | 
			
		||||
 | 
			
		||||
    @node = Brightbox[:compute].servers.create(:image_id => Brightbox::Compute::TestSupport::IMAGE_IDENTIFER)
 | 
			
		||||
    node_id = @node.id
 | 
			
		||||
 | 
			
		||||
    creation_args = {
 | 
			
		||||
      :nodes => [{
 | 
			
		||||
        :node => node_id
 | 
			
		||||
      }],
 | 
			
		||||
      :listeners => [{
 | 
			
		||||
        :in       => 80,
 | 
			
		||||
        :out      => 8080,
 | 
			
		||||
        :protocol => "http"
 | 
			
		||||
      }],
 | 
			
		||||
      :healthcheck => {
 | 
			
		||||
        :type => "http",
 | 
			
		||||
        :port => 80
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    tests("#create_load_balancer(#{creation_args.inspect})").formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) do
 | 
			
		||||
      data = Brightbox[:compute].create_load_balancer(creation_args)
 | 
			
		||||
      @load_balancer_id = data["id"]
 | 
			
		||||
      data
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    Brightbox[:compute].load_balancers.get(@load_balancer_id).wait_for { ready? }
 | 
			
		||||
 | 
			
		||||
    # tests("#list_load_balancers()").formats(Brightbox::Compute::Formats::Collection::LOAD_BALANCERS) do
 | 
			
		||||
    #   Brightbox[:compute].list_load_balancers
 | 
			
		||||
    # end
 | 
			
		||||
 | 
			
		||||
    tests("#get_load_balancer('#{@load_balancer_id}')").formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) do
 | 
			
		||||
      Brightbox[:compute].get_load_balancer(@load_balancer_id)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    tests("#destroy_load_balancer('#{@load_balancer_id}')").formats(Brightbox::Compute::Formats::Full::LOAD_BALANCER) do
 | 
			
		||||
      Brightbox[:compute].destroy_load_balancer(@load_balancer_id)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    @node.destroy
 | 
			
		||||
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  tests('failure') do
 | 
			
		||||
 | 
			
		||||
    tests("#create_load_balancer()").raises(Excon::Errors::BadRequest) do
 | 
			
		||||
      Brightbox[:compute].create_load_balancer()
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    tests("#get_load_balancer('lba-00000')").raises(Excon::Errors::NotFound) do
 | 
			
		||||
      Brightbox[:compute].get_load_balancer('lba-00000')
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    tests("#get_load_balancer()").raises(ArgumentError) do
 | 
			
		||||
      Brightbox[:compute].get_load_balancer()
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -64,6 +64,7 @@ Shindo.tests('Brightbox::Compute | server requests', ['brightbox']) do
 | 
			
		|||
      pending if Fog.mocking?
 | 
			
		||||
      Brightbox[:compute].get_server
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,6 +27,7 @@ Shindo.tests('Brightbox::Compute | server type requests', ['brightbox']) do
 | 
			
		|||
      pending if Fog.mocking?
 | 
			
		||||
      Brightbox[:compute].get_server_type
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,6 +27,7 @@ Shindo.tests('Brightbox::Compute | zone requests', ['brightbox']) do
 | 
			
		|||
      pending if Fog.mocking?
 | 
			
		||||
      Brightbox[:compute].get_zone
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue