#NEWLINE# def __init__( self ) : #NEWLINE# #INDENT# super ( OfTester , self ) . __init__ ( ) #NEWLINE# self . _set_logger ( ) #NEWLINE# self . interval = CONF [ 'test-switch' ] [ 'interval' ] #NEWLINE# self . target_dpid = self . _convert_dpid ( CONF [ 'test-switch' ] [ 'target' ] ) #NEWLINE# self . target_send_port_1 = CONF [ 'test-switch' ] [ 'target_send_port_1' ] #NEWLINE# self . target_send_port_2 = CONF [ 'test-switch' ] [ 'target_send_port_2' ] #NEWLINE# self . target_recv_port = CONF [ 'test-switch' ] [ 'target_recv_port' ] #NEWLINE# self . tester_dpid = self . _convert_dpid ( CONF [ 'test-switch' ] [ 'tester' ] ) #NEWLINE# self . tester_send_port = CONF [ 'test-switch' ] [ 'tester_send_port' ] #NEWLINE# self . tester_recv_port_1 = CONF [ 'test-switch' ] [ 'tester_recv_port_1' ] #NEWLINE# self . tester_recv_port_2 = CONF [ 'test-switch' ] [ 'tester_recv_port_2' ] #NEWLINE# self . logger . info ( 'target_dpid=%s' , dpid_lib . dpid_to_str ( self . target_dpid ) ) #NEWLINE# self . logger . info ( 'tester_dpid=%s' , dpid_lib . dpid_to_str ( target_opt . tester_dpid ) ) #NEWLINE# def __get_version( opt ) : #NEWLINE# #INDENT# vers = { #NEWLINE# #INDENT# 'openflow10' : ofproto_v1_0 . OFP_VERSION , #NEWLINE# 'openflow13' : ofproto_v1_3 . OFP_VERSION , #NEWLINE# 'openflow14' : ofproto_v1_4 . OFP_VERSION , #NEWLINE# 'openflow15' : ofproto_v1_5 . OFP_VERSION , #NEWLINE# #UNINDENT# } #NEWLINE# ver = vers . get ( opt . lower ( ) ) #NEWLINE# if ( ver is None ) : #NEWLINE# #INDENT# self . logger . error ( '%s is not supported. Supported versions are %s.' , opt , list ( vers . keys ( ) ) ) #NEWLINE# self . _test_end ( ) #NEWLINE# #UNINDENT# return ver #NEWLINE# #UNINDENT# target_opt = CONF [ 'test-switch' ] [ 'target_version' ] #NEWLINE# self . logger . info ( 'target ofp version=%s' , target_opt ) #NEWLINE# OfTester . target_ver = __get_version ( target_opt ) #NEWLINE# tester_opt = CONF [ 'test-switch' ] [ 'tester_version' ] #NEWLINE# self . logger . info ( 'tester ofp version=%s' , tester_opt ) #NEWLINE# OfTester . tester_ver = __get_version ( tester_opt ) #NEWLINE# ofproto_protocol . set_app_supported_versions ( [ OfTester . target_ver , OfTester . tester_ver ] ) #NEWLINE# test_dir = CONF [ 'test-switch' ] [ 'dir' ] #NEWLINE# self . logger . info ( 'Test files directory = %s' , test_dir ) #NEWLINE# self . target_sw = OpenFlowSw ( DummyDatapath ( ) , self . logger ) #NEWLINE# self . tester_sw = OpenFlowSw ( DummyDatapath ( ) , self . logger ) #NEWLINE# self . state = STATE_INIT_FLOW #NEWLINE# self . sw_waiter = None #NEWLINE# self . waiter = None #NEWLINE# self . send_msg_xids = [ ] #NEWLINE# self . rcv_msgs = [ ] #NEWLINE# self . ingress_event = None #NEWLINE# self . ingress_threads = [ ] #NEWLINE# self . thread_msg = None #NEWLINE# self . test_thread = hub . spawn ( self . _test_sequential_execute , test_dir )