#NEWLINE# def _test_exist_check( self , method , message ) : #NEWLINE# #INDENT# ofp = method . __self__ . dp . ofproto #NEWLINE# parser = method . __self__ . dp . ofproto_parser #NEWLINE# method_dict = { #NEWLINE# #INDENT# OpenFlowSw . send_flow_stats . __name__ : { #NEWLINE# #INDENT# 'reply' : parser . OFPFlowStatsReply , #NEWLINE# 'compare' : self . _compare_flow , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# if ( ofp . OFP_VERSION >= ofproto_v1_2 . OFP_VERSION ) : #NEWLINE# #INDENT# method_dict [ OpenFlowSw . send_group_desc_stats . __name__ ] = { #NEWLINE# #INDENT# 'reply' : parser . OFPGroupDescStatsReply , #NEWLINE# 'compare' : self . _compare_group , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( ofp . OFP_VERSION >= ofproto_v1_3 . OFP_VERSION ) : #NEWLINE# #INDENT# method_dict [ OpenFlowSw . send_meter_config_stats . __name__ ] = { #NEWLINE# #INDENT# 'reply' : parser . OFPMeterConfigStatsReply , #NEWLINE# 'compare' : self . _compare_meter , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# xid = method ( ) #NEWLINE# self . send_msg_xids . append ( xid ) #NEWLINE# self . _wait ( ) #NEWLINE# ng_stats = [ ] #NEWLINE# for msg in self . rcv_msgs : #NEWLINE# #INDENT# assert isinstance ( msg , method_dict [ method . __name__ ] [ 'reply' ] ) #NEWLINE# for stats in msg . body : #NEWLINE# #INDENT# ( result , stats ) = method_dict [ method . __name__ ] [ 'compare' ] ( stats , message ) #NEWLINE# if result : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ng_stats . append ( stats ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# error_dict = { #NEWLINE# #INDENT# OpenFlowSw . send_flow_stats . __name__ : { #NEWLINE# #INDENT# 'flows' : ', ' . join ( ng_stats ) , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# if ( ofp . OFP_VERSION >= ofproto_v1_2 . OFP_VERSION ) : #NEWLINE# #INDENT# error_dict [ OpenFlowSw . send_group_desc_stats . __name__ ] = { #NEWLINE# #INDENT# 'groups' : ', ' . join ( ng_stats ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( ofp . OFP_VERSION >= ofproto_v1_3 . OFP_VERSION ) : #NEWLINE# #INDENT# error_dict [ OpenFlowSw . send_meter_config_stats . __name__ ] = { #NEWLINE# #INDENT# 'meters' : ', ' . join ( ng_stats ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# raise TestFailure ( message . state , ** error_dict [ method . __name__ ] )