#NEWLINE# def test_blockedBody( self ) : #NEWLINE# #INDENT# self . CANEngine = CANSploit ( ) #NEWLINE# self . CANEngine . load_config ( 'tests/test_1.py' ) #NEWLINE# self . CANEngine . edit_module ( 2 , { #NEWLINE# #INDENT# 'pipe' : 2 , #NEWLINE# 'black_body' : [ [ 1 , 2 , 3 , 6 , 5 ] ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . CANEngine . start_loop ( ) #NEWLINE# index = 3 #NEWLINE# self . CANEngine . call_module ( 0 , 't 4:6:010203060505' ) #NEWLINE# time . sleep ( 1 ) #NEWLINE# mod = self . CANEngine . _enabledList [ index ] [ 1 ] . CANList #NEWLINE# self . assertFalse ( ( mod is None ) , 'We should find message in PIPE' ) #NEWLINE# self . assertTrue ( ( mod . frame_id == 4 ) , 'We should be able to find ID 4' ) #NEWLINE# self . CANEngine . _enabledList [ index ] [ 1 ] . CANList = None #NEWLINE# self . CANEngine . call_module ( 0 , 't 4:5:0102030605' ) #NEWLINE# mod = index . CANEngine . _enabledList [ index ] [ 1 ] . CANList #NEWLINE# self . assertTrue ( ( mod is None ) , 'We should NOT find message in PIPE' ) #NEWLINE# self . CANEngine . _enabledList [ index ] [ 1 ] . CANList = None #NEWLINE# self . CANEngine . edit_module ( 2 , { #NEWLINE# #INDENT# 'pipe' : 2 , #NEWLINE# 'white_body' : [ [ 1 , 2 , 3 , 6 , 5 ] ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . CANEngine . call_module ( 0 , 't 4:5:0102030605' ) #NEWLINE# time . sleep ( 1 ) #NEWLINE# mod = self . CANEngine . _enabledList [ index ] [ 1 ] . CANList #NEWLINE# self . assertFalse ( ( mod is None ) , 'We should find message in PIPE' ) #NEWLINE# self . assertTrue ( ( mod . frame_id == 4 ) , 'We should be able to find ID 4' ) #NEWLINE# self . CANEngine . _enabledList [ index ] [ 1 ] . CANList = None #NEWLINE# self . CANEngine . call_module ( 0 , 't 4:6:010203060505' ) #NEWLINE# mod = self . CANEngine . _enabledList [ index ] [ 1 ] . CANList #NEWLINE# self . assertTrue ( ( mod is None ) , 'We should NOT find message in PIPE' ) #NEWLINE# self . CANEngine . _enabledList [ index ] [ 1 ] . CANList = None