def setUp(self): """Setup the TestFlowremoved Class instantiating.""" self.message = flow_removed.FlowRemoved() self.message.header.xid = 1 self.message.match = flow_match.Match() self.message.cookie = 0 self.message.priority = 1 self.message.reason = flow_removed.FlowRemovedReason.OFPRR_IDLE_TIMEOUT self.message.duration_sec = 4 self.message.duration_nsec = 23 self.message.idle_timeout = 9 self.message.packet_count = 10 self.message.byte_count = 4 self.message.match.wildcards = flow_match.FlowWildCards.OFPFW_TP_DST self.message.match.in_port = 80 self.message.match.dl_src = [1, 2, 3, 4, 5, 6] self.message.match.dl_dst = [1, 2, 3, 4, 5, 6] self.message.match.dl_vlan = 1 self.message.match.dl_vlan_pcp = 1 self.message.match.dl_type = 1 self.message.match.nw_tos = 1 self.message.match.nw_proto = 1 self.message.match.nw_src = [192, 168, 0, 1] self.message.match.nw_dst = [192, 168, 0, 2] self.message.match.tp_src = 80 self.message.match.tp_dst = 80
def setUp(self): """Test basic setup.""" self.message = FlowStats() self.message.length = 160 self.message.table_id = 1 self.message.match = flow_match.Match() self.message.duration_sec = 60 self.message.duration_nsec = 10000 self.message.priority = 1 self.message.idle_timeout = 300 self.message.hard_timeout = 6000 self.message.cookie = 1 self.message.packet_count = 1 self.message.byte_count = 1 self.message.match.in_port = 80 self.message.match.dl_src = [1, 2, 3, 4, 5, 6] self.message.match.dl_dst = [1, 2, 3, 4, 5, 6] self.message.match.dl_vlan = 1 self.message.match.dl_vlan_pcp = 1 self.message.match.dl_type = 1 self.message.match.nw_tos = 1 self.message.match.nw_proto = 1 self.message.match.nw_src = [192, 168, 0, 1] self.message.match.nw_dst = [192, 168, 0, 1] self.message.match.tp_src = 80 self.message.match.tp_dst = 80
def setUp(self): """Basic setup for test.""" self.message = flow_match.Match() self.message.in_port = 22 self.message.dl_src = [1, 2, 3, 4, 5, 6] self.message.dl_dst = [1, 2, 3, 4, 5, 6] self.message.dl_vlan = 1 self.message.dl_vlan_pcp = 1 self.message.dl_type = 1 self.message.nw_tos = 1 self.message.nw_proto = 1 self.message.nw_src = [192, 168, 0, 1] self.message.nw_dst = [192, 168, 0, 2] self.message.tp_src = 22 self.message.tp_dst = 22
def setUp(self): """Test basic setup.""" self.message = FlowStatsRequest() self.message.match = flow_match.Match() self.message.table_id = 1 self.message.out_port = 80 self.message.match.in_port = 80 self.message.match.dl_src = [1, 2, 3, 4, 5, 6] self.message.match.dl_dst = [1, 2, 3, 4, 5, 6] self.message.match.dl_vlan = 1 self.message.match.dl_vlan_pcp = 1 self.message.match.dl_type = 1 self.message.match.nw_tos = 1 self.message.match.nw_proto = 1 self.message.match.nw_src = [192, 168, 0, 1] self.message.match.nw_dst = [192, 168, 0, 1] self.message.match.tp_src = 80 self.message.match.tp_dst = 80
def setUp(self): """Test basic setup.""" self.message = AggregateStatsRequest() self.message.match = flow_match.Match() self.message.table_id = 1 self.message.out_port = phy_port.Port.OFPP_NONE self.message.match.wildcards = flow_match.FlowWildCards.OFPFW_TP_DST self.message.match.in_port = 80 self.message.match.dl_src = [1, 2, 3, 4, 5, 6] self.message.match.dl_dst = [1, 2, 3, 4, 5, 6] self.message.match.dl_vlan = 1 self.message.match.dl_vlan_pcp = 1 self.message.match.dl_type = 1 self.message.match.nw_tos = 1 self.message.match.nw_proto = 1 self.message.match.nw_src = [192, 168, 0, 1] self.message.match.nw_dst = [192, 168, 0, 1] self.message.match.tp_src = 80 self.message.match.tp_dst = 80
def test_pack_unpack(self): """[Common/FlowMatch] - packing and unpacking.""" pack = self.message.pack() unpacked = flow_match.Match() unpacked.unpack(pack) self.assertEqual(self.message.pack(), unpacked.pack())