#NEWLINE# def test_context_no_management( self ) : #NEWLINE# #INDENT# plugin_context = n_context . get_admin_context ( ) #NEWLINE# plugin_context . is_admin = False #NEWLINE# plugin_context . is_advsvc = False #NEWLINE# plugin_context . tenant_id = 'test-tenant' #NEWLINE# node = self . _create_profiled_servicechain_node ( ) [ 'servicechain_node' ] #NEWLINE# spec = self . create_servicechain_spec ( nodes = [ node [ 'id' ] ] ) [ 'servicechain_spec' ] #NEWLINE# provider = self . create_policy_target_group ( ) [ 'policy_target_group' ] #NEWLINE# management = self . create_policy_target_group ( service_management = True , tenant_id = 'admin' , is_admin_context = True ) [ 'policy_target_group' ] #NEWLINE# pc = self . create_policy_classifier ( ) [ 'policy_classifier' ] #NEWLINE# instance = self . create_servicechain_instance ( provider_ptg_id = provider [ 'id' ] , consumer_ptg_id = 'N/A' , servicechain_specs = [ spec [ 'id' ] ] , classifier_id = pc [ 'id' ] ) [ 'servicechain_instance' ] #NEWLINE# ctx = ncp_context . get_node_driver_context ( self . plugin , plugin_context , instance , node ) #NEWLINE# self . assertIsNone ( ctx . management ) #NEWLINE# self . delete_policy_target_group ( management [ 'id' ] , is_admin_context = True ) #NEWLINE# shared_management = self . create_policy_target_group ( service_management = True , tenant_id = 'admin' , is_admin_context = True , shared = True ) [ 'policy_target_group' ] #NEWLINE# instance = self . create_servicechain_instance ( provider_ptg_id = provider [ 'id' ] , consumer_ptg_id = 'N/A' , servicechain_specs = [ spec [ 'id' ] ] , classifier_id = pc [ 'id' ] ) [ 'servicechain_instance' ] #NEWLINE# ctx = ncp_context . get_node_driver_context ( self . plugin , plugin_context , instance , node ) #NEWLINE# self . assertEqual ( shared_management [ 'id' ] , ctx . management [ 'id' ] ) #NEWLINE# private_management = self . create_policy_target_group ( service_management = True , is_admin_context = True ) [ 'policy_target_group' ] #NEWLINE# instance = self . create_servicechain_instance ( provider_ptg_id = provider [ 'id' ] , consumer_ptg_id = 'N/A' , servicechain_specs = [ spec [ 'id' ] ] , classifier_id = pc [ 'id' ] ) [ 'servicechain_instance' ] #NEWLINE# ctx = ncp_context . get_node_driver_context ( self . plugin , plugin_context , instance , node ) #NEWLINE# self . assertEqual ( private_management [ 'id' ] , ctx . management [ 'id' ] )