mirror of
				https://github.com/fog/fog.git
				synced 2022-11-09 13:51:43 -05:00 
			
		
		
		
	cleaning up/repairing errant tests
This commit is contained in:
		
							parent
							
								
									56b114d5c7
								
							
						
					
					
						commit
						856334fe38
					
				
					 8 changed files with 33 additions and 23 deletions
				
			
		| 
						 | 
					@ -15,14 +15,15 @@ module Fog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        identity :id
 | 
					        identity :id
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        attribute :memory
 | 
					 | 
				
			||||||
        attribute :storage
 | 
					 | 
				
			||||||
        attribute :hostname
 | 
					 | 
				
			||||||
        attribute :cpu
 | 
					        attribute :cpu
 | 
				
			||||||
        attribute :ips
 | 
					        attribute :description
 | 
				
			||||||
        attribute :status
 | 
					 | 
				
			||||||
        attribute :flavor_id
 | 
					        attribute :flavor_id
 | 
				
			||||||
 | 
					        attribute :hostname
 | 
				
			||||||
        attribute :image_id
 | 
					        attribute :image_id
 | 
				
			||||||
 | 
					        attribute :ips
 | 
				
			||||||
 | 
					        attribute :memory
 | 
				
			||||||
 | 
					        attribute :status
 | 
				
			||||||
 | 
					        attribute :storage
 | 
				
			||||||
        attribute :template
 | 
					        attribute :template
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        attr_accessor :password
 | 
					        attr_accessor :password
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,7 @@ module Fog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      class Mock
 | 
					      class Mock
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        def get_slices
 | 
					        def get_blocks
 | 
				
			||||||
          Fog::Mock.not_implemented
 | 
					          Fog::Mock.not_implemented
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,14 +13,15 @@ Shindo.tests('AWS::Compute | image requests', ['aws']) do
 | 
				
			||||||
      'kernelId'        => String,
 | 
					      'kernelId'        => String,
 | 
				
			||||||
      'productCodes'    => [],
 | 
					      'productCodes'    => [],
 | 
				
			||||||
      'ramdiskId'       => String,
 | 
					      'ramdiskId'       => String,
 | 
				
			||||||
      'rootDeviceType'  => String
 | 
					      'rootDeviceType'  => String,
 | 
				
			||||||
 | 
					      'tagSet'          => {}
 | 
				
			||||||
    }],
 | 
					    }],
 | 
				
			||||||
      'requestId'     => String,
 | 
					      'requestId'     => String,
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  tests('success') do
 | 
					  tests('success') do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # the result for this is HUGE an relatively uninteresting...de
 | 
					    # the result for this is HUGE and relatively uninteresting...
 | 
				
			||||||
    # tests("#describe_images").formats(@images_format) do
 | 
					    # tests("#describe_images").formats(@images_format) do
 | 
				
			||||||
    #   AWS[:compute].describe_images.body
 | 
					    #   AWS[:compute].describe_images.body
 | 
				
			||||||
    # end
 | 
					    # end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,7 +42,8 @@ Shindo.tests('AWS::Compute | instance requests', ['aws']) do
 | 
				
			||||||
        'ipAddress'         => String,
 | 
					        'ipAddress'         => String,
 | 
				
			||||||
        'privateDnsName'    => String,
 | 
					        'privateDnsName'    => String,
 | 
				
			||||||
        'privateIpAddress'  => String,
 | 
					        'privateIpAddress'  => String,
 | 
				
			||||||
        'stateReason'       => {}
 | 
					        'stateReason'       => {},
 | 
				
			||||||
 | 
					        'tagSet'            => {}
 | 
				
			||||||
      )],
 | 
					      )],
 | 
				
			||||||
      'ownerId'       => String,
 | 
					      'ownerId'       => String,
 | 
				
			||||||
      'reservationId' => String
 | 
					      'reservationId' => String
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@ Shindo.tests('AWS::Compute | snapshot requests', ['aws']) do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @snapshots_format = {
 | 
					  @snapshots_format = {
 | 
				
			||||||
    'requestId'   => String,
 | 
					    'requestId'   => String,
 | 
				
			||||||
    'snapshotSet' => [@snapshot_format]
 | 
					    'snapshotSet' => [@snapshot_format.merge('tagSet' => {})]
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1)
 | 
					  @volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,15 +1,16 @@
 | 
				
			||||||
Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do
 | 
					Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @block_format = {
 | 
					  @block_format = {
 | 
				
			||||||
    'cpu'       => Float,
 | 
					    'cpu'         => Float,
 | 
				
			||||||
    'hostname'  => String,
 | 
					    'description' => String,
 | 
				
			||||||
    'id'        => String,
 | 
					    'hostname'    => String,
 | 
				
			||||||
    'ips'       => [{'address' => String}],
 | 
					    'id'          => String,
 | 
				
			||||||
    'memory'    => Integer,
 | 
					    'ips'         => [{'address' => String}],
 | 
				
			||||||
    'product'   => Bluebox::Compute::Formats::PRODUCT,
 | 
					    'memory'      => Integer,
 | 
				
			||||||
    'status'    => String,
 | 
					    'product'     => Bluebox::Compute::Formats::PRODUCT,
 | 
				
			||||||
    'storage'   => Integer,
 | 
					    'status'      => String,
 | 
				
			||||||
    'template'  => String
 | 
					    'storage'     => Integer,
 | 
				
			||||||
 | 
					    'template'    => String
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  tests('success') do
 | 
					  tests('success') do
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,13 +4,13 @@ Shindo.tests('Rackspace::Compute | image requests', ['rackspace']) do
 | 
				
			||||||
    'id'        => Integer,
 | 
					    'id'        => Integer,
 | 
				
			||||||
    'name'      => String,
 | 
					    'name'      => String,
 | 
				
			||||||
    'status'    => String,
 | 
					    'status'    => String,
 | 
				
			||||||
    'updated'   => String
 | 
					    'updated'   => String,
 | 
				
			||||||
 | 
					    'serverId'  => Integer,
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @image_format = @images_format.merge({
 | 
					  @image_format = @images_format.merge({
 | 
				
			||||||
    'created'  => String,
 | 
					    'created'  => String,
 | 
				
			||||||
    'progress' => Integer,
 | 
					    'progress' => Integer,
 | 
				
			||||||
    'serverId'  => Integer,
 | 
					 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  tests('success') do
 | 
					  tests('success') do
 | 
				
			||||||
| 
						 | 
					@ -19,7 +19,7 @@ Shindo.tests('Rackspace::Compute | image requests', ['rackspace']) do
 | 
				
			||||||
    @server.wait_for { ready? }
 | 
					    @server.wait_for { ready? }
 | 
				
			||||||
    @image_id = nil
 | 
					    @image_id = nil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tests("#create_image(#{@server.id})").formats(@images_format) do
 | 
					    tests("#create_image(#{@server.id})").formats(@images_format.merge('serverId' => Integer)) do
 | 
				
			||||||
      data = Rackspace[:compute].create_image(@server.id).body['image']
 | 
					      data = Rackspace[:compute].create_image(@server.id).body['image']
 | 
				
			||||||
      @image_id = data['id']
 | 
					      @image_id = data['id']
 | 
				
			||||||
      data
 | 
					      data
 | 
				
			||||||
| 
						 | 
					@ -27,7 +27,7 @@ Shindo.tests('Rackspace::Compute | image requests', ['rackspace']) do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Rackspace[:compute].images.get(@image_id).wait_for { ready? }
 | 
					    Rackspace[:compute].images.get(@image_id).wait_for { ready? }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tests("#get_image_details(#{@image_id})").formats(@image_format) do
 | 
					    tests("#get_image_details(#{@image_id})").formats(@images_format) do
 | 
				
			||||||
      Rackspace[:compute].get_image_details(@image_id).body['image']
 | 
					      Rackspace[:compute].get_image_details(@image_id).body['image']
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -40,14 +40,20 @@ Shindo.tests('Rackspace::Compute | server requests', ['rackspace']) do
 | 
				
			||||||
      Rackspace[:compute].list_servers_detail.body
 | 
					      Rackspace[:compute].list_servers_detail.body
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Rackspace[:compute].servers.get(@server_id).wait_for { ready? }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tests("#update_server(#{@server_id}, :name => 'fogupdatedserver', :adminPass => 'fogupdatedserver')").succeeds do
 | 
					    tests("#update_server(#{@server_id}, :name => 'fogupdatedserver', :adminPass => 'fogupdatedserver')").succeeds do
 | 
				
			||||||
      Rackspace[:compute].update_server(@server_id, :name => 'fogupdatedserver', :adminPass => 'fogupdatedserver')
 | 
					      Rackspace[:compute].update_server(@server_id, :name => 'fogupdatedserver', :adminPass => 'fogupdatedserver')
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Rackspace[:compute].servers.get(@server_id).wait_for { ready? }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tests("#reboot_server(#{@server_id}, 'HARD')").succeeds do
 | 
					    tests("#reboot_server(#{@server_id}, 'HARD')").succeeds do
 | 
				
			||||||
      Rackspace[:compute].reboot_server(@server_id, 'HARD')
 | 
					      Rackspace[:compute].reboot_server(@server_id, 'HARD')
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Rackspace[:compute].servers.get(@server_id).wait_for { ready? }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tests("#reboot_server(#{@server_id}, 'SOFT')").succeeds do
 | 
					    tests("#reboot_server(#{@server_id}, 'SOFT')").succeeds do
 | 
				
			||||||
      Rackspace[:compute].reboot_server(@server_id, 'SOFT')
 | 
					      Rackspace[:compute].reboot_server(@server_id, 'SOFT')
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue