1497 Commits

Author SHA1 Message Date
Dave Barach
f9d10e7dd5 vppinfra: pool_free_elts() now supports fixed-size pools
Test added to the unittest plugin / test_vlib.py

Type: improvement
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I73445e57918347c102ff6f5e8c9ddb9bd96f1407
(cherry picked from commit 4de5f9be88857197ddf17e3bff66318f78f4b6bb)
2021-06-08 15:24:29 +00:00
Neale Ranns
e027d88521 tests: Fix 'test-wipe'
Type: fix

Error:
vagrant@ ~/vpp (make-test-wipe) $ make test-wipe
make[1]: Entering directory '/home/vagrant/vpp/test'
make[2]: Entering directory '/home/vagrant/vpp/test'
make[2]: *** ext: No such file or directory.  Stop.
make[2]: Leaving directory '/home/vagrant/vpp/test'
make[1]: *** [Makefile:239: wipe] Error 2
make[1]: Leaving directory '/home/vagrant/vpp/test'
make: *** [Makefile:440: test-wipe] Error 2

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I3615a962882d5d56c394aa628e9942fed07cde84
(cherry picked from commit 46cb4c40941e06d726c116975c321603766d24bd)
2021-06-04 13:33:06 +00:00
Dave Wallace
f5d9237c56 svm: fix inadequate atomic load for chunk mgr
- Fixes intermittent LDP cut thru iperf3 test
  failure on AARCH64

Type: fix

Change-Id: Id21a078d642e03d974bacacd1f4d0faa42fb6652
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 5c520919e838bcb645ddd879641d54c620740989)
2021-05-28 16:08:32 +00:00
Neale Ranns
1372178e0e fib: During the mfib lookup set the unicast FIB index in the packet so that a uRPF check on a for-us packet is done in the correct VRF
Type: fix

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Iafa6efea0d96962aa9136dccefc148a961f74476
2021-05-26 10:22:02 +00:00
Damjan Marion
a2d6d352c6 tests: move vapi C/C++ test files into src/
Type: improvement
Change-Id: Iaad004661db1e9076e6c27227878f1612fa7289f
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-05-26 06:32:43 +00:00
Matthew Smith
01930f568a nat: report correct EI per-user session limit
Type: fix

When enabling the endpoint independent NAT44 plugin, user_sessions
determines the maximum number of translations that can be active for
a single inside address. If 0 is passed in, a default value is used
but 0 is still stored in the field that is used to populate reply
messages to nat44_ei_show_running_config,

At the time of enabling the plugin, if user_sessions is 0, update the
field which is used by nat44_ei_show_running_config to contain the
default per-user limit which gets used by the EI nodes.

Change-Id: I6b060d85bcd42d91db879b95a8b07c6844bcd2a5
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2021-05-25 13:12:01 +00:00
Dave Wallace
623b8b0164 tests: skip hoststack iperf3 cut thru test on aarch64
- Temporary fix for intermittent unrelated test failure
  on AARCH64 CI verify/merge jobs.  To be reverted
  when the root cause is fixed.

Type: test

Change-Id: Ie28e5a7b9fa9a20469ac7e91766f4c226e44d244
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2021-05-24 11:36:37 -04:00
Klement Sekera
efd4d70210 bfd: use vnet crypto
Type: improvement

Change-Id: I873a99c1258a97ed5ed195b9756e8302f865e7f0
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2021-05-21 21:06:34 +00:00
Dave Wallace
4ee17d859e tests: add role to VCLAppWorker
- Improve readability of log output with respect
  to worker role

Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I1a5787421b31483fa1a2558951568417dfc111d9
2021-05-21 15:21:01 +00:00
Florin Coras
debb352df9 quic: add extended vcl test
Only works with release binaries.

Type: test

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iede88713e1dbc4d1c6ae62651ff9150f88953f4d
2021-05-21 06:57:03 +00:00
Dave Wallace
ae8d332699 tests: don't buffer worker stdin/stdout
- Required to get VCLAppWorker stdin / stdout data
  into log.txt when a test fails.

Type: test

Change-Id: I4db467986940f701750aec6d842a4d9aee22b4e6
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2021-05-20 18:50:42 +00:00
Florin Coras
fb50bc31bf tls: fix dtls with no workers
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iecc33fda7f28c037289775ffe0525a50f89a2b8c
2021-05-18 18:14:53 +00:00
Klement Sekera
a920af7058 nat: refactor multiple vrf tests
Replace VRF test testing multiple scenarios into more simpler tests to
improve readability and ease of debugging.

Type: refactor
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ibaad5328c73b401f52c5fe513dc0ed68ff3e3374
2021-05-18 10:34:41 +00:00
Dave Wallace
eddd8e3588 tests: move test source to vpp/test
- Generate copyright year and version
  instead of using hard-coded data

Type: refactor

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I6058f5025323b3aa483f5df4a2c4371e27b5914e
2021-05-13 09:33:06 +00:00
Dave Wallace
c44402f7b5 tests: fix another race condition in punt tests
- Don't close the socket and don't stop receiving
  until after draining the existing data in the
  socket.

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I38dfff4d6273eeddb5196f5cf2a60b580e1c93e6
2021-05-08 02:49:06 +00:00
Florin Coras
cec1b2776b vcl: add dtls test
Type: test

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I726ab3a22399e970b0dd37a5b174062137265914
2021-05-06 21:55:41 +00:00
Dave Wallace
f4d338f0b4 tests: fix race condition in punt tests
Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I6cb13e044bbb966cbb61802094e96220d3a0c951
2021-05-06 21:16:08 +00:00
Florin Coras
3ec0165665 vcl: move tests to src/tests
Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If622dfcc6f98d90cac0487e6bb9eb8c0bb01cf85
2021-05-06 19:19:46 +00:00
Arthur de Kerhor
db02380904 stats: adding symlinks for nodes and interfaces in the stat segment
A given interface counter (e.g rx) can be accessed via
/interfaces/<interface_name>/<counter_name>.
Same goes with nodes: /nodes/<node_name>/<counter_name>
As interfaces may contain '/' in their names,
these are replaced by '_' in symlinks
Also added 2 tests for the stat segment

Type: feature

Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Change-Id: I27da252e7b3dc177815616ca46b5c200a456bf0f
Signed-off-by: Ole Troan <ot@cisco.com>
2021-05-04 16:29:29 +00:00
Benoît Ganne
5c481ff732 crypto: fix chained buffer integrity support
Type: fix

Change-Id: I984a3e577a4209e41d046eaf3a8eef8986dc6147
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-04-29 15:48:25 +00:00
Klement Sekera
ea6236b376 tests: add worker count to class description
While running test:

==============================================================================
NAT44ED Test Case
==============================================================================

==>

==============================================================================
NAT44ED Test Case [main thread only]
==============================================================================

==============================================================================
NAT44ED Test Case [1 worker thread]
==============================================================================

==============================================================================
NAT44ED Test Case [4 worker threads]
==============================================================================

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I61904b411ff1b58700564698079dc4c07cea5c5e
2021-04-28 18:35:46 +00:00
Damjan Marion
137869dbfb vapi: silence warnings
Type: fix
Change-Id: I91d7bfbfaafc7b780f91dec7c9e5ce07241e6394
Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-04-26 23:26:03 +02:00
Paul Vinciguerra
dc22c839f0 tests: clean up gbp calls from vpp_papi_provider
Move info from vpp_papi_provider to .api/vpp_objects

Change-Id: Iaf46483fda2840dfec8d37e0b9262e1c9912be59
Type: test
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2021-04-26 06:05:52 +00:00
Benoît Ganne
5cfe45211a misc: add filter for specific error for pcap trace
Type: feature

Change-Id: I325257454df1cc22833fa6a1dedd4739d4d5a558
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-04-22 11:12:59 +00:00
Benoît Ganne
30a819579c classify: honor pcap interface filter also when classify filter is used
Type: fix

Change-Id: Ic32550ee9c5d76d232d8b67a7810611f6c8b9177
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-04-17 11:55:33 +00:00
Klement Sekera
558ceabc6c tests: cpus awareness
Introduce MAX_CPUS parameters to control maximum number of CPUs used by
VPP(s) during testing, with default value 'auto' corresponding to all
CPUs available.

Calculate test CPU requirements by taking into account the number of
workers, so a test requires 1 (main thread) + # of worker CPUs.

When running tests, keep track of both running test jobs (controlled by
TEST_JOBS parameter) and free CPUs. This then causes two limits in the
system - to not exceed number of jobs in parallel but also to not exceed
number of CPUs available.

Skip tests which require more CPUs than are available in system (or more
than MAX_CPUS) and print a warning message.

Type: improvement
Change-Id: Ib8fda54e4c6a36179d64160bb87fbd3a0011762d
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-04-16 09:26:33 +00:00
Klement Sekera
e263685ac8 tests: support attaching to existing vpp
Introduce a new option DEBUG=attach to run a test against existing
already running vpp. A new target 'make test-start-gdb' will spawn VPP
in gdb for this purpose. Customization options explained in test-help.

Type: improvement
Change-Id: Ia160a85b33da3b2df292d44bb95729af9dd9da96
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-04-12 10:11:36 +00:00
Klement Sekera
3ff6ffce03 tests: improve naming
Change capture to pcap to remove confusion in framework.py

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Idf8bd61f174b8b2df3bbd13908e54d597da4a83b
2021-04-09 21:12:46 +00:00
Neale Ranns
e2b6736e1f ip6-nd: Solicitation reply only if target is our link-local
Type: fix

The fib source IP6_ND is used for all link-local entries, hence
solicitation responses were sent for a peer's address. Constrain the
source check to also in clude the LOCAL flag, which indicates that the
link-local address is ours.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Iba7e66049e4d89ee3f36d77aeb09310b978d70de
2021-04-05 00:56:47 +00:00
Klement Sekera
7ba9fae554 tests: support injecting multiple worker pcaps on one PG
This change allows one to inject multiple streams for different workers
on the same PG interface at the same time.

Type: improvement
Change-Id: I29d80369aabada261eda466e5a5d8d3518bb8bc8
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-04-01 15:29:42 +00:00
Klement Sekera
7554aef84a tests: call venv module directly
This avoids

ModuleNotFoundError: No module named 'virtualenv.seed.embed.via_app_data'

https://github.com/pypa/virtualenv/issues/1873

Type: fix
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I860cc8c4ad2ba509815c5e7cf02fa5e01ee2ed63
2021-03-31 11:43:54 +00:00
Dave Wallace
d4a907bdd2 tests: move vxlan tests to src/vnet/vxlan/tests
- Refactor make test code to be co-located with
  the vpp feature source code

Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I66379dfe671628e39dfc9685c4fd70fa0e566f6f
2021-03-29 05:24:25 +00:00
Dave Wallace
83f13e45bc tests: move ping tests to src/plugin/ping/test
- Refactor make test code to be co-located with
  the vpp plugin source code

Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I09d55301665449b3f183191537749435f806fb15
2021-03-26 10:14:30 +00:00
Dave Wallace
7df43dc2ce tests: move vppinfra tests to src/vppinfra/test
- Refactor make test code to be co-located with
  the vpp feature source code

Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Iceaeab769c08e541b31546663d0e402ced862e5b
2021-03-25 14:44:37 +00:00
Klement Sekera
e0b63b2978 tests: introduce test-checkstyle-diff
Make test-checkstyle-diff is a new target which checks PEP8 compliance
only for changed files. This makes it faster to execute and also more
readable as most of the time, only changed files will fail.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I71baca76ab3a21a7a3790617cbfb0d48aacbd9ec
2021-03-25 09:22:52 +00:00
Ole Troan
e66443c9b4 stats: python vpp_stats rewrite to access stat segment directly
This module implement Python access to the VPP statistics segment. It
accesses the data structures directly in shared memory.
VPP uses optimistic locking, so data structures may change underneath
us while we are reading. Data is copied out and it's important to
spend as little time as possible "holding the lock".

Counters are stored in VPP as a two dimensional array.
Index by thread and index (typically sw_if_index).
Simple counters count only packets, Combined counters count packets
and octets.

Counters can be accessed in either dimension.
stat['/if/rx'] - returns 2D lists
stat['/if/rx'][0] - returns counters for all interfaces for thread 0
stat['/if/rx'][0][1] - returns counter for interface 1 on thread 0
stat['/if/rx'][0][1]['packets'] - returns the packet counter
                                  for interface 1 on thread 0
stat['/if/rx'][:, 1] - returns the counters for interface 1 on all threads
stat['/if/rx'][:, 1].packets() - returns the packet counters for
                                 interface 1 on all threads
stat['/if/rx'][:, 1].sum_packets() - returns the sum of packet counters for
                                     interface 1 on all threads
stat['/if/rx-miss'][:, 1].sum() - returns the sum of packet counters for
                                  interface 1 on all threads for simple counters

Type: refactor
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I1fe7f7c7d11378d06be8276db5e1900ecdb8f515
Signed-off-by: Ole Troan <ot@cisco.com>
2021-03-25 08:37:46 +00:00
Dave Wallace
fd243741e0 tests: add vpp test dirs to PYTHONPATH
- Required to relocate test infra modules
  to be co-located in feature test directory.
- Remove/regenerate build-root/build-test/src/
  soft links when running make test to allow
  re-running 'make test' after moving source files.
- Suppress annoying 'ls' error message when gathering
  test source files caused by 'c' test application
  directory being named 'test'.
- Use PYTHONPYCACHEPREFIX to generate all
  compiled source under build-root/build-test.
  This only works for python 3.8 or greater, but
  existing 'make test-wipe' target cleans up
  in-situ __pycache__ directories for older
  python versions.

Type: fix

Change-Id: If3c3ff0c58fb26a17395babc34783e06b1dd84e7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2021-03-24 20:50:59 +00:00
Klement Sekera
8d8150262b tests: add support for worker awareness
VppTestCase now has vpp_worker_count property set to number of workers.
This can be overriden by child classes. Also overriden by
VPP_WORKER_CONFIG variable for legacy reasons.

Type: improvement
Change-Id: Ic328bacb9003ddf9e92815767653bd362aa7f086
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-03-20 01:14:20 +00:00
Klement Sekera
aa7a2a1f32 tests: remove shm files created by vpp on reset
Even though we don't use shm transport anymore, vpp still populates shm.
Add cleanup before running tests to avoid the nuisance of running out of
space on /dev/shm.

Type: fix
Fixes: eb506becd038f081bc7ac340412d3685425bb8b4
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I2ef87e991223ee60892d56af1482025d91e77d46
2021-03-18 15:26:21 +01:00
Klement Sekera
eb506becd0 tests: remove shm handling
Not used anymore with socket transport.

Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I7061048dee21ce02637e34f73fb9984bd241f7df
2021-03-17 11:40:16 +00:00
Neale Ranns
976b259be2 fib: Allow the creation of new source on the API
Type: feature

an client can dump the existing sources, examine their
priorities, then define thier own source.
Usefull if a client wants to distingusih between say, static,
ospf, bgp, etc routes it has added over the API.

Signed-off-by: Neale Ranns <nranns@cisco.com>
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Change-Id: I5158b4fa1ebe87381ff8707bb173217f56ea274a
2021-03-16 12:12:23 +00:00
Ole Troan
4376ab2a92 tests: use socket transport instead of shared memory
Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I9e65c94a5a05047a5104e9361ea36eac77b40442
Signed-off-by: Ole Troan <ot@cisco.com>
2021-03-15 17:23:53 +00:00
Klement Sekera
79a31db11d tests: fix NoneType printing if VPP died early
Make error message more meaningful.
Type: fix

Change-Id: I3c49cb179c3ee7a59657b3ae9a06311f57dc52ac
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2021-03-15 12:42:29 +00:00
Andrew Yourtchenko
3efd4e9998 tests: improve the robustness of process cleanup on INT/TERM signals
Change-Id: I3049d3d7d1212236dcc63ebf5560f87561928520
Type: improvement
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2021-03-05 10:57:26 +00:00
Neale Ranns
f16e9a5507 ipsec: Support async mode per-SA
Type: feature

This feautre only applies to ESP not AH SAs.
As well as the gobal switch for ayncs mode, allow individual SAs to be
async.
If global async is on, all SAs are async. If global async mode is off,
then if then an SA can be individually set to async. This preserves the
global switch behaviour.

the stratergy in the esp encrypt.decrypt nodes is to separate the frame
into, 1) sync buffers, 2) async buffers and 3) no-op buffers.
Sync buffer will undergo a cyrpto/ath operation, no-op will not, they
are dropped or handed-off.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ifc15b10b870b19413ad030ce7f92ed56275d6791
2021-03-05 10:34:55 +00:00
Neale Ranns
fc81134a26 ipsec: Submit fuller async frames
Type: improvement

In the current scheme an async frame is submitted each time the crypto
op changes. thus happens each time a different SA is used and thus
potentially many times per-node. thi can lead to the submision of many
partially filled frames.

change the scheme to construct as many full frames as possible in the
node and submit them all at the end. the frame owner ship is passed to
the user so that there can be more than one open frame per-op at any
given time.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ic2305581d7b5aa26133f52115e0cd28ba956ed55
2021-03-05 10:34:55 +00:00
Florin Coras
1334761e1e hsa: fix builtin echo apps with multiple workers
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9507b5a9755e938b4d1da657bed3a8681a056427
2021-03-04 10:59:11 +00:00
Benoît Ganne
8c45e51095 classify: fix multiple filters support
This fix the classify filter if we attach several different filters.
This also fix some issues with l3 and l4 parsing.

Type: fix

Change-Id: I9dc6c55049a3bbc0110d1097b40d9da27633626b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-03-02 10:38:24 +00:00
Neale Ranns
8c609af230 tests: Add tests for IPSec async mode using the crypto SW scheduler
Type: test

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Iabc8f2b09ee10a82aacebd36acfe8648cf69b7d7
2021-02-25 16:12:48 +00:00
Brian Russell
7a29a2d400 ipsec: enable input features on tunnels
Make the ipsec[46]-tun-input nodes siblings of device-input so that
input features can be enabled on them. Register ipsec-tun for feature
updates. When a feature is enabled on the device-input arc and the
ifindex is an IPSec tunnel, change the end node of the arc for that
ifindex to be the appropriate ESP decrypt node. Set a flag on the
tunnel to indicate that the feature arc should be started for packets
input on the tunnel.

Test input policing on ESP IPSec tunnels.

Type: improvement
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: I3b9f047e5e737f3ea4c58fc82cd3c15700b6f9f7
2021-02-25 09:13:28 +00:00