Skip to content

A Testing tool for running maistra tasks on OpenShift

License

Notifications You must be signed in to change notification settings

marozman2/maistra-test-tool

 
 

Repository files navigation

Maistra OpenShift Test Tool

A testing tool for running Maistra Service Mesh tasks on an OpenShift 4.x cluster.

Introduction

This project aims to automate the running Maistra Service Mesh tasks on an OpenShift 4.x Cluster.

The testing follows Istio Doc Tasks

The test cases include several changes for an OpenShift environment. Currently, those changes will not work in origin Kubernetes environments.

Versions

Name Version
OS Linux
Golang 1.13+
OpenSSl --

Testing Prerequisite

  1. User can access a running OpenShift cluster from command line.
  2. Service Mesh Control Plane (SMCP) has been installed on an OpenShift cluster. By default (without any additional step) the SMCP is in namespace istio-system and the SMCP name is basic. Optionally the tests/.env file can be configured for the namespace where SMCP is located like istio-system and for the SMCP name, like basic. Then to activate this source .env has to be executed before triggering the testing.
  3. An oc client has been installed. User has completed CLI login an OCP cluster as an admin user. Run oc login -u [user] -p [token] --server=[OCP API server]

Testing

  • A main test is in the tests directory. All test cases are in the test_cases.go and are mapped to the implementations in the pkg directory.

  • In order to save results in a XML report, we can run a go test command with "github.com/jstemmer/go-junit-report".

    $ go get -u github.com/jstemmer/go-junit-report
    
  • Avoid Golang 1.15+ client openSSL relies on legacy Common Name field.

    $ export GODEBUG="x509ignoreCN=0"
    
  • By default, there is an environment variable SAMPLEARCH=x86

    • For Power environment testing, users can export an environment variable SAMPLEARCH
      $ export SAMPLEARCH=p
      
    • For Z environment testing, users can export an environment variable SAMPLEARCH
      $ export SAMPLEARCH=z
      
  • To run all the test cases: cd tests; go test -timeout 3h -v. It is required to use the -timeout flag. Otherwise, the go test will fall into panic after 10 minutes.

    $ cd tests
    $ go test -timeout 3h -v 2>&1 | tee >(${GOPATH}/bin/go-junit-report > results.xml) test.log
    
  • Optionally to run all the test cases customizing the SMCP namespace and the SMCP name: Set the expected values in the tests/.env. By default istio-system and basic is set. cd tests; source .env; go test -timeout 3h -v. It is required to use the -timeout flag. Otherwise, the go test will fall into panic after 10 minutes.

    $ cd tests
    $ source .env
    $ go test -timeout 3h -v 2>&1 | tee >(${GOPATH}/bin/go-junit-report > results.xml) test.log
    

License

Maistra OpenShift Test Tool is Apache 2.0 licensed

About

A Testing tool for running maistra tasks on OpenShift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 93.7%
  • Shell 6.0%
  • Dockerfile 0.3%