Git Product home page Git Product logo

cnfcert-tests-verification's Introduction

cnfcert-tests-verification

makefile ci red hat openshift license

Objective

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 is 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.

Requirements

The tests are run on the OCP cluster with certain requirements that are listed below.

Conditions Mandatory
OCP Cluster Version: >= 4.7, Node Count >= 3 with 2 cnf-worker nodes Yes
Installed Operators Performance Addon, Machine-config-operator Yes
Machine config pool, PTP operator, SR-IOV operator No

Bare-minimum requirements consists of a OCP cluster with 3 nodes where 2 are cnf-worker nodes and 1 worker node.

Overview

The following test features are can run selectively or altogether.

  • accesscontrol
  • affiliatedcertification
  • lifecycle
  • networking
  • observability
  • platformalteration
  • performance
  • operator
  • preflight

Choose the variant that suits you best:

make test-features - will only run tests for the features that were defined in the FEATURES environment variable make test-all - will run the test suite for all features

Environment variables

The following environment variables are used to configure the test setup.

Env Variable Name Purpose
FEATURES To select the test scenarios that you are going to test, comma separated
TNF_REPO_PATH Points to the absolute path to cnf-certification-test on your machine
TNF_IMAGE Links to the TNF image. Default is quay.io/testnetworkfunction/cnf-certification-test
TNF_IMAGE_TAG image tag that is going to be tested. Default is latest
TEST_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-partner
DEBUG_TNF Generate Debug folder that will contain TNF suites folders with TNF logs for each test.
TNF_LOG_LEVEL Log level. Default is 4

Steps to run the tests

Pre-requisites

Make sure docker or podman is running on the local machine. You could consider using Colima - container runtime on macOS (and Linux) with minimal setup.

Clone the repo and change directory to the cloned repo

git clone https://github.com/test-network-function/cnfcert-tests-verification.git
cd cnfcert-tests-verification

Download and install needed dependencies

make install

Set environment variables

  • testconfig.yaml inside the config directory stores the local environment related information. Update tnf_config_dir and tnf_report_dir, and docker_config_dir as specific to your local workspace.

Optionally, update tnf_image, test_image, and tnf_image_tag as per needs.

# Sample configurations snippet
general:
  tnf_config_dir: "/Users/bmandal/rhdev/github.com/cnfcert-tests-verification/tnf_config"
  tnf_report_dir: "/Users/bmandal/rhdev/github.com/cnfcert-tests-verification/tnf_report"
  tnf_image: "quay.io/testnetworkfunction/cnf-certification-test"
  tnf_image_tag: "unstable"
  docker_config_dir: "/tmp"
  • To use this test config file, you need to set LOCAL_TESTING environment variable while running the test.

Mac Users : Set NON_LINUX_ENV= to signal the repo code that the suite is run against the non Linux local env.

Execute tests

  • To run all tests
# Mac User
TNF_REPO_PATH=/path/to/repo/cnf-certification-test  KUBECONFIG=/path/to/kubeconfig LOCAL_TESTING= NON_LINUX_ENV= make test-all
# Linux User
TNF_REPO_PATH=/path/to/repo/cnf-certification-test  KUBECONFIG=/path/to/kubeconfig LOCAL_TESTING= make test-all
  • To run a specific feature
# Mac User
FEATURES=platformalteration TNF_REPO_PATH=/path/to/repo/cnf-certification-test  KUBECONFIG=/path/to/kubeconfig LOCAL_TESTING= NON_LINUX_ENV= make test-features
# Linux User
FEATURES=platformalteration TNF_REPO_PATH=/path/to/repo/cnf-certification-test  KUBECONFIG=/path/to/kubeconfig LOCAL_TESTING= make test-features
  • To debug

Use DEBUG_TNF=true and TNF_LOG_LEVEL=trace while running the above commands. This would create a Debug folder containing suites folders with TNF logs for each of the tests.

# Mac User
FEATURES=platformalteration TNF_LOG_LEVEL=trace DEBUG_TNF=true TNF_REPO_PATH=/path/to/repo/cnf-certification-test  KUBECONFIG=/path/to/kubeconfig LOCAL_TESTING= NON_LINUX_ENV= make test-features
# Linux User
FEATURES=platformalteration TNF_LOG_LEVEL=trace DEBUG_TNF=true TNF_REPO_PATH=/path/to/repo/cnf-certification-test  KUBECONFIG=/path/to/kubeconfig LOCAL_TESTING= make test-features

Contribution Guidelines

Fork the repo, create a new branch and create a PR with your changes.

License

CNF Certification Test Partner is copyright Red Hat, Inc. and available under an Apache 2 license.

cnfcert-tests-verification's People

Contributors

dependabot[bot] avatar theemj avatar sebrandon1 avatar shaior avatar kononovn avatar greyerof avatar bnshr avatar rdavid avatar jmontesi avatar aabughosh avatar edcdavid avatar mwlinca avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.