A testing tool for running Maistra Service Mesh tasks on an OpenShift 4.x cluster.
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.
Name | Version |
---|---|
OS | Linux |
Golang | 1.13+ |
OpenSSl | -- |
- User can access a running OpenShift cluster from command line.
- 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 isbasic
. Optionally thetests/.env
file can be configured for the namespace where SMCP is located likeistio-system
and for the SMCP name, likebasic
. Then to activate thissource .env
has to be executed before triggering the testing. - An
oc
client has been installed. User has completed CLI login an OCP cluster as an admin user. Runoc login -u [user] -p [token] --server=[OCP API server]
-
A main test is in the
tests
directory. All test cases are in thetest_cases.go
and are mapped to the implementations in thepkg
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
- For Power environment testing, users can export an environment variable
-
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 defaultistio-system
andbasic
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