aboutsummaryrefslogtreecommitdiffstats
path: root/resources/api
AgeCommit message (Expand)AuthorFilesLines
2020-10-29Support existing test types with ASTFVratko Polak1-2/+2
2020-10-23CSIT-1597 NAT44 API: dynamic configJan Gelety1-2/+4
2020-10-19Tests: Remove GBPpmikus1-14/+0
2020-09-14Update of VPP_STABLE_VER filesJan Gelety1-267/+2
2020-09-11API: Add collection for 29037/3Jan Gelety1-0/+265
2020-09-11Add ipsec async mode performance test casesYulong Pei1-0/+2
2020-09-07VPP-DEV API COV: Add NAT44-ED testsJan Gelety1-20/+20
2020-08-09job_specs: use test tag ethip4udp-snat44det-h1-p1-s1 not ethip4udp-ip4base-nat44Jan Gelety1-1/+1
2020-08-08Fix: NAT44 deterministic moved to separate det44 pluginJan Gelety1-2/+11
2020-08-07Perf: NAT44 endpoint-dependent mode - udp, part IJan Gelety1-0/+16
2020-05-11CSIT-1597 API cleanup: ipsecJan Gelety1-240/+2
2020-04-29API: Add collection for 26276/7Jan Gelety1-0/+238
2020-04-28CSIT-1597 API cleanup: lispJan Gelety1-258/+2
2020-04-28FIX: crc for create_vhost_user_ifJan Gelety1-1/+1
2020-04-28API: Add collection for 24663/6Jan Gelety1-0/+247
2020-04-02CSIT-1597 API cleanup: virtioJan Gelety1-247/+2
2020-03-30API: Add collection for 26086/8Jan Gelety1-0/+245
2020-03-29Update of VPP_STABLE_VER filesJan Gelety1-249/+2
2020-03-29API: Add collection for 26256/7Jan Gelety1-4/+4
2020-03-26API: Add collection for 25923/9Jan Gelety1-0/+247
2020-03-27CSIT-1597 API cleanup: aclJan Gelety1-249/+2
2020-03-25API: Add collection for 25787/15Jan Gelety1-0/+247
2020-03-24CSIT-1597 API cleanup: srv6Jan Gelety1-249/+2
2020-03-23API: Add collection for 25647/3Jan Gelety1-0/+247
2020-03-17CSIT-1597 API cleanup: vpeJan Gelety1-249/+2
2020-03-11API: Add collection for 25567/1Jan Gelety1-0/+247
2020-03-16CSIT-1597 API cleanup: vxlanJan Gelety1-249/+2
2020-03-16API: Add collection for 25569/4Jan Gelety1-0/+247
2020-03-10CSIT-1597 API cleanup: policerJan Gelety1-249/+2
2020-03-10API: Add collection for 25566/5Jan Gelety1-0/+247
2020-03-10CSIT-1597 API cleanup: ipsecJan Gelety1-249/+2
2020-03-10API: Add collection for 25529/2Jan Gelety1-0/+248
2020-03-09CSIT-1597 API cleanup: l2Jan Gelety1-248/+4
2020-03-09API: Add collection for 22970/10Jan Gelety1-0/+244
2020-02-26CRC comments: SW crypto is enoughVratko Polak1-3/+3
2020-02-10FIX: set host physical interface mac address to rdma interfaceJan Gelety1-0/+2
2020-01-31Update CRC commentsVratko Polak1-15/+18
2020-01-30perf: Add hoststack NSIM+LDPRELOAD+IPERF3 test suiteDave Wallace1-0/+4
2020-01-14Update comments in crc file.Vratko Polak1-5/+4
2020-01-13CSIT-1597 API cleanup: rdmaJan Gelety1-241/+4
2020-01-08API: Add collection for 24225/3Jan Gelety1-8/+8
2019-12-12API: Add collection for 22970/5Jan Gelety1-0/+237
2019-12-12CSIT-1597, CSIT-1647 API cleanup: gbpJan Gelety1-241/+4
2019-12-12API: Add collection for 23835/1Jan Gelety1-12/+12
2019-12-01API: Add collection for 23830/1Jan Gelety1-6/+6
2019-12-01API: Add collection for 23829/1Jan Gelety1-0/+237
2019-12-01CSIT-1597 API cleanup: vhostJan Gelety1-241/+2
2019-12-01API: Add collection for 22277/5Jan Gelety1-0/+239
2019-12-11CSIT-1597 API cleanup: tapJan Gelety1-241/+4
2019-11-30API: Add collection for 23887/2Jan Gelety1-6/+6
_if'): packet = pg_if.sub_if.add_dot1_layer(packet) packets.append(packet) pg_if.add_stream(packets) cls.logger.info("Sending broadcast eth frames for MAC learning") cls.pg_start() def create_stream(self, src_if, packet_sizes, packets_per_burst): """ Create input packet stream for defined interface. :param object src_if: Interface to create packet stream for. :param list packet_sizes: List of required packet sizes. :param int packets_per_burst: Number of packets in burst. :return: Stream of packets. """ pkts = [] for i in range(0, packets_per_burst): dst_if = self.flows[src_if][i % 2] dst_host = random.choice(self.hosts_by_pg_idx[dst_if.sw_if_index]) src_host = random.choice(self.hosts_by_pg_idx[src_if.sw_if_index]) pkt_info = self.create_packet_info(src_if, dst_if) payload = self.info_to_payload(pkt_info) p = (Ether(dst=dst_host.mac, src=src_host.mac) / IP(src=src_host.ip4, dst=dst_host.ip4) / UDP(sport=1234, dport=1234) / Raw(payload)) pkt_info.data = p.copy() if hasattr(src_if, 'sub_if'): p = src_if.sub_if.add_dot1_layer(p) size = random.choice(packet_sizes) self.extend_packet(p, size) pkts.append(p) return pkts def verify_capture(self, pg_if, capture): """ Verify captured input packet stream for defined interface. :param object pg_if: Interface to verify captured packet stream for. :param list capture: Captured packet stream. """ last_info = dict() for i in self.pg_interfaces: last_info[i.sw_if_index] = None dst_sw_if_index = pg_if.sw_if_index for packet in capture: payload_info = self.payload_to_info(str(packet[Raw])) src_sw_if_index = payload_info.src src_if = None for ifc in self.pg_interfaces: if ifc != pg_if: if ifc.sw_if_index == src_sw_if_index: src_if = ifc break if hasattr(src_if, 'sub_if'): # Check VLAN tags and Ethernet header packet = src_if.sub_if.remove_dot1_layer(packet) self.assertTrue(Dot1Q not in packet) try: ip = packet[IP] udp = packet[UDP] packet_index = payload_info.index self.assertEqual(payload_info.dst, dst_sw_if_index) self.logger.debug("Got packet on port %s: src=%u (id=%u)" % (pg_if.name, payload_info.src, packet_index)) next_info = self.get_next_packet_info_for_interface2( payload_info.src, dst_sw_if_index, last_info[payload_info.src]) last_info[payload_info.src] = next_info self.assertTrue(next_info is not None) self.assertEqual(packet_index, next_info.index) saved_packet = next_info.data # Check standard fields self.assertEqual(ip.src, saved_packet[IP].src) self.assertEqual(ip.dst, saved_packet[IP].dst) self.assertEqual(udp.sport, saved_packet[UDP].sport) self.assertEqual(udp.dport, saved_packet[UDP].dport) except: self.logger.error(ppp("Unexpected or invalid packet:", packet)) raise for i in self.pg_interfaces: remaining_packet = self.get_next_packet_info_for_interface2( i, dst_sw_if_index, last_info[i.sw_if_index]) self.assertTrue( remaining_packet is None, "Port %u: Packet expected from source %u didn't arrive" % (dst_sw_if_index, i.sw_if_index)) def run_l2bd_test(self, pkts_per_burst): """ L2BD MAC learning test """ # Create incoming packet streams for packet-generator interfaces for i in self.pg_interfaces: packet_sizes = self.sub_if_packet_sizes if hasattr(i, 'sub_if') \ else self.pg_if_packet_sizes pkts = self.create_stream(i, packet_sizes, pkts_per_burst) i.add_stream(pkts) # Enable packet capture and start packet sending self.pg_enable_capture(self.pg_interfaces) self.pg_start() # Verify outgoing packet streams per packet-generator interface for i in self.pg_interfaces: capture = i.get_capture() self.logger.info("Verifying capture on interface %s" % i.name) self.verify_capture(i, capture) def test_l2bd_sl(self): """ L2BD MAC learning single-loop test Test scenario: 1.config MAC learning enabled learn 100 MAC enries 3 interfaces: untagged, dot1q, dot1ad (dot1q used instead of dot1ad in the first version) 2.sending l2 eth pkts between 3 interface 64B, 512B, 1518B, 9200B (ether_size) burst of 2 pkts per interface """ self.run_l2bd_test(self.sl_pkts_per_burst) def test_l2bd_dl(self): """ L2BD MAC learning dual-loop test Test scenario: 1.config MAC learning enabled learn 100 MAC enries 3 interfaces: untagged, dot1q, dot1ad (dot1q used instead of dot1ad in the first version) 2.sending l2 eth pkts between 3 interface 64B, 512B, 1518B, 9200B (ether_size) burst of 257 pkts per interface """ self.run_l2bd_test(self.dl_pkts_per_burst) if __name__ == '__main__': unittest.main(testRunner=VppTestRunner)