A testing tool for running Maistra Service Mesh tasks on an OpenShift 4.x cluster.
This project aims to automate Maistra Service Mesh tasks on an OpenShift 4.x Cluster.
The testing tasks are based on istio.io Doc Tasks
| Name | Version |
|---|---|
| OS | Linux |
| Golang | 1.13+ |
| OpenSSl | 1.1.1+ |
| oc client | 4.x |
-
An
occlient can be downloaded from mirror openshift-v4 clients. Extract theopenshift-client-...tar.gzfile and move bothocandkubectlbinaries into a local PATH directory. -
Access an OpenShift cluster from command line before running tests. Run a login command.
oc login -u [user] -p [token] --server=[OCP API server] -
RedHat Service Mesh Operator has been installed on the OpenShift cluster.
-
A main test is in the
testsdirectory. All test cases are in thetest_cases.goand are mapped to the implementations in thepkgdirectory. -
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 -
Optionally to run all the test cases customizing the SMCP namespace and the SMCP name: A user can update the expected values in the
tests/test.env. -
By default, the
tests/test.envfile usesexport SAMPLEARCH=x86- For Power environment testing, a user can update the
tests/test.envfileexport SAMPLEARCH=p - For Z environment testing, a user can update the
tests/test.envfileexport SAMPLEARCH=z
- For Power environment testing, a user can update the
-
To run all the test cases:
cd tests; go test -timeout 2h -v.The
-timeoutflag is necessary when running all tests or several major test cases. Otherwise, ago testcommand falls into panic after 10 minutes.$ cd tests $ go test -timeout 2h -v 2>&1 | tee >(${GOPATH}/bin/go-junit-report > results.xml) test.log -
To run a single test case: e.g.
cd tests; go test -run A1 -timeout 2h -vTest cases shortname and mapping are in the
tests/test_cases.gofile.