Exemple #1
0
 def test_all_router_ips(self):
     """ Does every router IP get COPP classified correctly?
     """
     with self.test_topology.switch_thrift() as switch_thrift:
         interfaces = switch_thrift.getAllInterfaces()
         self.assertIsNotNone(interfaces)
     test_bgp_pkts = []
     test_non_bgp_pkts = []
     for intf in interfaces.values():
         for prefix in intf.address:
             test_bgp_pkts.append(
                 packet.gen_pkt_to_switch(self,
                                          dst_ip=ip_addr_to_str(prefix.ip),
                                          dst_port=179))
             test_non_bgp_pkts.append(
                 packet.gen_pkt_to_switch(self,
                                          dst_ip=ip_addr_to_str(prefix.ip),
                                          dst_port=12345))
     # make sure each bgp-like pkt bumps the hi-pri counter
     self.send_pkts_verify_counter_bump(
         test_bgp_pkts, "cpu.queue%d.in_pkts.sum" % HIGH_PRI_QUEUE)
     # make sure each non-bgp pkt bumps the mid-pri counter
     self.send_pkts_verify_counter_bump(
         test_non_bgp_pkts, "cpu.queue%d.in_pkts.sum" % MID_PRI_QUEUE)
Exemple #2
0
 def test_nonbgp_router_copp(self):
     """ Copp Map non-BGP traffic (dport!=179) to mid-pri
     """
     pkt = packet.gen_pkt_to_switch(self, dst_port=12345)
     counter = "cpu.queue%d.in_pkts.sum" % MID_PRI_QUEUE
     self.send_pkt_verify_counter_bump(pkt, counter)
Exemple #3
0
 def test_bgp_copp(self):
     """ Copp Map BGP traffic (dport=179) to high-priority
     """
     pkt = packet.gen_pkt_to_switch(self, dst_port=179)
     counter = "cpu.queue%d.in_pkts.sum" % HIGH_PRI_QUEUE
     self.send_pkt_verify_counter_bump(pkt, counter)
Exemple #4
0
 def test_nonbgp_router_copp(self):
     """ Copp Map non-BGP traffic (dport!=179) to mid-pri
     """
     pkt = packet.gen_pkt_to_switch(self, dst_port=12345)
     self.send_pkt_verify_counter_bump(
         pkt, self.cpu_mid_pri_queue_prefix + ".in_pkts.sum")
Exemple #5
0
 def test_bgp_copp(self):
     """ Copp Map BGP traffic (dport=179) to high-priority
     """
     pkt = packet.gen_pkt_to_switch(self, dst_port=179)
     self.send_pkt_verify_counter_bump(
         pkt, self.cpu_high_pri_queue_prefix + ".in_pkts.sum")
Exemple #6
0
 def test_nonbgp_router_copp(self):
     """ Copp Map non-BGP traffic (dport!=179) to mid-pri
     """
     pkt = packet.gen_pkt_to_switch(self, dst_port=12345)
     counter = "cpu.queue%d.in_pkts.sum" % MID_PRI_QUEUE
     self.send_pkt_verify_counter_bump(pkt, counter)
Exemple #7
0
 def test_bgp_copp(self):
     """ Copp Map BGP traffic (dport=179) to high-priority
     """
     pkt = packet.gen_pkt_to_switch(self, dst_port=179)
     counter = "cpu.queue%d.in_pkts.sum" % HIGH_PRI_QUEUE
     self.send_pkt_verify_counter_bump(pkt, counter)