aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_ip6.py
AgeCommit message (Expand)AuthorFilesLines
2020-04-06misc: fix python sonarcloud BLOCKER level issuesPaul Vinciguerra1-0/+1
2020-03-17fib: Always install all routers mcast addressesNeale Ranns1-1/+1
2020-03-12policer: API cleanupJakub Grajciar1-4/+4
2020-02-10ip-neighbor: fix MLD reports not being sentNeale Ranns1-1/+31
2020-02-07tests: support python 3.8Ole Troan1-1/+1
2019-12-17ip: Protocol Independent IP NeighborsNeale Ranns1-18/+37
2019-12-14tests: changes for scapy 2.4.3 migrationsnaramre1-2/+1
2019-11-26fib: Table ReplaceNeale Ranns1-2/+143
2019-11-15tests: Remove the unrequired VPP IP address/prefix class wrappersNeale Ranns1-10/+9
2019-11-08tests: python3 use byte strings in raw()Ole Troan1-17/+17
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto1-1/+1
2019-10-28tests: make RA tests run on VPP timeAndrew Yourtchenko1-7/+7
2019-10-16tests: python3 changes for ip6 fib testssnaramre1-1/+1
2019-08-12ip: allow addrs from the same prefix on intfMatthew Smith1-2/+77
2019-06-26api: refactor format_vl_api_prefix_t return keysPaul Vinciguerra1-20/+22
2019-06-18fib: fib api updatesNeale Ranns1-109/+58
2019-06-18ip: reassembly-separate feature and custom codeKlement Sekera1-0/+18
2019-05-28Add an ip6 local hop-by-hop protocol demux tableDave Barach1-1/+14
2019-05-16tests: refactor. Replace literal constant w/ named constant.Paul Vinciguerra1-3/+6
2019-04-10Tests Cleanup: Fix missing calls to setUpClass/tearDownClass.Paul Vinciguerra1-0/+76
2019-03-28Typos. A bunch of typos I've been collecting.Paul Vinciguerra1-15/+16
2019-03-11vpp_papi_provider: Remove more wrapper functions.Ole Troan1-4/+8
2019-03-11VPP-1508: Tests: Fix vpp_api struct.error under py3.Paul Vinciguerra1-3/+3
2019-03-11VPP-1508: Use scapy.compat to manage packet level library differences.Paul Vinciguerra1-0/+1
2019-03-07Tests: Refactor payload_to_info()Paul Vinciguerra1-1/+1
2019-03-06test framework: vpp_papi_provider.py - further cleanupOle Troan1-10/+8
2019-03-04test framework: Fix wrapper functions to match API message names.Ole Troan1-4/+4
2019-03-01Tests: Refactor duplicated code.Paul Vinciguerra1-7/+1
2019-02-26VPP-1508 python tests: unicodePaul Vinciguerra1-3/+8
2019-02-20TESTS: refactor framework send_and_expect.Paul Vinciguerra1-6/+6
2019-01-30Use IP and MAC API types for neighborsNeale Ranns1-33/+26
2018-12-16IP6-MFIB: replace the radix tree with bihash (VPP-1526)Neale Ranns1-21/+43
2018-12-12PAPI: Allow ipaddress object as argument and return values from API callsOle Troan1-6/+6
2018-12-06API: Change ip4_address and ip6_address to use type alias.Ole Troan1-1/+1
2018-12-05VPP-1508 python3 tests: xrangePaul Vinciguerra1-20/+21
2018-11-30Tests: Fix traceback.Paul Vinciguerra1-108/+162
2018-11-29VPP-1507: Added binary api to dump configured ip_punt_redirectPavel Kotucek1-12/+42
2018-11-26Python3 tests: Fix asserts.Paul Vinciguerra1-2/+2
2018-09-11GBP Endpoint UpdatesNeale Ranns1-1/+2
2018-08-03loop counter to prevent infiinte number of look ups per-packetNeale Ranns1-1/+120
2018-07-02make_test: add icmp packet size sweep and icmp echo testsJan Gelety1-23/+101
2018-05-15No overlapping sub-nets on any interface in the same table/VRF (VPP-943)Neale Ranns1-1/+5
2018-04-27IPv6 NS: use the mcast rewrite node to fill in the destination MACNeale Ranns1-1/+1
2018-03-16IPv6 ND Router discovery control plane (VPP-1095)Juraj Sloboda1-0/+175
2018-03-16IPv6 ND Router discovery data plane (VPP-1095)Juraj Sloboda1-3/+113
2018-01-09test: consolidate the multiple versions of send_and_*Neale Ranns1-49/+0
2017-11-11MPLS disposition actions at the tail of unicast LSPsNeale Ranns1-2/+2
2017-10-31Refactor IP input checks for re-use at MPLS dispositionNeale Ranns1-1/+77
2017-10-10punt and drop features:Neale Ranns1-1/+113
2017-09-11FIB table add/delete APINeale Ranns1-2/+5
cls.VPP_SOFT_IP4S[i] = "172.17.%u.1" % i if isinstance(cls.INT_DETAILS[i], cls.Subint): interface = "pg%u.%u" % (i, cls.INT_DETAILS[i].sub_id) else: interface = "pg%u" % i cls.api("sw_interface_add_del_address %s %s/24" % (interface, cls.VPP_SOFT_IP4S[i])) cls.log("My subinterface IPv4 address is %s" % (cls.MY_SOFT_IP4S[i])) # let VPP know MAC addresses of peer (sub)interfaces @classmethod def resolve_arp_on_software_interfaces(cls, args): for i in args: ip = cls.VPP_SOFT_IP4S[i] cls.log("Sending ARP request for %s on port %u" % (ip, i)) packet = (Ether(dst="ff:ff:ff:ff:ff:ff", src=cls.MY_MACS[i]) / ARP(op=ARP.who_has, pdst=ip, psrc=cls.MY_SOFT_IP4S[i], hwsrc=cls.MY_MACS[i])) cls.add_dot1_layers(i, packet) cls.pg_add_stream(i, packet) cls.pg_enable_capture([i]) cls.cli(2, "trace add pg-input 1") cls.pg_start() # We don't need to read output @classmethod def config_fib_entries(cls, count): n_int = len(cls.interfaces) for i in cls.interfaces: cls.api("ip_add_del_route 10.0.0.1/32 via %s count %u" % (cls.VPP_SOFT_IP4S[i], count / n_int)) @classmethod def add_dot1_layers(cls, i, packet): assert(type(packet) is Ether) payload = packet.payload det = cls.INT_DETAILS[i] if isinstance(det, cls.Dot1QSubint): packet.remove_payload() packet.add_payload(Dot1Q(vlan=det.sub_id) / payload) elif isinstance(det, cls.Dot1ADSubint): packet.remove_payload() packet.add_payload(Dot1Q(vlan=det.outer_vlan) / Dot1Q(vlan=det.inner_vlan) / payload) packet.type = 0x88A8 def remove_dot1_layers(self, i, packet): self.assertEqual(type(packet), Ether) payload = packet.payload det = self.INT_DETAILS[i] if isinstance(det, self.Dot1QSubint): self.assertEqual(type(payload), Dot1Q) self.assertEqual(payload.vlan, self.INT_DETAILS[i].vlan) payload = payload.payload elif isinstance(det, self.Dot1ADSubint): # TODO: change 88A8 type self.assertEqual(type(payload), Dot1Q) self.assertEqual(payload.vlan, self.INT_DETAILS[i].outer_vlan) payload = payload.payload self.assertEqual(type(payload), Dot1Q) self.assertEqual(payload.vlan, self.INT_DETAILS[i].inner_vlan) payload = payload.payload packet.remove_payload() packet.add_payload(payload) def create_stream(self, pg_id): pg_targets = [None] * 3 pg_targets[0] = [1, 2] pg_targets[1] = [0, 2] pg_targets[2] = [0, 1] pkts = [] for i in range(0, 257): target_pg_id = pg_targets[pg_id][i % 2] info = self.create_packet_info(pg_id, target_pg_id) payload = self.info_to_payload(info) p = (Ether(dst=self.VPP_MACS[pg_id], src=self.MY_MACS[pg_id]) / IP(src=self.MY_SOFT_IP4S[pg_id], dst=self.MY_SOFT_IP4S[target_pg_id]) / UDP(sport=1234, dport=1234) / Raw(payload)) info.data = p.copy() self.add_dot1_layers(pg_id, p) if not isinstance(self.INT_DETAILS[pg_id], self.Subint): packet_sizes = [64, 512, 1518, 9018] else: packet_sizes = [64, 512, 1518+4, 9018+4] size = packet_sizes[(i / 2) % len(packet_sizes)] self.extend_packet(p, size) pkts.append(p) return pkts def verify_capture(self, o, capture): last_info = {} for i in self.interfaces: last_info[i] = None for packet in capture: self.remove_dot1_layers(o, packet) # Check VLAN tags and Ethernet header self.assertTrue(Dot1Q not in packet) try: ip = packet[IP] udp = packet[UDP] payload_info = self.payload_to_info(str(packet[Raw])) packet_index = payload_info.index src_pg = payload_info.src dst_pg = payload_info.dst self.assertEqual(dst_pg, o) self.log("Got packet on port %u: src=%u (id=%u)" % (o, src_pg, packet_index), 2) next_info = self.get_next_packet_info_for_interface2(src_pg, dst_pg, last_info[src_pg]) last_info[src_pg] = 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.log("Unexpected or invalid packet:") packet.show() raise for i in self.interfaces: remaining_packet = self.get_next_packet_info_for_interface2(i, o, last_info[i]) self.assertTrue(remaining_packet is None, "Port %u: Packet expected from source %u didn't arrive" % (o, i)) def test_fib(self): """ IPv4 FIB test """ for i in self.interfaces: pkts = self.create_stream(i) self.pg_add_stream(i, pkts) self.pg_enable_capture(self.interfaces) self.pg_start() for i in self.interfaces: out = self.pg_get_capture(i) self.log("Verifying capture %u" % i) self.verify_capture(i, out) if __name__ == '__main__': unittest.main(testRunner = VppTestRunner)