The repository contains a set of test cases that run different test scenarios from cnf-certification-test project and verifies if these scenarios behave correctly under different environment conditions. The cnfcert-tests-verification project based on golang+ginkgo framework.
cnfcert-tests-verification project triggers the same test scenario from cnf-certification-test several times using different pre-configured OCP environment. Once the triggered scenario is completed, the test case processes the report and verifies that the scenario is completed with the excepted result: skip/fail/pass.
The cnfcert-tests-verification is designed to test cnf-certification-test project using pre-installed OCP cluster with version 4.7 and above. In order to be able to test all test scenarios, the following requirements should be met:
Mandatory requirements:
- OCP cluster installed with version >=4.7
- Minimum 3 worker nodes where 2 of them are cnf-workers nodes
- Performance Addon Operator
- Machine-config-operator
Optional:
- Machine config pool
- PTP operator
- SR-IOV operator
- Performance Addon Operator
- 3 master nodes
- 2 cnf-worker nodes
- 1 worker node
FEATURES
- select the test scenarios that you are going to test, comma separatedTNF_REPO_PATH
- absolute path to cnf-certification-test on your machineTNF_IMAGE
- link to tnf image. Default is quay.io/testnetworkfunction/cnf-certification-testTNF_IMAGE_TAG
- image tag that is going to be tested. Default is latestTNF_LOG_LEVEL
- Log level. Default is 4TEST_IMAGE
- Test image that is going to be used for all test resources such as deployments, daemonsets and so on. Default is quay.io/testnetworkfunction/cnf-test-partnerDEBUG_TNF
- GenerateDebug
folder that will contain TNF suites folders with TNF logs for each test.
The list of available features:
- networking
- affiliated-certification
- lifecycle
- observability
- platform-alteration
- access-control
- performance
- operator
- preflight
Choose the variant that suits you best:
make test-features
- will only run tests for the features that were defined in theFEATURES
variablemake test-all
- will run the test suite for all features
make install
- download and install all required dependencies for the cnfcert-tests-verification project
Below is an e2e flow example:
-
Clone the project to your local computer -
git clone https://github.com/test-network-function/cnfcert-tests-verification.git
-
Change the folder to the project folder -
cd cnfcert-tests-verification
-
Download and install needed dependencies -
make install
-
Define absolute path to cnf-certification-test project on you computer by setting environment variable:
export TNF_REPO_PATH=/path/to/project/cnf-certification-test
-
OPTIONAL: Set cnf-certification-test container tag that you are going to test. Default is latest.
export TNF_IMAGE_TAG=unstable
-
Run all tests -
make test-all
- export
DEBUG_TNF
=true. - run
make test-all
/make test-features
. - under reports folder, a
Debug
folder will be generated, containing suites folders with TNF logs for each of the tests. -
Random Seed: 1668617625"
on each run, ginkgo is generating a seed number, the seed is used to randomize the execution order of the tests, in order to repeat the exact same run, export
GINKGO_SEED_NUMBER=seed
, and then repeat stage 2 above. when launching stage 2 after exporting the seed, this is an output example - the seed will be different - "Running Suite: CNFCert lifecycle tests - /root/tnf-qe/cnfcert-tests-verification/tests/lifecycle
The project uses a development method - forking workflow
- A developer forks the cnfcert-tests-verification project
- A new local feature branch is created
- The developer makes changes on the new branch.
- New commits are created for the changes.
- The branch gets pushed to the developer's own server-side copy.
- Changes are tested.
- The developer opens a pull request(
PR
) from the new branch to the cnfcert-tests-verification. - The pull request gets approved for merge and is merged into the cnfcert-tests-verification.
.
├── config # Config files
├── scripts # Makefile Scripts
├── tests # Test cases directory
│ ├── networking # Networking test cases directory
│ │ ├── helper # Networking common test function
│ │ ├── parameters # Networking constants and parameters
│ │ └── tests # Networking test suite directory
| ├── affiliatedcertification # Affiliated Certification test cases directory
| | ├── helper # Affiliated Certification common test function
| | ├── parameters # Affiliated Certification constants and parameters
| | └── tests # Affiliated Certification test suite directory
│ ├── platform # Platform test cases directory
│ │ ├── helper # Platform common test function
│ │ ├── parameters # Platform constants and parameters
│ │ └── tests # Platform test suite directory
│ ├── observability # Observability test cases directory
│ │ ├── helper # Observability common test function
│ │ ├── parameters # Observability constant and parameters
│ │ └── tests # Observability test suite directory
│ ├── globalhelper # Common test function
│ ├── globalparameters # Common test function
│ └── utils # Common utils functions. These utils are based on Kubernetes api calls
│ ├── client
│ ├── config
│ ├── node
│ ├── namespace
│ └── pod
└── vendors # Dependencies folder
CNF Certification Test Partner is copyright Red Hat, Inc. and available under an Apache 2 license.