#NEWLINE# def test__allocate_specific_ip_out_of_range( self ) : #NEWLINE# #INDENT# cidr = '10.0.0.0/24' #NEWLINE# subnet = self . _create_subnet ( self . plugin , self . ctx , self . net_id , cidr ) #NEWLINE# subnet_req = ipam_req . SpecificSubnetRequest ( 'tenant_id' , subnet [ 'id' ] , cidr , gateway_ip = subnet [ 'gateway_ip' ] ) #NEWLINE# ipam_subnet = self . ipam_pool . allocate_subnet ( subnet_req ) #NEWLINE# with self . ctx . session . begin ( ) : #NEWLINE# #INDENT# ranges = ipam_subnet . _allocate_specific_ip ( self . ctx . session , '192.168.0.1' ) #NEWLINE# #UNINDENT# self . assertEqual ( 1 , len ( ranges ) ) #NEWLINE# ranges . sort ( key = convert_firstip_to_ipaddress ) #NEWLINE# self . assertEqual ( '10.0.0.2' , ranges [ 0 ] [ 'first_ip' ] ) #NEWLINE# self . assertEqual ( '10.0.0.254' , ranges [ 0 ] [ 'last_ip' ] )