#NEWLINE# def test_gbp_l3p_neg_2( self ) : #NEWLINE# #INDENT# self . _log . info ( "\n############################################\nTESTCASE_GBP_L3P_NEG_2: TO CREATE/VERIFY L3POLICY with INVALID SUBNET-PREF-LENGTH\nTEST_STEPS::\nCreate L3Policy Object with Invalid Subnet-Prefix-Length\nInvalid Subnet-Prefix-Lengths: 33,'AB','32'\nVerify the create FAILs and config rolls back\n############################################\n" ) #NEWLINE# cnt = 0 #NEWLINE# invalid_prefix_length = [ '33' , 'AB' , '32' ] #NEWLINE# for prefix in invalid_prefix_length : #NEWLINE# #INDENT# self . _log . info ( ( '\n## Step 1A: Create L3Policy with Invalid Prefix-lenght = %s ##' % prefix ) ) #NEWLINE# if ( self . gbpcfg . gbp_policy_cfg_all ( 1 , 'l3p' , self . l3p_name , subnet_prefix_length = prefix ) != 0 ) : #NEWLINE# #INDENT# self . _log . info ( ( '# Step 1A: Create L3Policy with Invalid IP-Pool %s did NOT fail' % prefix ) ) #NEWLINE# #UNINDENT# self . _log . info ( '# Step 1A: Verify L3Policy did NOT get created' ) #NEWLINE# if ( self . gbpverify . gbp_l2l3ntk_pol_ver_all ( 1 , 'l3p' , self . l3p_name ) != 0 ) : #NEWLINE# #INDENT# self . _log . info ( ( '# Step 1A: L3Policy did NOT fail to create even with Invalid IP-Pool %s' % invalid_prefix_length ) ) #NEWLINE# cnt += 1 #NEWLINE# #UNINDENT# #UNINDENT# if ( cnt > 0 ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _log . info ( '\nTESTCASE_GBP_L3P_NEG_2: PASSED' ) #NEWLINE# return 1