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)
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)
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)
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)