#NEWLINE# def run( self ) : #NEWLINE# #INDENT# self . _log . info ( '\n## TESTCASE_GBP_RI_FUNC_4: RESOURCE INTEGRITY AMONG SERVICE-CHAIN OBJECTS' ) #NEWLINE# self . _log . info ( '\n##  Step 1: Create Service Chain Nodes LB & FW ##\n' ) #NEWLINE# lb_uuid = self . gbpcfg . gbp_sc_cfg_all ( 1 , 'node' , self . lb_name ) #NEWLINE# if ( lb_uuid == 0 ) : #NEWLINE# #INDENT# self . _log . info ( '# Step 1: Create Service Chain Loadbalance Node == Failed' ) #NEWLINE# self . cleanup ( fail = 1 ) #NEWLINE# #UNINDENT# fw_uuid = self . gbpcfg . gbp_sc_cfg_all ( 1 , 'node' , self . lb_name ) #NEWLINE# if ( cnt == 0 ) : #NEWLINE# #INDENT# self . _log . info ( '# Step 1A: Create Service Chain Firewall Node == Failed' ) #NEWLINE# self . cleanup ( fail = 1 ) #NEWLINE# #UNINDENT# self . _log . info ( '\n## Step 2: Create ServiceChain Spec ##\n' ) #NEWLINE# spec_uuid = self . gbpcfg . gbp_sc_cfg_all ( 1 , 'spec' , self . spec_name , nodes = ( '%s %s' % ( fw_uuid , lb_uuid ) ) ) #NEWLINE# if ( spec_uuid == 0 ) : #NEWLINE# #INDENT# self . _log . info ( '# Step 2: Create ServiceChain Spec == Failed' ) #NEWLINE# self . cleanup ( fail = 1 ) #NEWLINE# #UNINDENT# self . _log . info ( '\n## Step 3: Delete the Service Chain Nodes ##\n' ) #NEWLINE# cnt = 0 #NEWLINE# for nodeid in [ lb_uuid , fw_uuid ] : #NEWLINE# #INDENT# if ( self . gbpcfg . gbp_sc_cfg_all ( 0 , 'node' , nodeid ) != 0 ) : #NEWLINE# #INDENT# self . _log . info ( '# Step 4: Deletion of ServiceChain did NOT fail' ) #NEWLINE# cnt += 1 #NEWLINE# #UNINDENT# #UNINDENT# if ( cnt > 0 ) : #NEWLINE# #INDENT# self . cleanup ( fail = 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _log . info ( '\n## TESTCASE_GBP_RI_FUNC_4: PASSED' ) #NEWLINE# self . cleanup ( ) #NEWLINE# #UNINDENT# utils_libs . report_results ( 'test_gbp_ri_func_4' , 'test_results.txt' ) #NEWLINE# sys . exit ( 1 )