aboutsummaryrefslogtreecommitdiffstats
path: root/requirements.txt
blob: 8c0928206e01f0fbfaff3e75b3c730794e635dde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Att
# DISCLAIMER: BEFORE EDITING THIS FILE!
#
# This file has two closely related consequences. The common part is that this
# file defines the content of virtual Python environment used when Robot tests
# are running.
#
# But the virtual environment is also being created on containerized
# environment created by either Nomad cluster (Jenkins, vpp_device) or during
# execution on SUT machines, which might have specific restrictions.
#
# Complete package and setting snapshot (for all container images),
# with network being limited to local only. This implies pip currently being
# set to site-packages only. So if the "container image" applied on the machine
# does not reflect the edits, some installations might fail.
# Even if the failure may not directly impact execution, this leads into
# inconsistency between installed environment and the code base which may lead
# into fatal error or uncaught exceptions.
#
# CSIT Core dependencies
ecdsa==0.13.3
paramiko==2.6.0
pycrypto==2.6.1
pypcap==1.2.3
PyYAML==5.1.1
requests==2.22.0
robotframework==3.1.2
scapy==2.4.3
scp==0.13.2

# Bootstraping dependencies
ansible==2.7.8

# PLRsearch dependencies
dill==0.2.8.2
numpy==1.17.3
scipy==1.1.0

# PAL/DOC dependencies
hdrhistogram==0.6.1
pandas==0.25.3
plotly==4.1.1
PTable==0.9.2
Sphinx==2.2.1
sphinx-rtd-theme==0.4.0
sphinxcontrib-programoutput==0.15
sphinxcontrib-robotdoc==0.11.0

# VPP requirements
ply==3.11

# PIP freeze dependencies
alabaster==0.7.12
Babel==2.7.0
bcrypt==3.1.7
certifi==2019.9.11
cffi==1.13.2
chardet==3.0.4
cryptography==2.8
docutils==0.15.2
future==0.18.2
idna==2.8
imagesize==1.1.0
Jinja2==2.10.3
MarkupSafe==1.1.1
packaging==19.2
pbr==5.4.3
pycparser==2.19
Pygments==2.4.2
PyNaCl==1.3.0
pyparsing==2.4.4
python-dateutil==2.8.1
pytz==2019.3
retrying==1.3.3
six==1.13.0
snowballstemmer==2.0.0
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
urllib3==1.25.6
] cls.flows[cls.pg3] = [cls.pg2] # packet sizes cls.pg_if_packet_sizes = [64, 512, 1518, 9018] cls.interfaces = list(cls.pg_interfaces) # Create bi-directional cross-connects between pg0 and pg1 cls.vapi.sw_interface_set_l2_xconnect( cls.pg0.sw_if_index, cls.pg1.sw_if_index, enable=1) cls.vapi.sw_interface_set_l2_xconnect( cls.pg1.sw_if_index, cls.pg0.sw_if_index, enable=1) # Create bi-directional cross-connects between pg2 and pg3 cls.vapi.sw_interface_set_l2_xconnect( cls.pg2.sw_if_index, cls.pg3.sw_if_index, enable=1) cls.vapi.sw_interface_set_l2_xconnect( cls.pg3.sw_if_index, cls.pg2.sw_if_index, enable=1) # mapping between packet-generator index and lists of test hosts cls.hosts_by_pg_idx = dict() # Create host MAC and IPv4 lists cls.create_host_lists(cls.hosts_nr) # setup all interfaces for i in cls.interfaces: i.admin_up() except Exception: super(TestL2xc, cls).tearDownClass() raise def setUp(self): super(TestL2xc, self).setUp() self.reset_packet_infos() def tearDown(self): """ Show various debug prints after each test. """ super(TestL2xc, self).tearDown() if not self.vpp_dead: self.logger.info(self.vapi.ppcli("show l2patch")) @classmethod def create_host_lists(cls, count): """ Method to create required number of MAC and IPv4 addresses. Create required number of host MAC addresses and distribute them among interfaces. Create host IPv4 address for every host MAC address too. :param count: Number of hosts to create MAC and IPv4 addresses for. """ for pg_if in cls.pg_interfaces: cls.hosts_by_pg_idx[pg_if.sw_if_index] = [] hosts = cls.hosts_by_pg_idx[pg_if.sw_if_index] for j in range(0, count): host = Host( "00:00:00:ff:%02x:%02x" % (pg_if.sw_if_index, j), "172.17.1%02x.%u" % (pg_if.sw_if_index, j)) hosts.append(host) 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][0] 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() 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.interfaces: last_info[i.sw_if_index] = None dst_sw_if_index = pg_if.sw_if_index for packet in capture: try: ip = packet[IP] udp = packet[UDP] payload_info = self.payload_to_info(str(packet[Raw])) 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.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_l2xc_test(self, pkts_per_burst): """ L2XC test """ # Create incoming packet streams for packet-generator interfaces for i in self.interfaces: pkts = self.create_stream(i, self.pg_if_packet_sizes, pkts_per_burst) i.add_stream(pkts) # Enable packet capturing 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_l2xc_sl(self): """ L2XC single-loop test Test scenario: 1. config 2 pairs of 2 interfaces, l2xconnected 2. sending l2 eth packets between 4 interfaces 64B, 512B, 1518B, 9018B (ether_size) burst of 2 packets per interface """ self.run_l2xc_test(self.sl_pkts_per_burst) def test_l2xc_dl(self): """ L2XC dual-loop test Test scenario: 1. config 2 pairs of 2 interfaces, l2xconnected 2. sending l2 eth packets between 4 interfaces 64B, 512B, 1518B, 9018B (ether_size) burst of 257 packets per interface """ self.run_l2xc_test(self.dl_pkts_per_burst) if __name__ == '__main__': unittest.main(testRunner=VppTestRunner)