#NEWLINE# def test_parse_ucsm_host_config( self ) : #NEWLINE# #INDENT# 'Verifies parsing of Hostname:Service Profile config.' #NEWLINE# ucsm_sp_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# ucsm_host_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# cfg . CONF . ml2_cisco_ucsm . ucsm_host_list = [ 'Host1:SP1' , 'Host2:SP2' ] #NEWLINE# cfg . CONF . ml2_cisco_ucsm . ucsm_ip = '1.1.1.1' #NEWLINE# expected_ip = '1.1.1.1' #NEWLINE# expected_sp1 = 'org-root/ls-SP1' #NEWLINE# expected_sp2 = 'org-root/ls-SP2' #NEWLINE# ( ucsm_sp_dict , ucsm_host_dict ) = conf . parse_ucsm_host_config ( ) #NEWLINE# key = ( cfg . CONF . ml2_cisco_ucsm . ucsm_ip , 'Host1' ) #NEWLINE# self . assertIn ( key , ucsm_sp_dict ) #NEWLINE# self . assertEqual ( expected_sp1 , ucsm_sp_dict [ key ] ) #NEWLINE# self . assertIn ( 'Host1' , ucsm_host_dict ) #NEWLINE# self . assertEqual ( expected_ip , ucsm_host_dict [ 'Host1' ] ) #NEWLINE# key = ( cfg . CONF . ml2_cisco_ucsm . ucsm_ip , 'Host2' ) #NEWLINE# self . assertIn ( key , ucsm_sp_dict ) #NEWLINE# self . assertEqual ( expected_sp2 , ucsm_sp_dict . get ( key ) ) #NEWLINE# self . assertEqual ( expected_ip , ucsm_host_dict . get ( 'Host2' ) ) #NEWLINE# key = ( cfg . CONF . ml2_cisco_ucsm . ucsm_ip , 'Host3' ) #NEWLINE# self . assertNotIn ( key , ucsm_sp_dict ) #NEWLINE# self . assertIsNone ( ucsm_host_dict . get ( 'Host3' ) )