コード例 #1
0
 def verify_packet(self, exp_pkt, port):
     port_list = []
     port_list.append(port)
     if self.generate_tv:
         tvutils.add_traffic_expectation(self.tc, port_list, exp_pkt)
     else:
         testutils.verify_packet(self, exp_pkt, port)
コード例 #2
0
 def verify_any_packet_any_port(self, pkts, ports):
     if self.generate_tv:
         for pkt in pkts:
             tvutils.add_traffic_expectation(self.tc, ports, pkt)
         # workaround to return a port value
         return random.randint(0, 1)
     else:
         return testutils.verify_any_packet_any_port(self, pkts, ports)
コード例 #3
0
 def verify_packets(self, pkt, ports):
     if self.generate_tv:
         for port in ports:
             port_list = []
             port_list.append(port)
             tvutils.add_traffic_expectation(self.tc, port_list, pkt)
     else:
         testutils.verify_packets(self, pkt, ports)
コード例 #4
0
 def verify_each_packet_on_each_port(self, packets, ports):
     if self.generate_tv:
         for i in range(len(packets)):
             port_list = []
             port_list.append(ports[i])
             tvutils.add_traffic_expectation(self.tc, port_list, packets[i])
     else:
         testutils.verify_each_packet_on_each_port(self, packets, ports)