22 Commits

Author SHA1 Message Date
Dave Wallace
85ce93160f tests: fix make test python issues on ubuntu 24.04
- add patch to scapy to use latest six module instead
  of the old scapy specific six module which fails to
  import moves sub-module on python 3.12
- fix warning for deprecated legacy editable install of vpp_papi
- skip failing testcases on ubuntu-24.04

Type: test

Change-Id: Idc1a008c6e45ba69caa50c2e245012eb05effed7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2024-08-22 07:35:40 +00:00
Dmitry Valter
34fa0ce8f7 tests: skip more excluded plugin tests
Check and skip VPP_EXCLUDED_PLUGINS tests for most of plugins.

Type: improvement
Signed-off-by: Dmitry Valter <d-valter@yandex-team.com>
Change-Id: I23fd3666729251c639aa8da72a676058e3f5bb4e
2024-07-12 15:43:24 +00:00
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
Pratikshya Prasai
657bdf781a tests: initial asf framework refactoring for 'make test'
Type: refactor

Change-Id: I41455b759a5d302ad5c4247c13634c471e7d49a8
Signed-off-by: Pratikshya Prasai <pratikshyaprasai2112@gmail.com>
Signed-off-by: Saima Yunus <yunus.saima.234@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-11-09 21:22:33 -05:00
Dmitry Valter
9f5b36926b vlib: don't leak node frames on refork
Free node frames in worker mains on refork. Otherwise these frames are
never returned to free pool and it causes massive memory leaks if
performed under traffic load

Type: fix
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: I15cbf024a3f4b4082445fd5e5aaa10bfcf77f363
2022-09-09 16:03:14 +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
Dmitry Valter
3ace4d62e2 tests: fix core file message
Prevent crashing on nonexistent VPP binary path class member when creating
testsuite core message.

Type: fix
Fixes: b23ffd7ef216463c35b75c831e6a27e58971f4ec
Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: Ib9b3dc8c69317e6561e5404bbdcbf672e417cbcd
2022-03-27 09:21:34 +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 Barach
4de5f9be88 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
2021-06-08 15:23:15 +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
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
Damjan Marion
f5b27cbcc7 misc: deprecate old perfmon
Type: refactor
Change-Id: I1303219f9f2a25d821737665903b0264edd3de32
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-18 17:20:28 +00:00
Dave Barach
aa676749d8 vlib: clean up event-logger CLI
Change "elog trace" to "event-logger trace"; corresponding change in
test/test_vlib.py, verified that the vlib test vectors still pass even
though they're not run on a regular basis ("make GCOV_TESTS=yes
TEST=test_vlib ...")

Type: improvement

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Idee4aa036573865e071a9bab87e27fb5d53b4933
2020-11-26 17:17:36 +00:00
Dave Barach
3a49130c75 tests: improve lcov stats for memory_api.c
Cover vl_mem_api_dead_client_scan(...), which is not so simple.  Spin
up vpp_api_test using pexpect.spawn, make it bootstrap a private
memory segment, kill vpp_api_test, and wait for the dead client
scanner to run a few times so that it declares the client dead.

The test only runs if GCOV_TESTS=yes is set in the environment.

Type: test

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I3c712fa011df2e23761a2e73c1aba0c7e50123a6
2020-06-20 01:58:34 +00:00
Dave Barach
d498c9eb2b tests: add running_gcov_tests to framework.py
Mark a few code coverage tests appropriately:

@unittest.skipUnless(running_gcov_tests, "part of code coverage tests")
def test_my_coverage_unittest(self):
    <etc>

Almost exactly like "make EXTENDED_TESTS=yes test".

Type: feature
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Ic6d0a097a608ba93442b3d88252f66f8e6805b97
2020-03-10 23:40:35 +00:00
Dave Barach
4ed2598562 tests: configure 32 mb physmem
Absolutely nothing good happens when we force the kernel to briefly
map and then unmap 16gb as vpp starts. Effect exacerbated when
TEST_JOBS = 20...40, and so forth.

Type: test

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id8e3ce1763cad3a0891d5d6c8d2c1e3e610682d7
2020-01-02 16:29:19 +00:00
Dave Barach
29c6132108 classify: "classify filter ..." debug CLI cleanup
The pcap trace filter initial table index lives in
cm->filter_set_by_sw_if_index [0], which corresponds to the "local0"
interface. Debug cli makes sure that folks don't accidentally specify
the "local0" interface. At least it does now...

Fix the "vlib format.c code coverage" test in test/test_vlib.py.

Type: fix
Change-Id: I35320bc2c8f0c6f1f8c12e3529d1938548185151
Signed-off-by: Dave Barach <dave@barachs.net>
2019-12-25 13:01:48 +00:00
Dave Barach
6b3f25caff vlib: improve test coverage
Add tests.
Remove unused rule-based parser code.

Type: test

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I3ca3a9dd9da8ee8f3a47004c98f2f5644db10057
2019-12-09 21:19:47 +00:00
Paul Vinciguerra
41a817a318 tests: fix typo in test_vlib
Trailing comma made last line of a multi-line command a new command.

Logs:
  22:39:49,695 Return value: cli_inband_reply(_0=794, context=2, retval=0, reply='loop0\n')
  22:39:49,695 CLI: packet-generator new {
   name vlib
   limit 15
   size 128-128
   interface loop0
   node ethernet-input
   data {
     IP6: 00:d0:2d:5e:86:85 -> 00:0d:ea:d0:00:00
     ICMP: db00::1 -> db00::2
     incrementing 30
     }

  22:39:49,695 Calling cli_inband('cmd':'packet-generator new {\n name vlib\n limit 15\n size 128-128\n interface loop0\n node ethernet-input\n data {\n   IP6: 00:d0:2d:5e:86:85 -> 00:0d:ea:d0:00:00\n   ICMP: db00::1 -> db00::2\n   incrementing 30\n   }\n\n','context':3,'_vl_msg_id':792)
  22:39:49,696 Return value: cli_inband_reply(_0=794, context=3, retval=0, reply='')
  22:39:49,696 CLI: }

  22:39:49,696 Calling cli_inband('cmd':'}\n\n','context':4,'_vl_msg_id':792)
  22:39:49,697 Return value: cli_inband_reply(_0=794, context=4, retval=-1, reply="unknown inpu...
  22:39:49,697 }
   FAIL reply unknown input `}'

Type: fix

Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Change-Id: Iaa82d432677d742e766e42383364adda5bd87665
2019-11-25 14:50:31 +00:00
Dave Barach
e51a9bbe76 vlib: improve code coverage, part deux
Type: test

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: If31f4b50da7a6e4a9704ceb3415c582143c08355
2019-11-20 17:38:49 +00:00
Dave Barach
c17fc44735 vlib: improve code coverage in src/vlib
Type: test

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2dc4c09730f77931a2b484a6dd5dc669068f8e57
2019-11-18 17:17:40 -05:00
Dave Barach
d9ca7c9604 vlib: improve vlib "make test" code coverage
Type: test

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Idf982fddad9e577595d2e05ac78c39705e9d616d
2019-11-13 20:59:45 +00:00