This section contains information about integration tests for the VPP agent.
The integration tests are written using Go and test mainly the vppcalls layer that provides VPP-version agnostic API interface. The integration test suite can be executed for any of the VPP versions defined in vpp.env.
Running the tests on a mac using the make command could result in errors such as missing syscalls.
Run Integration Test Suite#
The easiest way to run the entire integration test suite is to use make target
Run tests using the default VPP version defined by
# run tests with default VPP version make integration-tests
Run tests for a specific
# run tests with VPP 20.05 make integration-tests VPP_VERSION=2005 # run tests with VPP 20.01 make integration-tests VPP_VERSION=2001 # run tests with VPP 19.08 make integration-tests VPP_VERSION=1908
Customize Integration Test Run#
The integration test suite can be executed manually by running the following script:
This script supports the addition of extra arguments for the test run.
Before running the tests, you must set the
VPP_IMG variable to the desired image.
The simplest way to set the
VPP_IMG variable uses the export command:
Then you can execute the script like so:
Run tests in verbose mode:
bash ./tests/integration/vpp_integration.sh -test.v
Run tests cases for specific functionality:
# test cases for ACLs bash ./tests/integration/vpp_integration.sh -test.run=ACL # test cases for L3 routes bash ./tests/integration/vpp_integration.sh -test.run=Route
Run tests with any additional flags supported by the
go test tool:
# run with coverage report bash ./tests/integration/vpp_integration.sh -test.cover # run with CPU profiling bash ./tests/integration/vpp_integration.sh -test.cpuprofile cpu.out
Reference: VPP Agent tests repo folder