Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/test-network-function/cnfcert-tests-verification

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/test-network-function/cnfcert-tests-verification

  • v0.0.0-20241025200620-03edca9bcbae
  • Source
  • Go
  • Socket score

Version published
Created
Source

CertSuite QE

Test Incoming Changes red hat openshift license

Objective

The repository contains a set of test cases that run different test scenarios from certsuite project and verifies if these scenarios behave correctly under different environment conditions.

The certsuite-qe project is based on golang+ginkgo framework.

certsuite-qe project triggers the same test scenario from certsuite 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.

ConditionsMandatory
OCP ClusterVersion: >= 4.12, Node Count >= 3 with 2 cnf-worker nodesYes
Installed OperatorsPerformance Addon, Machine-config-operatorYes
Machine config pool, PTP operator, SR-IOV operatorNo

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
  • manageability
  • 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 NamePurpose
FEATURESTo select the test scenarios that you are going to test, comma separated
CERTSUITE_REPO_PATHPoints to the absolute path to certsuite on your machine
CERTSUITE_IMAGELinks to the Certsuite image. Default is quay.io/redhat-best-practices-for-k8s/certsuite
CERTSUITE_IMAGE_TAGimage tag that is going to be tested. Default is latest
TEST_IMAGETest image that is going to be used for all test resources such as deployments, daemonsets and so on. Default is quay.io/testnetworkfunction/k8s-best-practices-debug
DEBUG_CERTSUITEGenerate Debug folder that will contain Certsuite suites folders with Certsuite logs for each test.
CERTSUITE_LOG_LEVELLog level. Default is 4
DISABLE_INTRUSIVE_TESTSTurns off the intrusive tests for faster execution. Default is false.
ENABLE_PARALLELEnable ginkgo -p parallel flags (experimental). Default is false.
FORCE_DOWNLOAD_UNSTABLEForce download the unstable image. Default is false.
NON_LINUX_ENVAllow the test suites to run in a non Linux environment. Default is false.

Steps to run the tests

Pre-requisites

Make sure docker or podman is running on the local machine.

Set your local container runtime to your environment with:

export CERTSUITE_CONTAINER_CLIENT=docker
Clone the repo and change directory to the cloned repo
git clone https://github.com/redhat-best-practices-for-k8s/certsuite-qe.git
cd certsuite-qe
Download and install needed dependencies
make install
Execute tests
  • To run all tests
# Mac user
  DOCKER_CONFIG_DIR=$HOME/.docker \
  KUBECONFIG=$HOME/.kube/config \
  NON_LINUX_ENV= \
  CERTSUITE_REPO_PATH=$HOME/path/to/certsuite \
  make test-all
# Linux user
  KUBECONFIG=$HOME/.kube/config \
  CERTSUITE_REPO_PATH=$HOME/path/to/certsuite \
  make test-all
# Linux user with force download unstable image
 \
  FORCE_DOWNLOAD_UNSTABLE=true \
  KUBECONFIG=$HOME/.kube/config \
  CERTSUITE_REPO_PATH=$HOME/path/to/certsuite \
  make test-all
  • To run a specific test-suite:
# Mac user
  DOCKER_CONFIG_DIR=$HOME/.docker \
  FEATURES=platformalteration \
  KUBECONFIG=$HOME/.kube/config \
  NON_LINUX_ENV= \
  CERTSUITE_REPO_PATH=$HOME/path/to/certsuite \
  make test-features
# Linux user
  FEATURES=platformalteration \
  KUBECONFIG=$HOME/.kube/config \
  DOCKER_CONFIG_DIR=$HOME/.docker \
  CERTSUITE_REPO_PATH=$HOME/path/to/certsuite \
  make test-features
  • To debug

Use DEBUG_CERTSUITE=true and CERTSUITE_LOG_LEVEL=debug while running the above commands. This would create a Debug folder containing suites folders with Certsuite logs for each of the tests.

# Mac user
  DEBUG_CERTSUITE=true \
  DOCKER_CONFIG_DIR=$HOME/.docker \
  FEATURES=platformalteration \
  KUBECONFIG=$HOME/.kube/config \
  NON_LINUX_ENV= \
  CERTSUITE_LOG_LEVEL=debug \
  CERTSUITE_REPO_PATH=$HOME/path/to/certsuite \
  make test-features
# Linux user
  DEBUG_CERTSUITE=true \
  FEATURES=platformalteration \
  KUBECONFIG=$HOME/.kube/config \
  CERTSUITE_LOG_LEVEL=debug \
  CERTSUITE_REPO_PATH=$HOME/path/to/certsuite \
  make test-features

Running the unit tests

To execute the unit tests in the repository, run the following:

make test

Test exceptions on local kind cluster

  • access-control-security-context
  • affiliated-certification-container-is-certified-digest
  • affiliated-certification-operator-is-certified
  • platform-alteration-tainted-node-kernel

Nightly Runs Against Various Environments

The QE repo is being used in nightly automated runs in the following files:

Contribution Guidelines

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

License

CertSuite QE is copyright Red Hat, Inc. and available under an Apache 2 license.

FAQs

Package last updated on 25 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc