Skip to content

Commit f99a968

Browse files
committed
Add basic kuttl tests
This PR adds basic kuttl tests and will serve as a base for adding more complex kuttl tests later. Depends-On: openstack-k8s-operators/install_yamls#1137
1 parent 40bb9c8 commit f99a968

File tree

9 files changed

+139
-0
lines changed

9 files changed

+139
-0
lines changed

kuttl-test.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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. A FULL OpenStack deployment is running (via install_yamls)
12+
# - Keystone, Nova, Neutron, Glance are deployed and functional
13+
# - openstack-config ConfigMap exists in the namespace
14+
# - openstack-config-secret Secret exists with valid credentials
15+
# 5. test-operator is deployed (via install_yamls `make test_operator`)
16+
#
17+
18+
apiVersion: kuttl.dev/v1beta1
19+
kind: TestSuite
20+
reportFormat: xml
21+
reportName: kuttl-report-test-operator
22+
reportGranularity: test
23+
namespace: test-operator-kuttl-tests
24+
timeout: 180
25+
parallel: 1
26+
suppress:
27+
- events # Remove spammy event logs
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
delete:
4+
- apiVersion: test.openstack.org/v1beta1
5+
kind: Tempest
6+
name: tempest-sample
7+
- apiVersion: test.openstack.org/v1beta1
8+
kind: Tobiko
9+
name: tobiko-sample
10+
- apiVersion: test.openstack.org/v1beta1
11+
kind: AnsibleTest
12+
name: ansibletest-sample
13+
- apiVersion: test.openstack.org/v1beta1
14+
kind: HorizonTest
15+
name: horizontest-sample
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# Check for:
3+
#
4+
# No CRs
5+
# No Pods
6+
#
7+
apiVersion: test.openstack.org/v1beta1
8+
kind: Tempest
9+
metadata:
10+
name: tempest-sample
11+
---
12+
apiVersion: test.openstack.org/v1beta1
13+
kind: Tobiko
14+
metadata:
15+
name: tobiko-sample
16+
---
17+
apiVersion: test.openstack.org/v1beta1
18+
kind: AnsibleTest
19+
metadata:
20+
name: ansibletest-sample
21+
---
22+
apiVersion: test.openstack.org/v1beta1
23+
kind: HorizonTest
24+
metadata:
25+
name: horizontest-sample
26+
---
27+
apiVersion: v1
28+
kind: Pod
29+
metadata:
30+
labels:
31+
job-name: tempest-sample
32+
---
33+
apiVersion: v1
34+
kind: Pod
35+
metadata:
36+
labels:
37+
job-name: tobiko-sample
38+
---
39+
apiVersion: v1
40+
kind: Pod
41+
metadata:
42+
labels:
43+
job-name: ansibletest-sample
44+
---
45+
apiVersion: v1
46+
kind: Pod
47+
metadata:
48+
labels:
49+
job-name: horizontest-sample
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: test.openstack.org/v1beta1
2+
kind: Tempest
3+
metadata:
4+
name: tempest-sample
5+
namespace: test-operator-kuttl-tests
6+
status:
7+
conditions:
8+
- type: InputReady
9+
status: "True"
10+
- type: ServiceConfigReady
11+
status: "True"
12+
---
13+
apiVersion: v1
14+
kind: ConfigMap
15+
metadata:
16+
name: tempest-sample-config
17+
namespace: test-operator-kuttl-tests
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: test.openstack.org/v1beta1
2+
kind: Tempest
3+
metadata:
4+
name: tempest-sample
5+
namespace: test-operator-kuttl-tests
6+
spec:
7+
containerImage: quay.io/podified-antelope-centos9/openstack-tempest:current-podified
8+
storageClass: local-storage
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

zuul.d/jobs.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
---
2+
- job:
3+
name: test-operator-kuttl
4+
parent: cifmw-base-multinode-kuttl
5+
attempts: 1
6+
irrelevant-files: &ir_files
7+
- .*/*.md
8+
- ^\..*$
9+
- ^LICENSE$
10+
- ^OWNERS$
11+
- ^OWNERS_ALIASES$
12+
- ^PROJECT$
13+
- ^README.md$
14+
- tests?\/functional
15+
- ^renovate.json$
16+
vars:
17+
cifmw_kuttl_tests_operator_list:
18+
- test_operator
19+
220
- job:
321
name: podified-multinode-edpm-deployment-crc-test-operator
422
parent: podified-multinode-hci-deployment-crc-1comp-backends

zuul.d/projects.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
- openstack-k8s-operators-content-provider:
77
vars:
88
cifmw_install_yamls_sdk_version: v1.41.1
9+
- test-operator-kuttl:
10+
dependencies:
11+
- openstack-k8s-operators-content-provider
912
- podified-multinode-edpm-deployment-crc-test-operator:
1013
dependencies:
1114
- openstack-k8s-operators-content-provider

0 commit comments

Comments
 (0)