aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vpp
AgeCommit message (Expand)AuthorFilesLines
2018-12-11Add missing = to all suite VariablesVratko Polak109-203/+203
2018-12-07VPP_Device - add baseline tests - part IJan Gelety4-12/+345
2018-11-30CSIT-1299: Revise the graphs in TrendingTibor Frank4-4/+4
2018-11-29FIX: VPP_Device - use vpp bionic packagesJan Gelety2-1/+2
2018-11-29FIX: Exclude softwire func tests from executionJan Gelety3-2/+3
2018-11-27CSIT python API introductionJan Gelety2-2/+3
2018-10-25CSIT-1339 Create initial l2xc testPeter Mikus2-0/+126
2018-10-24Remove usage of vpp-ext-deps packageJan Gelety1-1/+1
2018-10-20update l2bdbasemaclrn-mrr and l2bdbasemaclrn-ndrpdr for x553 NICYulong Pei2-2/+2
2018-10-12Tag l2bdscale as L2BDSCALE, not L2BDBASEVratko Polak24-24/+24
2018-10-10CSIT-1297: Modify the bootstrap.sh to run only selected mrr suitesTibor Frank10-10/+10
2018-10-10Add VXLAN scale perf testsJan Gelety20-60/+2228
2018-10-02CSIT-1325 - FIX: AVF tests failing on unbindPeter Mikus4-4/+4
2018-10-01CSIT-1327 Migrate from vpp-dkms-dpdk to vpp-ext-depsPeter Mikus1-1/+1
2018-09-28CSIT-1321 Add IP4base tests using AVF driverPeter Mikus4-0/+484
2018-09-21Fix autogen regenerator and few suitesVratko Polak12-200/+152
2018-09-20FIX: 40Ge2P1Vic1385-Eth-L2Bdbasemaclrn-Mrr typoPeter Mikus1-1/+1
2018-09-20Add dot1q-l2bdbase-2memif-[ndrpdr|mrr] perf tests for 2-node topologyJan Gelety8-0/+1242
2018-09-20Add dot1q-l2bdbase-2vhost-[ndrpdr|mrr] perf tests for 2-node topologyJan Gelety8-94/+696
2018-09-20CSIT-1205 Create AVF driver test - Add Tests L2BD L2XCPeter Mikus8-0/+969
2018-09-20Create basic 2-node topology performance tests for Intel-X553 NICYulong Pei10-0/+1280
2018-09-18Add dot1q-ip6base-[ndrpdr|mrr] perf tests for 2-node topologyJan Gelety12-4/+1090
2018-09-17Add dot1q-l2[bd|xc]base-[ndrpdr|mrr] perf tests for 2-node topologyJan Gelety16-128/+1231
2018-09-14Add dot1q-ip4base-[ndrpdr|mrr] perf tests for 2-node topologyJan Gelety14-13/+1120
2018-09-10Create l2bdscale tests for 2-node topologyJan Gelety38-397/+1983
2018-09-07CSIT-1272: Fix VTS testsTibor Frank6-6/+6
2018-09-07Create ip6scale tests for 2-node topologyJan Gelety24-162/+1734
2018-09-06Fix autogen violationsVratko Polak4-76/+124
2018-09-05Create ip4scale tests for 2-node topologyJan Gelety24-138/+1722
2018-09-05CSIT-1205 Create AVF driver testPeter Mikus4-0/+482
2018-09-05Add eth-ip4base-2memif[ndrpdr|mrr] perf tests for 2-node topologyJan Gelety10-0/+1468
2018-08-28Create ip4-feature perf tests for 2-node topologyJan Gelety144-846/+4337
2018-08-27FIX: Correction of ACL perf test suite documentationJan Gelety72-905/+840
2018-08-24VPP link bonding perf tests with two links between DUTsJan Gelety12-4/+687
2018-08-22CSIT-1164 Create VM vhost tests for 2-node topologyPeter Mikus36-0/+4946
2018-08-21FIX: Use correct interface type in x710_1lbvpplacp perf testsJan Gelety4-4/+4
2018-08-20Refactor VHOST codePeter Mikus99-1368/+622
2018-08-17CSIT-1245 - Wrong configuration of srv6proxy-ndrpdr-stat and srv6proxy-masq-n...Peter Mikus2-2/+2
2018-08-15FIX: Set default values for VTS teardown argumentsVratko Polak6-6/+18
2018-08-10CSIT-1156 Create container memif tests for 2-node topologyPeter Mikus28-34/+1210
2018-08-10CSIT-1193 De-duplicate bootstrap scripts into onePeter Mikus1-0/+9
2018-08-06CSIT_VIRL phased migration, prio P0 - apply SKIP_VPP_PATCH tagJan Gelety9-14/+16
2018-08-03Fix ommissions from recent ChangesVratko Polak2-0/+153
2018-07-27FIX: Interface up handlingPeter Mikus8-16/+0
2018-07-25Add MTU handling into perf testsPeter Mikus45-45/+11
2018-07-24CSIT-1097: Migrate L2 to NDRPDR and edit MRRVratko Polak168-7320/+13484
2018-07-24CSIT-1202: Unify min_rateVratko Polak3-3/+3
2018-07-24CSIT-1097: Unify max NIC bandwidth in ip4Peter Mikus4-15/+12
2018-07-24CSIT-1097: Migrate Vts suite to NDRPDRVratko Polak11-287/+1020
2018-07-24CSIT-1097: Migrate ip4 to NDRPDR and edit MRRVratko Polak152-6875/+12460
not the header pkt_len = Ether(buf)['IPv6'].plen + 14 + 40 if len(buf) < 60: return None elif ether_type == ETH_P_ARP: pkt = Ether(buf[:20]) if not pkt.haslayer(ARP): raise RuntimeError('Incomplete ARP packet') # len(eth) + arp(2 hw addr type + 2 proto addr type # + 1b len + 1b len + 2b operation) pkt_len = 14 + 8 pkt_len += 2 * pkt.getlayer(ARP).hwlen pkt_len += 2 * pkt.getlayer(ARP).plen del pkt elif ether_type == 32821: # RARP (Reverse ARP) pkt = Ether(buf[:20]) pkt.type = ETH_P_ARP # Change to ARP so it works with scapy pkt = Ether(str(pkt)) if not pkt.haslayer(ARP): pkt.show() raise RuntimeError('Incomplete RARP packet') # len(eth) + arp(2 hw addr type + 2 proto addr type # + 1b len + 1b len + 2b operation) pkt_len = 14 + 8 pkt_len += 2 * pkt.getlayer(ARP).hwlen pkt_len += 2 * pkt.getlayer(ARP).plen del pkt else: raise RuntimeError('Unknown protocol {0}'.format(ether_type)) if pkt_len < 60: pkt_len = 60 if len(buf) < pkt_len: return None return buf[0:pkt_len] def packet_reader(interface_name, queue): """Sub-process routine that reads packets and puts them to queue. This function is meant to be run in separate subprocess and is in tight loop reading raw packets from interface passed as parameter. :param interace_name: Name of interface to read packets from. :param queue: Queue in which this function will push incoming packets. :type interface_name: string :type queue: multiprocessing.Queue :return: None """ sock = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, ETH_P_ALL) sock.bind((interface_name, ETH_P_ALL)) while True: pkt = sock.recv(0x7fff) queue.put(pkt) class RxQueue(PacketVerifier): """Receive queue object. This object creates raw socket, reads packets from it and provides function to access them. :param interface_name: Which interface to bind to. :type interface_name: string """ def __init__(self, interface_name): PacketVerifier.__init__(self, interface_name) #self._queue = Queue() #self._proc = Process(target=packet_reader, args=(interface_name, # self._queue)) #self._proc.daemon = True #self._proc.start() #time.sleep(2) def recv(self, timeout=3, ignore=None): """Read next received packet. Returns scapy's Ether() object created from next packet in the queue. Queue is being filled in parallel in subprocess. If no packet arrives in given timeout queue.Empty exception will be risen. :param timeout: How many seconds to wait for next packet. :type timeout: int :return: Ether() initialized object from packet data. :rtype: scapy.Ether """ #pkt = self._queue.get(True, timeout=timeout) (rlist, _, _) = select.select([self._sock], [], [], timeout) if self._sock not in rlist: return None pkt = self._sock.recv(0x7fff) pkt_pad = auto_pad(pkt) print 'Received packet on {0} of len {1}'.format(self._ifname, len(pkt)) Ether(pkt).show2() print if ignore is not None: for i, ig_pkt in enumerate(ignore): # Auto pad all packets in ignore list ignore[i] = auto_pad(ig_pkt) for ig_pkt in ignore: if ig_pkt == pkt_pad: # Found the packet in ignore list, get another one # TODO: subtract timeout - time_spent in here ignore.remove(ig_pkt) return self.recv(timeout, ignore) return Ether(pkt) class TxQueue(PacketVerifier): """Transmission queue object. This object is used to send packets over RAW socket on a interface. :param interface_name: Which interface to send packets from. :type interface_name: string """ def __init__(self, interface_name): PacketVerifier.__init__(self, interface_name) def send(self, pkt): """Send packet out of the bound interface. :param pkt: Packet to send. :type pkt: string or scapy Packet derivative. """ print 'Sending packet out of {0} of len {1}'.format(self._ifname, len(pkt)) Ether(str(pkt)).show2() print pkt = auto_pad(str(pkt)) self._sock.send(pkt) class Interface(object): def __init__(self, if_name): self.if_name = if_name self.sent_packets = [] self.rxq = RxQueue(if_name) self.txq = TxQueue(if_name) def send_pkt(self, pkt): self.sent_packets.append(pkt) self.txq.send(pkt) def recv_pkt(self, timeout=3): return self.rxq.recv(timeout, self.sent_packets) def create_gratuitous_arp_request(src_mac, src_ip): """Creates scapy representation of gratuitous ARP request""" return (Ether(src=src_mac, dst='ff:ff:ff:ff:ff:ff') / ARP(psrc=src_ip, hwsrc=src_mac, pdst=src_ip)) def auto_pad(packet): """Pads zeroes at the end of the packet if the total len < 60 bytes.""" padded = str(packet) if len(padded) < 60: padded += ('\0' * (60 - len(padded))) return padded def checksum_equal(chksum1, chksum2): """Compares two checksums in one's complement notation. Checksums to be compared are calculated as 16 bit one's complement of the one's complement sum of 16 bit words of some buffer. In one's complement notation 0x0000 (positive zero) and 0xFFFF (negative zero) are equivalent. :param chksum1: First checksum. :param chksum2: Second checksum. :type chksum1: uint16 :type chksum2: uint16 :return: True if checksums are equivalent, False otherwise. :rtype: boolean """ if chksum1 == 0xFFFF: chksum1 = 0 if chksum2 == 0xFFFF: chksum2 = 0 return chksum1 == chksum2