#NEWLINE# def test_vrf_add_search( self ) : #NEWLINE# #INDENT# ' Add VRF and search for it\n        ' #NEWLINE# attr = { #NEWLINE# #INDENT# 'rt' : '65000:1235' , #NEWLINE# 'name' : '65k:1235' , #NEWLINE# 'description' : 'Virtual Routing and Forwarding instance 65000:123' , #NEWLINE# 'tags' : [ ] , #NEWLINE# 'avps' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# vrf = s . add_vrf ( { #NEWLINE# #INDENT# 'auth' : ad , #NEWLINE# 'attr' : attr , #NEWLINE# #UNINDENT# } ) #NEWLINE# attr [ 'id' ] = vrf [ 'id' ] #NEWLINE# q = { #NEWLINE# #INDENT# 'operator' : 'equals' , #NEWLINE# 'val1' : 'rt' , #NEWLINE# 'val2' : attr [ 'rt' ] , #NEWLINE# #UNINDENT# } #NEWLINE# res = self . _mangle_vrf_result ( s . search_vrf ( { #NEWLINE# #INDENT# 'auth' : ad , #NEWLINE# 'query' : q , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . assertEquals ( res [ 'result' ] , [ attr ] , 'Search result from equal match did not match' ) #NEWLINE# q = { #NEWLINE# #INDENT# 'operator' : 'regex_match' , #NEWLINE# 'val1' : 'description' , #NEWLINE# 'val2' : 'instance 65000' , #NEWLINE# #UNINDENT# } #NEWLINE# res = self . _mangle_vrf_result ( s . search_vrf ( { #NEWLINE# #INDENT# 'auth' : ad , #NEWLINE# 'query' : q , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . assertEquals ( res [ 'result' ] , [ attr ] , 'Search result from regex match did not match' ) #NEWLINE# res = self . _mangle_vrf_result ( s . smart_search_vrf ( { #NEWLINE# #INDENT# 'auth' : ad , #NEWLINE# 'query_string' : 'forwarding instance' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . assertEquals ( res [ 'result' ] , [ attr ] , 'Smart search result did not match' )