92 Commits

Author SHA1 Message Date
Dave Wallace
afb4d3ae90 docs: fix vpp-make-test-docs-merge-1908 doc upload
Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I77929b7067b11015e66ee3e24f63a377b1f788e2
2020-08-12 15:28:35 +00:00
Aloys Augustin
193c9e36a4 tests: fix deps pinning / patching
This ensures we don't recompute the requirements-{2,3}.txt on each make
test run, and skips patching scapy if it is already patched instead of
failing.

Change-Id: I3da57182ae49f3dd04db139d96734a5d145fedff
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
(cherry picked from commit 8eca60df745b7656b96db16e75b0deda66bfc515)
2020-08-07 20:49:18 +00:00
Andrew Yourtchenko
d212187f02 docs: pin down sphinx to avoid crash with Sphinx 3.0.0
Using requirements.txt did not work, just specify the version
in the pip install within the makefile.

For the master and stable/2001,
see change Id98c0f94104e455ea819aacec62f605e53db13ce

Change-Id: I1f6ff53d8d52dc8bad42041932421fc12d7ddebf
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-04-07 10:19:51 +00:00
Klement Sekera
fc000f0e1d tests: support setting random seed
Log the random seed used when running tests and provide means to re-use
it in a later run.

Type: feature

Change-Id: I18d2a36ee802b901d4cca5577df41cec07f09cc0
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 45a95dd782b91e9ae5665b5f95be4b6d7f99b879)
2019-11-18 13:17:57 +00:00
Dave Wallace
442870c03a tests: DEBUG=gdb[server]-all to debug worker(s)
Type: test

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I0264451632c1ce780b38a2c15a7e34350fc6d521
(cherry picked from commit 2456433df46ae99dfbcec6260d14e592b5823c83)
2019-11-15 07:12:43 +00:00
Dave Wallace
0d2f654a03 build: clean up make help output
This change is designed to help the uninformed find the right way
to run extended tests by using the test-all[-debug] targets.
'make test EXTENDED_TESTS=y' fails to build as it has a dependency
on 'vom-install' which is conveniently included in test-all[-debug].

- clarify test-all[-debug] description and
  make test-help description
- Also align indentation of make help output

Type: style

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Ief54cc8a5af68c052aacb0d660237c5eb63451b5
(cherry picked from commit 2777ec761514fc0838ad11e6232ad97897663356)
2019-10-27 10:00:29 +00:00
Klement Sekera
b0888636de tests: run vapi tests by default
Type: fix

Change-Id: I7b190507446fca745fc4bc6abbdeed48f55abdb9
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-09-30 12:13:04 +00:00
Dave Wallace
4c737a7e54 tests: fix test-checkstyle to check plugin tests
Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I93eb0ae4338247fa2479f8e419483d1593436dc7
2019-09-21 13:47:32 +00:00
Dave Wallace
9e25c7723d tests: move plugin tests to src/plugins/*/test
- Relocate plugin tests for 'make test' into
  src/plugins/*/test so that plugin test cases
  are co-located with the plugin source code.

Type: refactor
Ticket: VPP-1754

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I503e6a43528e14981799b735fa65674155713f67
(cherry picked from commit a43c93f8554ad7418e31be3791b3fb71232f60ac)
2019-08-23 17:31:08 -04:00
Paul Vinciguerra
2648e4474e build: add option to wipe/rebuild papi
Previously, the only option was to wipe/rebuild all the test dependencies.

Type: make

Change-Id: Ia95d6e800f67bef033dcf614dbfa249c3e43159d
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-07-28 14:21:05 +00:00
Aloys Augustin
8adb92be29 tests: pin pip version
New pip releases can break pip-tools. This commit pins the version of
pip used in the test virtualenv to prevent uncontrolled breakage.

This fixes the current issue in make test:
TypeError: __init__() got an unexpected keyword argument 'index_urls'

Change-Id: I3b7ecb31e651401ada0d357e2bf093c91c934565
Type: feature
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2019-07-23 15:24:43 +02:00
Aloys Augustin
28fa8cbc6c tests: pin python dependencies
This commit ensures that the tests always run with the exact same
version for all the Python dependencies. It uses pip-tools to achieve
that.

Our top-level dependencies are specified in the requirements.txt file.
From this file, pip-tools generates the requirements-{2,3}.txt file,
which pins all the versions of all the recursive dependencies, and is
used to install the packages in the test virtualenv.

To change or add a top-level dependency, update requirements.txt and run
make test as usual with python2 and python3. The requirements-{2,3}.txt
file will be updated and you can verify that nothing breaks. Then add
all requirements* files in your commit.

To refresh the python packages (i.e. get new versions of the recursive
dependencies, or of the dependencies that are not pinned in
requirements.txt), just run:
PYTHON=python2.7 make test-refresh-deps
PYTHON=python3.6 make test-refresh-deps
and this will update the requirements-{2,3}.txt files. Ideally we
should run this after each release.

Type: make
Change-Id: Ic533de3d06ec4019ff38f5231208da6f1025bfc7
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2019-06-27 21:22:26 +00:00
Dave Barach
7d31ab2a5c add mactime plugin unit / code coverage tests
The unit and code coverage tests are boring. The rest of the patch
involves test and packet-generator infra cleanups.

Teach the "make test-xxx" family of targets to set the api test plugin
path correctly, to make "binary-api <api-message-name> <args>" debug
CLI commands work correctly in the "make test"
environment. Unfortunately involves both the top-level and test
Makefiles.

Add a minor pg cli feature, a CLI to manually set
s->sw_if_index[VLIB_TX].

Consider the case where one configures an interface with both a
device-input and an output feature. To test the output feature using
the pg, it's necessary to inject packets into the interface output
node with both b->sw_if_index[VLIB_TX] and b->sw_if_index[VLIB_RX] set
correctly. For example:

packet-generator new {
 name tx
 limit 15
 size 128-128
 interface local0  # rx: device input feature not configured on local0
 tx-interface loop0 # tx: output node requires b->sw_if_index[VLIB_TX]
 node loop0-output
 data {
   hex 0x01005e7ffffa000dead0000008000102030405060708090a0b0c0d0e0f0102030405
   }
}

Fix a longstanding bug in the packet generator stream setup.  Remove
kludges which set b->sw_if_index[VLIB_TX] to ~0 [in multiple places]
instead of using the stream value s->sw_if_index[VLIB_TX], and setting
THAT datum correctly.

Change-Id: I1097a18e8db73661ded6b822c1d718f7e5cf36ed
Signed-off-by: Dave Barach <dave@barachs.net>
2019-05-09 20:08:58 +00:00
Klement Sekera
f40ee3a206 make test: introduce COREDUMP_COMPRESS option
setting COREDUMP_COMPRESS=y (or =1) indicates that any core file
is to be compressed by the test framework unless DEBUG=core is set.

Change-Id: Ib0d6d30a7398dbeb6ab5e5dbb411bf5c641b5206
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-05-08 22:14:44 +00:00
Ole Troan
4ff09ae348 API: Python and Unix domain socket improvement
Handle the case where buffer overflows.
Then SOCK_SEQPACKET assumption that multiple API messages
are not returned by recv() is broken. Use SOCK_STREAM for
API exchanges instead.

Add support for running tests over sockets.
make test SOCKET=1

Change-Id: Ibe5fd69b1bf617de4c7ba6cce0a7c2b3f97a2821
Signed-off-by: Ole Troan <ot@cisco.com>
2019-04-23 18:49:22 +00:00
Neale Ranns
2e2c91f925 Revert "tests: Deprecate the use of CLI commands in tests."
This reverts commit e2e8f02165f27ae04e6d20ce0c628e29271a8db6.

Change-Id: Ie23dcb8a5b3e96f77e0d117a6887c43064c79669
Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-19 17:56:54 +00:00
Paul Vinciguerra
e2e8f02165 tests: Deprecate the use of CLI commands in tests.
Since the stated policy regarding CLI commands is:
  "Note that the debug CLI is a developer's tool
   - no warranty express or implied - and that
   we may choose not to fix debug CLI bugs.",

this change emits a deprecation warning whenever a test case calls a CLI command.

Change-Id: I91b30e86ae1b2fca36732837f36cdda762cdf458
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-18 14:06:12 +00:00
Paul Vinciguerra
d73dbd2d3a make test: Stop downloading pip.
Use the installed version of pip.  If a newer version of pip is needed,
it can be specified in requirements.txt.  This is to improve idempotence
by providing some control over upstream changes.

Change-Id: I07b7651f8ddba6005bf85d11fef9e3343ee2dcd2
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-02-26 11:06:03 +00:00
Klement Sekera
593635d4fa make test: make test-ext working again
Change-Id: Ib30d0c6b8794488119f258f7617fce494aa28f1f
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-02-14 17:23:21 +00:00
Paul Vinciguerra
64abeecadd VTL: Makefile: Don't install pip twice.
Pip is installed via virtualenv. No need to reinstall it again.

Change-Id: I45bea1f9db841ca4309b763ab852623180937727
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-01-31 19:24:42 +00:00
Paul Vinciguerra
8467919e4e VTL: Fix sphinx doc generation.
Remove unnecessary envvar magic for sphinx builds.
Just provide the proper mock objects.

Change-Id: I151513eb47d2f71cf221651145dbcdc153448772
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-01-18 19:14:30 +00:00
Paul Vinciguerra
4fbc41af4e VTL: Move doc generation and linting to python3.
* running linting/pycodestyle under python3 provides the additional benefit
  of access to the python3 AST.

Change-Id: I659dbd2733471285867be95eec078f7415aa0bcd
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-01-17 17:28:04 +00:00
Paul Vinciguerra
3c6f1045e2 VPP-1508: Python3: Support simultaneous p2/p3 venvs.
Change-Id: I24cf3e390f6f0b98be939ef717048742d3f183d6
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-01-05 10:33:33 +00:00
Paul Vinciguerra
65eb77231c VPP-1508: Have test/Makefile honor PYTHON= envvar.
Change-Id: Iff71a5982b73c97e3f546beb1cf52935a267f5f5
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-12-18 20:33:14 +00:00
juraj.linkes
68ebc83e60 Skip failing ARM testcases for CI
There are a few tests that fail on ARM and thus we can't enable testing
in CI. Skip the failing tests until they're fixed so that we catch new
failures in CI (when we enable testing for the remaining tests).

Change-Id: Ie896ef5c449ef965029633e38d317a8d5ac26352
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-12-06 20:58:35 +00:00
Klement Sekera
b8c72a4a8d make test: create virtualenv under /test/
instead of using build-root, use /test/venv directory for virtualenv
similarly, don't pollute build-root with test-built binaries

Change-Id: I1e63c04037eaee718b27b34ef16c9eb0252afa53
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-11-29 08:22:10 +00:00
Paul Vinciguerra
ab9e20b731 VPP-1508 Add support for environment markers.
Add the ability to specify a specific python library version
based on the interpreter/platform/etc.

Change-Id: I027acdf22ad839b5cff63b319f0aa100b0f336c8
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-26 09:30:46 +00:00
Paul Vinciguerra
4a144b49f6 VPP-1505 VPP-1508 Remove dep.: py_lispnetworking
test_lisp.py No longer needs the external dependency to run.

py27 runtests: commands[6] | stestr --test-path ./test run --slowest test_lisp
==============================================================================
Basic LISP test
==============================================================================
{0} test.test_lisp.TestLisp.test_lisp_basic_encap [0.487960s] ... ok

======
Totals
======
Ran: 1 tests in 18.0000 sec.
 - Passed: 1
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 0
Sum of execute time for each test: 0.4880 sec.

==============
Worker Balance
==============
 - Worker 0 (1 tests) => 0:00:00.487960
Test id                                        Runtime (s)
---------------------------------------------  -----------
test.test_lisp.TestLisp.test_lisp_basic_encap  0.488
______________________________________________________ summary ______________________________________________________
  py27: commands succeeded
  congratulations :)
vagrant@vpp:/vpp$

Change-Id: I35b35f8ddaed79066b3ed62fa0460c9ea83273c2
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-24 19:59:30 -08:00
Klement Sekera
e61ad8d6c4 make test: remove test-ext, fix test*-all targets
build extended binaries, vom & friends when test*-all targets are run,
remove unneeded test-ext target (which is semantically same as
test-debug-all)

Change-Id: Id710e061fdc93e286a4ed91be6a0cdcf75a2dafd
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-11-23 15:36:15 +00:00
Matus Fabian
b4515b4be4 Add RFC5424 syslog protocol support (VPP-1139)
Syslog protocol logging transport event messages across network over UDP
protocol based on RFC5426.

Change-Id: Ica74b40bcc2e6d0fbd41e9bf78e76395fbabab3c
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-11-22 06:31:53 +00:00
juraj.linkes
184870ac5a CSIT-1139: Implement parallel test execution
The implementation of parallel test execution in VPP Test Framework.
- VPPTestCase test methods are grouped together
- tests are running in separate processes
- VPP instances spawned by tests are assigned to different cores
- output from these processes is redirected through pipes and printed
out testcase by testcase
- TEST_JOBS env var is used to specify the number of parallel processes
- improved test summary
- a bit of code cleanup

Change-Id: I9ca93904d9fe2c3daf980500c64a8611838ae28c
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-08-23 14:19:35 +00:00
juraj.linkes
a60c3ed14b Add psutil to testing virtualenv
Change-Id: I650c9f226bcdc6328a7b4ff2dc4bd20cea8a512a
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-08-17 16:16:59 +00:00
Neale Ranns
b7d41fc18e make test-ext: a new test target that builds VOM (existing one no longer do)
Change-Id: If590e90b2a1c3b884863ec15a92ea4353ac9eb7c
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-22 21:16:55 +00:00
Klement Sekera
01551581d7 make test: fix profiling
Change-Id: Iad45ca8c167a017029b20ddd0a0b59087fa69498
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-06-28 13:50:39 +00:00
Klement Sekera
bbfa5fdf52 make test: easy profiling via make test PROFILE=1
Change-Id: Ib845578485f523b7f14e98c83d05f78db382ecde
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-06-27 13:37:32 +00:00
Neale Ranns
5b4a020144 Scapy; update to release 2.4.0
Change-Id: Ibcae49ab106efa9cd0ff60be60904ac5a2fc0b65
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-05-02 08:45:56 +00:00
Chris Luke
d042194b4b test: Fix issues with new version of pycodestyle (VPP-1232)
- Ignore warnings W504 (newline after binary operator) which otherwise
  occurs a significant number of times.
- Fix two instances of lines >79 chars.

Change-Id: I8cef56f8afc237187995e638e610c8c0554e2bb5
Signed-off-by: Chris Luke <chrisy@flirble.org>
2018-04-10 19:21:59 +00:00
Ed Kern
56ccc23fbc Makefile: Alter VPP_PYTHON_PREFIX for preloading deps
Allow setting of VPP_PYTHON_PREFIX to alternate location
so the python prereqs can be installed into base image
Also added test-dep trigger to isolate dependency install
from actual test run

Change-Id: Ia80f5dbf71bc24eb46cd6586bcadd474ef822704
Signed-off-by: Ed Kern <ejk@cisco.com>
2018-04-03 19:58:00 +00:00
Klement Sekera
3d6edf5a96 make test: use vpp-dev repo for py-lispnetworking
Change-Id: Ia87d55cad1d466a4cc624f06abbc322cddb5608c
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-24 15:20:11 +00:00
Neale Ranns
2bc940272e Scapy upgrade to 2.4.0.rc5
- many of the patches fd.io applies in test/patches/2.3.3 are now upstreamed in 2.4
- 2.4 adds support for IGMPv3 which is my main motivation for the upgrade

Change-Id: If2c0a524e3cba320b4a5d8cd07817c6ea2bf0c5a
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-03-19 13:09:45 +00:00
Ole Troan
46c1c11ba0 IPIP: Linter on test_*.py
Change-Id: Icd491e382a2da0e5d55a673458605bc37e39b669
Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-15 14:59:08 +00:00
Damjan Marion
7139e757b1 test: disable reassembly tests and system modification script
One of basic requirements from day one for maek test is that it should
run unpriviledged, so modifying system paremeters is unacceptable.

Disabling script and reassembly tests as they need to be done in
different way.

Change-Id: I063c73eb82f2ebd7499e8adb1574a9fd2475fb5b
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-03-07 12:00:59 +00:00
Dave Wallace
05e4f9b377 make test: add "EXTENDED_TESTS" to help output.
Change-Id: I89540e93f3c8839bf6fc4363f4736e9c01d91927
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-03-02 19:22:10 +00:00
Ole Troan
6ee4051139 6RD: Rewritten 6RD RFC5969 support.
Change-Id: Ic30fbcb2630f39e45345d7215babf5d7ed4b33a0
Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-01 14:37:11 +00:00
Marco Varlese
767fcb6742 Python: addressing PEP8 deprecation
PEP8 has been deprecated and python users are being asked to migrate to
pycodestyle.

Change-Id: I52d5f7b2bf72156216a9966e8322ec58763f24d4
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-26 12:05:10 +00:00
Klement Sekera
cae7134a8c make test: build test/ext when doing coverage
This makes VAPI/VOM tests part of code coverage report.

Change-Id: I66511b0a59880c2a64daecd37088268bdf5e1269
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-22 17:55:39 +00:00
Klement Sekera
ebbaf55e09 make test: add test framework debugging
New option TEST_DEBUG=1 turns on test framework debugging, which
currently consists of printing difference in allocated objects/memory
and also creates reference graphs for any unfreed VppPapiProvider/VPP
objects - these take a lot of memory and thus should be freed regularly.

Change-Id: I29db0c1341009d4b5c5df9222d14f3095883fd0f
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-17 20:42:49 +00:00
Neale Ranns
f051072f85 BIER: fix support for longer bit-string lengths
Change-Id: I2421197b76be58099e5f8ed5554410adff202109
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-06 12:44:08 +00:00
Klement Sekera
75e7d13014 IPv4/6 reassembly
Change-Id: Ic5dcadd13c88b8a5e7896dab82404509c081614a
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-02-01 23:41:17 +00:00
Klement Sekera
da38715fa9 make test: verify that /dev/shm is big enough
Verify that /dev/shm size is >= 512M, which should be enough for `make
test' needs. If the verification fails, try to enlarge it automatically.
This helps avoid docker vpp/make test crashes (seen as SIGBUS).

Change-Id: I4e23d59ff8bf8befc320fa229fb6c9bfeb809a8f
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-01-25 03:30:17 +00:00