29 Commits

Author SHA1 Message Date
Dave Wallace
8800f732f8 tests: refactor asf framework code
- Make framework.py classes a subset of asfframework.py classes
- Remove all packet related code from asfframework.py
- Add test class and test case set up debug output to log
- Repatriate packet tests from asf to test directory
- Remove non-packet related code from framework.py and
  inherit them from asfframework.py classes
- Clean up unused import variables
- Re-enable BFD tests on Ubuntu 22.04 and fix
  intermittent test failures in echo_looped_back
  testcases (where # control packets verified but
  not guaranteed to be received during test)
- Re-enable Wireguard tests on Ubuntu 22.04 and fix
  intermittent test failures in handshake ratelimiting
  testcases and event testcase
- Run Wiregard testcase suites solo
- Improve debug output in log.txt
- Increase VCL/LDP post sleep timeout to allow iperf server
  to finish cleanly.
- Fix pcap history files to be sorted by suite and testcase
  and ensure order/timestamp is correct based on creation
  in the testcase.
- Decode pcap files for each suite and testcase for all
  errors or if configured via comandline option / env var
- Improve vpp corefile detection to allow complete corefile
  generation
- Disable vm vpp interfaces testcases on debian11
- Clean up failed unittest dir when retrying failed testcases
  and unify testname directory and failed linknames into
  framwork functions

Type: test

Change-Id: I0764f79ea5bb639d278bf635ed2408d4d5220e1e
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2023-11-03 05:06:43 +00:00
Andrew Yourtchenko
bc37878ecb build: add ability to disable some plugins from packaging and tests
When custom-packaging the VPP artifacts, it can be useful to exclude
some of the core plugins from packaging/testing, for some reasons.
A removal of a plugin(s) from the worktree needs to be tracked as
a separate change, and thus is tricky from the maintenance
point of view.

This change adds the ability to "pretend they do not exist" -
plugins which are added to the comma-separated environment
variable "VPP_EXCLUDED_PLUGINS" will not be added to the build
process and not packaged.

The tests do not have the 1:1 relationship as plugins,
so they might need to be modified separately. This change
includes some of these modifications as an example.

Type: feature
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Id31562d00a01ced1acbb4996a633517cbd6f09d8
2023-10-03 13:23:25 +00:00
Klement Sekera
d9b0c6fbf7 tests: replace pycodestyle with black
Drop pycodestyle for code style checking in favor of black. Black is
much faster, stable PEP8 compliant code style checker offering also
automatic formatting. It aims to be very stable and produce smallest
diffs. It's used by many small and big projects.

Running checkstyle with black takes a few seconds with a terse output.
Thus, test-checkstyle-diff is no longer necessary.

Expand scope of checkstyle to all python files in the repo, replacing
test-checkstyle with checkstyle-python.

Also, fixstyle-python is now available for automatic style formatting.

Note: python virtualenv has been consolidated in test/Makefile,
test/requirements*.txt which will eventually be moved to a central
location.  This is required to simply the automated generation of
docker executor images in the CI.

Type: improvement
Change-Id: I022a326603485f58585e879ac0f697fceefbc9c8
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-05-10 18:52:08 +00:00
Klement Sekera
b23ffd7ef2 tests: make tests less make dependent
Implement command line argument parsing instead of passing arguments via
environment variables. Add script for running tests without having to
invoke make. Deprecate running tests via make.

Type: improvement
Change-Id: I2e3054a61a2ae25d460e9be00be7d7705fbf943e
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-02-17 18:02:35 +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
a43c93f855 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

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I503e6a43528e14981799b735fa65674155713f67
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2019-08-22 15:33:59 +00:00
Paul Vinciguerra
499ea648e2 tests: framework gracefully handle 'VppTransportShmemIOError'
Catches:
----
Traceback (most recent call last):
  File "/vpp/test/framework.py", line 593, in tearDown
    self.logger.info(self.vapi.ppcli("api trace save %s" % api_trace))
  File "/vpp/test/vpp_papi_provider.py", line 413, in ppcli
    return cli + "\n" + str(self.cli(cli))
  File "/vpp/test/vpp_papi_provider.py", line 402, in cli
    r = self.papi.cli_inband(cmd=cli)
  File "/vpp/src/vpp-api/python/vpp_papi/vpp_papi.py", line 100, in __call__
    return self._func(**kwargs)
  File "/vpp/src/vpp-api/python/vpp_papi/vpp_papi.py", line 414, in f
    return self._call_vpp(i, msg, multipart, **kwargs)
  File "/vpp/src/vpp-api/python/vpp_papi/vpp_papi.py", line 634, in _call_vpp
    msg = self.transport.read()
  File "/vpp/src/vpp-api/python/vpp_papi/vpp_transport_shmem.py", line 120, in read
    raise VppTransportShmemIOError(rv, 'vac_read failed')
VppTransportShmemIOError: [Errno -1] vac_read failed
----

Change-Id: I767e48c4d03081eb5df6a8aa67da7e192d25e4cc
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-06-07 09:48:05 +00:00
Paul Vinciguerra
90cf21b5d8 Tests: Refactor tearDown show command logging, add lifecycle markers.
This change adds a consistent interface for adding test-specific show commands to
log.txt.

It also adds log markers for the execution of setUp[Class], tearDown[Class]
in the logs.

Change-Id: I7d42e396e594a59e866a7d55dac0af25548e657a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-04-11 07:23:11 +00:00
Paul Vinciguerra
7f9b7f9f49 Tests Cleanup: Fix missing calls to setUpClass/tearDownClass.
Continuation/Part 2 of https://gerrit.fd.io/r/#/c/17092/

Change-Id: Id0122d84eaf2c05d29e5be63a594d5e528ee7c9a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-04-10 14:37:40 +00:00
Paul Vinciguerra
95c0ca42f2 tests: test/vpp_l2.py fix missing name.
test/vpp_l2.py:213:26: F821 undefined name 'L2_VTR_OP'
        self.itf.set_vtr(L2_VTR_OP.L2_DISABLED)

Move L2_VTR_OP enum to vpp_sub_interface.py where the VTR code is found.

Change-Id: I9eb9a3a2c679813c221ce1d0c4fa8aac6076c443
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-29 19:33:33 +00:00
Ole Troan
a5b2eec053 vpp_papi_provider: Remove more wrapper functions.
Split this work up into pieces.
Please don't add new wrappers to vpp_papi_provider.py.

Change-Id: I0f8f2afc4cd2bba07ea70ddecea2d7319f7b2e10
Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-11 21:57:19 +00:00
Paul Vinciguerra
a7427ec6f8 VPP-1508: Use scapy.compat to manage packet level library differences.
Change-Id: Icdf6abc9e53d33b26fd1d531c7dda6be0bb9cb55
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-11 08:11:16 +00:00
Paul Vinciguerra
ea2450fa2d VPP-1508: Python3 tests. Explicitly specify string formatting.
.format() doesn't understand what to do with binary values by default.
Specify that we expect coersion to string.

Change-Id: Ic4b697f70852124dc85ab231f76b7934d0d71f4d
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-07 22:29:00 +00:00
Paul Vinciguerra
a279d9cf61 Tests: Remove all wildcard imports.
They mask dependencies and confuse third party tools.

Change-Id: I24ee16bfa0d746a8e8cb99891ba8b20523048b69
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-01 09:28:09 +00:00
Paul Vinciguerra
661f91fe0a VPP-1508: Python3 compatible print
Change-Id: I7d2597f2a9589f2463e213da6ca67b1b7593095e
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-12-05 12:08:46 +00:00
Paul Vinciguerra
6e4c6ad92e VPP-1508 python3 tests: .encode('hex')
Change to binascii.hexlify() for consistent bahavior.

Change-Id: Ie430cdd1ffeb6510db4aa037546e42d85992093b
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-27 09:01:27 +00:00
juraj.linkes
8e26f6dbcf Test typo fixes
Renamed one acl testcase class which was copy-pasted and fixed one
inheritance issue.

Renamed one bihash testcase class.

Change-Id: I70d911ee7872d8d9ddba96c7f721dd099f0152f7
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2018-09-27 12:08:02 +00:00
Neale Ranns
b474380f82 L2 BD: introduce a BD interface on which to send UU packets
Change-Id: I21ad6b04c19c8735d057174b1f260a59f2812241
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-25 16:29:19 +00:00
Klement Sekera
beaded5e0c make test: fix broken interfaces #2
Change-Id: I9d5b5d925fd2c09a1113fc51e433a16d729a241b
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-06-25 13:19:26 +02:00
Klement Sekera
b9ef2739dd Revert "Revert "make test: fix broken interfaces""
This reverts commit c8efa29b6f9a91381897b54f1147daf922ed7164.

Change-Id: I1d5c5773d5f86a63073e255336bd9de628e26179
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-06-24 22:53:37 +02:00
Ole Troan
c8efa29b6f Revert "make test: fix broken interfaces"
This reverts commit d5c60b96a3fd93916fc4af5c8d6d25625c28242e.

Change-Id: I3632b9c3f76c615aee897f28f76d094e7031e689
Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-22 22:34:56 +02:00
Klement Sekera
d5c60b96a3 make test: fix broken interfaces
Change-Id: I2e092774f81503e04b53cc6c6b5d357fe3fc52ab
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-06-22 16:20:47 +00:00
Andrew Yourtchenko
563a8531cb acl-plugin: improvements in 'show acl-plugin macip acl' CLI
- allow to optionally specify the specific MACIP ACL index:
  'show acl-plugin macip acl [index N]'
- after showing the MACIP ACL, show the sw_if_index of
  interface(s) where it is applied.

Also, add some executions of this debug commands
to the MACIP test case for easy verification.

Change-Id: I56cf8272abc20b1b2581b60d528d27a70d186b18
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-03-23 18:18:41 +00:00
Andrew Yourtchenko
beca266229 acl-plugin: make test: do not use a debug CLI where API can be used
Parsing the list of applied ACLs from the debug CLI output
is not a good idea, since the debug CLI can and will change.
Fix that.

Change-Id: Ia47214863f2658a54219f59cb974b5cbc536f862
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-03-23 13:00:52 +00:00
Andrew Yourtchenko
d78349109f acl-plugin: unapply/reapply the classifier-based inacls when performing macip_acl_add_replace on an existing MACIP ACL
The classifier tables layout might (and most always will) change during the MACIP ACL modification.
Furthermore, vnet_set_input_acl_intfc() is quite a picky creature - it quietly does nothing
if there is an existing inacl applied, even if the number is different, so a simple "reapply"
does not work. So, cleanly remove inacl, then reapply when the new tables are ready.

Also, fix the testcase which was supposed to test this exact behavior.

Thanks to Jon Loeliger for spotting this issue.

Change-Id: I7e4bd8023d9de7e914448bb4466c1b0ef6940f58
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2017-12-11 19:05:23 +00:00
Pavel Kotucek
8daa80a4ad ACL plugin support tagged subinterfaces
Change-Id: I92b351895c7efb26533c05512b91ead8ddbfb9c8
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
2017-11-08 19:51:15 +00:00
Pavel Kotucek
057704ebb5 ACL plugin enable macip for ip4/ip6 traffic
Plus fixed problem with acl heap.

Change-Id: I3d91db549ebe4595f1dab9b8780f90722540024b
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
2017-09-19 07:24:02 +00:00
Pavel Kotucek
c29940c58d ACL-plugin add "replace" semantics for adding a new MacIP acl
Change-Id: Ia5c869b2d8b8ad012b9e89fb6720c9c32d9ee065
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
2017-09-12 08:38:25 +00:00
Pavel Kotucek
932f74196d ACL-plugin MACIP ACLs tests
Change-Id: Ie40c837358454cfe9475cb2c14fdf20b24fa6602
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
2017-09-08 05:51:24 +00:00