Skip to content

Commit 179085b

Browse files
Merge pull request #417 from kstrenkova/add-basic-kuttl-tests
Add basic kuttl tests
2 parents 16033b8 + 3e9de8e commit 179085b

12 files changed

Lines changed: 179 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- test_v1beta1_tempest.yaml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
apiVersion: test.openstack.org/v1beta1
3+
kind: Tempest
4+
metadata:
5+
name: tempest-sample
6+
namespace: openstack
7+
spec:
8+
containerImage: ""
9+
tempestRun:
10+
includeList: |
11+
tempest.api.identity.v3.*
12+
concurrency: 8
13+
tempestconfRun: {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- ../bases/tempest
5+
patches:
6+
- patch: |-
7+
- op: replace
8+
path: /metadata/namespace
9+
value: test-operator-kuttl-tests
10+
target:
11+
kind: Tempest

kuttl-test.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# EXECUTION (from install_yamls repo root):
3+
#
4+
# make test_operator_kuttl
5+
#
6+
# ASSUMPTIONS:
7+
#
8+
# 1. Latest version of kuttl is installed at /usr/local/bin/kubectl-kuttl
9+
# 2. An OCP 4.10+ CRC cluster with Podified Operators has been deployed
10+
# 3. CLI user has access to $KUBECONFIG
11+
# 4. The environment variable INSTALL_YAMLS is set to the path of the
12+
# install_yamls repo
13+
14+
apiVersion: kuttl.dev/v1beta1
15+
kind: TestSuite
16+
reportFormat: xml
17+
reportName: kuttl-report-test-operator
18+
reportGranularity: test
19+
namespace: test-operator-kuttl-tests
20+
timeout: 600
21+
parallel: 1
22+
suppress:
23+
- events # Remove spammy event logs
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
delete:
4+
- apiVersion: v1
5+
kind: ConfigMap
6+
name: openstack-config
7+
- apiVersion: v1
8+
kind: Secret
9+
name: openstack-config-secret
10+
- apiVersion: test.openstack.org/v1beta1
11+
kind: Tempest
12+
name: tempest-sample
13+
- apiVersion: test.openstack.org/v1beta1
14+
kind: Tobiko
15+
name: tobiko-sample
16+
- apiVersion: test.openstack.org/v1beta1
17+
kind: AnsibleTest
18+
name: ansibletest-sample
19+
- apiVersion: test.openstack.org/v1beta1
20+
kind: HorizonTest
21+
name: horizontest-sample
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#
2+
# Check for:
3+
#
4+
# No CRs
5+
# No Pods
6+
# No ConfigMaps
7+
# No Secrets
8+
#
9+
apiVersion: v1
10+
kind: ConfigMap
11+
metadata:
12+
name: openstack-config
13+
---
14+
apiVersion: v1
15+
kind: Secret
16+
metadata:
17+
name: openstack-config-secret
18+
---
19+
apiVersion: test.openstack.org/v1beta1
20+
kind: Tempest
21+
metadata:
22+
name: tempest-sample
23+
---
24+
apiVersion: test.openstack.org/v1beta1
25+
kind: Tobiko
26+
metadata:
27+
name: tobiko-sample
28+
---
29+
apiVersion: test.openstack.org/v1beta1
30+
kind: AnsibleTest
31+
metadata:
32+
name: ansibletest-sample
33+
---
34+
apiVersion: test.openstack.org/v1beta1
35+
kind: HorizonTest
36+
metadata:
37+
name: horizontest-sample
38+
---
39+
apiVersion: v1
40+
kind: Pod
41+
metadata:
42+
labels:
43+
job-name: tempest-sample
44+
---
45+
apiVersion: v1
46+
kind: Pod
47+
metadata:
48+
labels:
49+
job-name: tobiko-sample
50+
---
51+
apiVersion: v1
52+
kind: Pod
53+
metadata:
54+
labels:
55+
job-name: ansibletest-sample
56+
---
57+
apiVersion: v1
58+
kind: Pod
59+
metadata:
60+
labels:
61+
job-name: horizontest-sample
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: test.openstack.org/v1beta1
2+
kind: Tempest
3+
metadata:
4+
name: tempest-sample
5+
status:
6+
conditions:
7+
- type: Ready
8+
status: "True"
9+
- type: DeploymentReady
10+
status: "True"
11+
- type: InputReady
12+
status: "True"
13+
- type: NetworkAttachmentsReady
14+
status: "True"
15+
- type: ServiceConfigReady
16+
status: "True"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
commands:
4+
- script: |
5+
oc kustomize ../../../../config/samples/layout/tempest | oc apply -f -
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common/cleanup-all-tests.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common/errors-cleanup.yaml

0 commit comments

Comments
 (0)