Giter Club home page Giter Club logo

openshift-tests's Introduction

Extended Platform Tests

This repository holds the non-kubernetes, end-to-end tests that need to pass on a running cluster before PRs merge and/or before we ship a release. These tests are based on ginkgo and the github.com/kubernetes/kubernetes e2e test framework.

Prerequisites

  • Git installed.
  • Golang installed.
  • Have the environment variable KUBECONFIG set pointing to your cluster.

New Test Folder

If you create a new folder for your test case, please add the path to the include.go file.

Compile the executable binary

The generated extended-platform-tests binary in the cmd/extended-platform-tests/ folder. If you want to compile the openshift-tests binary, please see the origin.

$ mkdir -p ${GOPATH}/src/github.com/openshift/
$ cd ${GOPATH}/src/github.com/openshift/
$ git clone [email protected]:openshift/openshift-tests.git
$ make clean
$ make build

Run ./extended-platform-tests --help to get started.

This command verifies behavior of an OpenShift cluster by running remote tests against the cluster API that exercise functionality. In general these tests may be disruptive or require elevated privileges - see the descriptions of each test suite.

Usage:
   [command]

Available Commands:
  help        Help about any command
  run         Run a test suite
  run-monitor Continuously verify the cluster is functional
  run-test    Run a single test by name
  run-upgrade Run an upgrade suite

Flags:
  -h, --help   help for this command

How to run

You can filter your test case by using grep. Such as, For example, to filter the OLM test cases, you can run this command:

$ ./bin/extended-platform-tests run all --dry-run|grep "\[Feature:Platform\] OLM should"
I0410 15:33:38.465141    7508 test_context.go:419] Tolerating taints "node-role.kubernetes.io/master" when considering if nodes are ready
"[Feature:Platform] OLM should Implement packages API server and list packagemanifest info with namespace not NULL [Suite:openshift/conformance/parallel]"
"[Feature:Platform] OLM should [Serial] olm version should contain the source commit id [Suite:openshift/conformance/serial]"
"[Feature:Platform] OLM should be installed with catalogsources at version v1alpha1 [Suite:openshift/conformance/parallel]"
"[Feature:Platform] OLM should be installed with clusterserviceversions at version v1alpha1 [Suite:openshift/conformance/parallel]"
"[Feature:Platform] OLM should be installed with installplans at version v1alpha1 [Suite:openshift/conformance/parallel]"
"[Feature:Platform] OLM should be installed with operatorgroups at version v1 [Suite:openshift/conformance/parallel]"
"[Feature:Platform] OLM should be installed with packagemanifests at version v1 [Suite:openshift/conformance/parallel]"
"[Feature:Platform] OLM should be installed with subscriptions at version v1alpha1 [Suite:openshift/conformance/parallel]"
"[Feature:Platform] OLM should have imagePullPolicy:IfNotPresent on thier deployments [Suite:openshift/conformance/parallel]"

You can save the above output to a file and run it:

$ ./bin/extended-platform-tests run -f <your file path/name>

Or you can run it directly:

$ ./bin/extended-platform-tests run all --dry-run | grep "\[Feature:Platform\] OLM should" | ./bin/extended-platform-tests run --junit-dir=./ -f -

How to run a specific test case

It searches the test case title by RE(Regular Expression). So you need to specify the title string detailly. For example, to run this test case: "[Serial] olm version should contain the source commit id", you can do it with 2 ways:

  • You may filter the list and pass it back to the run command with the --file argument. You may also pipe a list of test names, one per line, on standard input by passing "-f -".
$ ./bin/extended-platform-tests run all --dry-run|grep "\[Serial\] olm version should contain the source commit id"|./bin/extended-platform-tests run --junit-dir=./ -f -
  • You can also run it as follows if you know which test suite it belongs to.
$ ./bin/extended-platform-tests run openshift/conformance/serial --run "\[Serial\] olm version should contain the source commit id"

Debug

Sometime, we want to keep the generated namespace for debugging. Just add the Env Var: export DELETE_NAMESPACE=false. These random namespaces will be keep, like below:

...
Dec 18 09:39:33.448: INFO: Running AfterSuite actions on all nodes
Dec 18 09:39:33.448: INFO: Waiting up to 7m0s for all (but 100) nodes to be ready
Dec 18 09:39:33.511: INFO: Found DeleteNamespace=false, skipping namespace deletion!
Dec 18 09:39:33.511: INFO: Running AfterSuite actions on node 1
...
1 pass, 0 skip (2m50s)
[root@preserve-olm-env openshift-tests-private]# oc get ns
NAME                                               STATUS   AGE
default                                            Active   4h46m
e2e-test-olm-a-a92jyymd-lmgj6                      Active   4m28s
e2e-test-olm-a-a92jyymd-pr8hx                      Active   4m29s
...

How to generate bindata

If you have some new YAML files used in your code, you have to generate the bindata first. Run make update to update the bindata. For example, you can see the bindata has been updated after running the make update. As follows:

$ git status
	modified:   test/extended/testdata/bindata.go
	new file:   test/extended/testdata/olm/etcd-subscription-manual.yaml

openshift-tests's People

Contributors

0xmichalis avatar adambkaplan avatar bparees avatar coreydaley avatar csrwng avatar danwinship avatar deads2k avatar enj avatar gabemontero avatar ironcladlou avatar jianzhangbjz avatar jsafrane avatar kuiwang02 avatar liggitt avatar mfojtik avatar miciah avatar mnagy avatar openshift-merge-robot avatar p0lyn0mial avatar paulfantom avatar php-coder avatar sanchezl avatar sjug avatar smarterclayton avatar soltysh avatar stevekuznetsov avatar stlaz avatar sttts avatar tbuskey avatar tnozicka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openshift-tests's Issues

error: suite "files" does not contain any tests

[provide a description of the issue]
The openshift-tests binary cannot run any tests in the disconnected cluster.

Version

[provide output of the openshift version or oc version command]
openshift-tests version: v4.1.0+980671d-2626-dirty

Steps To Reproduce

Details: http://10.0.96.174:8080/job/olm-test/234/console

Current Result
16:26:39 [INFO] hack/build-go.sh exited with code 0 after 00h 02m 16s
16:26:39 I0423 04:26:39.738267    7057 test_context.go:423] Tolerating taints "node-role.kubernetes.io/master" when considering if nodes are ready
16:26:39 openshift-tests version: v4.1.0+980671d-2626-dirty
16:26:41 I0423 04:26:41.038522    7060 test_context.go:423] Tolerating taints "node-role.kubernetes.io/master" when considering if nodes are ready
16:26:41 error: suite "files" does not contain any tests
Expected Result

The openshift-tests binary runs well.

bindata: Failed to stat input path 'bindata/v4.1.0': lstat bindata/v4.1.0: no such file or directory

Issue while trying to update the bindata yamls.

make update hack/install-go-bindata.sh
Running `gofmt -s -l -w` on 270 file(s).
./test/extended/templates/templateinstance_readiness.go
./test/extended/templates/templateservicebroker_e2e.go
./test/extended/templates/template.go
./test/extended/networking/multicast.go
./test/extended/cluster/utils.go
./test/extended/bootstrap_user/bootstrap_user_login.go
./test/extended/controller_manager/deploy_scale.go
./test/extended/controller_manager/deploy_trigger.go
./test/extended/imageapis/imagesigning.go
./test/extended/util/framework.go
./test/extended/util/ldap.go
./test/extended/oauth/oauthcertfallback.go
./test/extended/images/imagestream_admission.go
./test/extended/images/helper.go
./test/extended/images/imagestream.go
./test/extended/images/oc_copy.go
./test/extended/builds/completiondeadlineseconds.go
./test/extended/apiserver/tls.go
./test/extended/testdata/bindata.go
./cmd/extended-platform-tests/openshift-tests.go
ln -s /home/bandrade/go/src/github.com/openshift/extended-platform-tests/vendor "/tmp/tmp.wRh5PvjO17/src"
export GO111MODULE=off && export GOPATH=/tmp/tmp.wRh5PvjO17 && export GOBIN=/tmp/tmp.wRh5PvjO17/bin && go install "./vendor/github.com/jteeuwen/go-bindata/..."
/tmp/tmp.wRh5PvjO17/bin/go-bindata -nocompress -nometadata -prefix "bindata" -pkg "v410_00_assets" -o "pkg/operator/v410_00_assets/bindata.go" -ignore "OWNERS" ./bindata/v4.1.0/... && gofmt -s -w "pkg/operator/v410_00_assets/bindata.go"
bindata: Failed to stat input path 'bindata/v4.1.0': lstat bindata/v4.1.0: no such file or directory
Makefile:34: recipe for target 'update-bindata-v4.1.0' failed
make: *** [update-bindata-v4.1.0] Error 1

"openshift/scalability" does not contain any tests

Running extended-platform-tests in dry run mode it does not return any tests for the "openshift/scalability" suite. I see this same behaviour with openshift-tests from openshift/origin.

Steps To Reproduce
$ go get github.com/openshift/openshift-tests
$ cd $GOPATH/src/github.com/openshift/openshift-tests
$ make
$. ./bin/extended-platform-tests run --dry-run openshift/scalability
Current Result
Sep  4 14:26:59.934: INFO: Could not get network operator configuration: not adding any plugin-specific skips
I0904 14:27:00.084380 1911674 test_context.go:419] Tolerating taints "node-role.kubernetes.io/master" when considering if nodes are ready
error: suite "openshift/scalability" does not contain any tests
Expected Result

The list of tests for the scalability suite.

Remove the noise output from the `--help`

When running the --help, get the noise output.

Current Result
mac:extended-platform-tests jianzhang$ ./extended-platform-tests --help
Please set KUBECONFIG first!
mac:extended-platform-tests jianzhang$ export KUBECONFIG=/Users/jianzhang/44-kubeconfig
mac:extended-platform-tests jianzhang$ ./extended-platform-tests --help
Apr 10 15:23:31.209: INFO: Running 'oc --kubeconfig=/Users/jianzhang/44-kubeconfig get packagemanifest -l catalog=certified-operators -o=jsonpath={range .items[*]}{.metadata.labels.catalog}:{.metadata.name}{'\n'}{end}'
Apr 10 15:23:47.436: INFO: Running 'oc --kubeconfig=/Users/jianzhang/44-kubeconfig get packagemanifest -l catalog=redhat-operators -o=jsonpath={range .items[*]}{.metadata.labels.catalog}:{.metadata.name}{'\n'}{end}'
Apr 10 15:23:48.830: INFO: Running 'oc --kubeconfig=/Users/jianzhang/44-kubeconfig get packagemanifest -l catalog=redhat-marketplace -o=jsonpath={range .items[*]}{.metadata.labels.catalog}:{.metadata.name}{'\n'}{end}'
Apr 10 15:23:54.604: INFO: Running 'oc --kubeconfig=/Users/jianzhang/44-kubeconfig get packagemanifest -l catalog=community-operators -o=jsonpath={range .items[*]}{.metadata.labels.catalog}:{.metadata.name}{'\n'}{end}'
OpenShift Extended Platform Tests

 This command verifies behavior of an OpenShift cluster by running remote tests against the cluster API that exercise functionality. In general these tests may be disruptive or require elevated privileges - see the descriptions of each test suite.

Usage:
   [command]

Available Commands:
  help        Help about any command
  run         Run a test suite
  run-monitor Continuously verify the cluster is functional
  run-test    Run a single test by name
  run-upgrade Run an upgrade suite

Flags:
  -h, --help   help for this command
Expected Result

Should remove the unnecessary info when running the --help.

mac:extended-platform-tests jianzhang$ ./extended-platform-tests --help
Please set KUBECONFIG first!
mac:extended-platform-tests jianzhang$ export KUBECONFIG=/Users/jianzhang/44-kubeconfig
mac:extended-platform-tests jianzhang$ ./extended-platform-tests --help
Apr 10 15:23:31.209: INFO: Running 'oc --kubeconfig=/Users/jianzhang/44-kubeconfig get packagemanifest -l catalog=certified-operators -o=jsonpath={range .items[*]}{.metadata.labels.catalog}:{.metadata.name}{'\n'}{end}'
Apr 10 15:23:47.436: INFO: Running 'oc --kubeconfig=/Users/jianzhang/44-kubeconfig get packagemanifest -l catalog=redhat-operators -o=jsonpath={range .items[*]}{.metadata.labels.catalog}:{.metadata.name}{'\n'}{end}'
Apr 10 15:23:48.830: INFO: Running 'oc --kubeconfig=/Users/jianzhang/44-kubeconfig get packagemanifest -l catalog=redhat-marketplace -o=jsonpath={range .items[*]}{.metadata.labels.catalog}:{.metadata.name}{'\n'}{end}'
Apr 10 15:23:54.604: INFO: Running 'oc --kubeconfig=/Users/jianzhang/44-kubeconfig get packagemanifest -l catalog=community-operators -o=jsonpath={range .items[*]}{.metadata.labels.catalog}:{.metadata.name}{'\n'}{end}'
OpenShift Extended Platform Tests

Missing e2e tests and k8s fixes

This repository has not updated the kubernetes dependency for a long time and is using a very old kubernetes version, 1.17, which means that the e2e tests will not:

  • Include any new fixes to existing tests.
  • Have any newer tests that are added upstream in the k8s repository, which can hide existing bugs. Such is the case of the multivolume XFS test.

An example of the missing fixes is the wait for the volume attachment on the data source external storage provisioning tests that were added in k8s. With the code currently used in this repository there are multiple e2e tests that can (and in the case of Ember-CSI do) incorrectly fail:

  • provisioning should provision storage with pvc data source
  • should provision storage with snapshot data source [Feature:VolumeSnapshotDataSource]
  • should provision storage with pvc data source in parallel [Slow]

It's not a problem with the CSI plugin, but with the fact that the test only waits for the data writer pod to disappear before using its volume as a data source, not taking into account that the pod disappears before the VolumeAttachment does, so the volume is usually still connected to the host and the data has not been flushed.

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.