#NEWLINE# def test_ports_vnic_type( self ) : #NEWLINE# #INDENT# cfg . CONF . set_default ( 'allow_overlapping_ips' , True ) #NEWLINE# vnic_arg = { #NEWLINE# #INDENT# portbindings . VNIC_TYPE : self . vnic_type , #NEWLINE# #UNINDENT# } #NEWLINE# with self . port ( name = 'name1' , arg_list = ( portbindings . VNIC_TYPE , ) , ** vnic_arg ) , self . port ( name = 'name2' ) : #NEWLINE# #INDENT# ctx = context . get_admin_context ( ) #NEWLINE# ports = self . _list ( 'ports' , neutron_context = ctx ) [ 'ports' ] #NEWLINE# self . assertEqual ( 2 , len ( ports ) ) #NEWLINE# for port in ports : #NEWLINE# #INDENT# if ( port [ 'name' ] == 'name1' ) : #NEWLINE# #INDENT# self . _check_response_portbindings_vnic_type ( port ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEqual ( portbindings . VNIC_NORMAL , port [ portbindings . VNIC_TYPE ] ) #NEWLINE# #UNINDENT# #UNINDENT# ctx = context . Context ( user_id = None , tenant_id = self . _tenant_id , is_admin = False ) #NEWLINE# ports = self . _list ( 'ports' , neutron_context = ctx ) [ 'ports' ] #NEWLINE# self . assertEqual ( 2 , len ( ports ) ) #NEWLINE# for non_admin_port in ports : #NEWLINE# #INDENT# self . _check_response_portbindings_vnic_type ( non_admin_port )