Skip to content

Commit

Permalink
Merge pull request #41 from jparoly/kuttl_2
Browse files Browse the repository at this point in the history
Add kuttl tests
  • Loading branch information
openshift-merge-robot authored Aug 14, 2023
2 parents f25db2c + 814867d commit 9ae5a51
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 5 deletions.
5 changes: 0 additions & 5 deletions config/samples/swift_v1beta1_swift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ spec:
replicas: 1
passwordSelectors:
service: SwiftPassword
containerImageAccount: quay.io/podified-antelope-centos9/openstack-swift-account:current-podified
containerImageContainer: quay.io/podified-antelope-centos9/openstack-swift-container:current-podified
containerImageObject: quay.io/podified-antelope-centos9/openstack-swift-object:current-podified
containerImageProxy: quay.io/podified-antelope-centos9/openstack-swift-proxy-server:current-podified
containerImageMemcached: quay.io/podified-antelope-centos9/openstack-memcached:current-podified
25 changes: 25 additions & 0 deletions kuttl-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# EXECUTION (from install_yamls repo root):
#
# make swift_kuttl
#
# ASSUMPTIONS:
#
# 1. Latest version of kuttl is installed at /usr/local/bin/kubectl-kuttl
# - wget https://github.com/kudobuilder/kuttl/releases/download/v0.11.1/kubectl-kuttl_0.11.1_linux_x86_64
# - mv kubectl-kuttl_0.11.1_linux_x86_64 /usr/local/bin/kubectl-kuttl
# - chmod 755 /usr/local/bin/kubectl-kuttl
# 2. An OCP 4.10+ CRC cluster with Podified Operators has been deployed
# 3. CLI user has access to $KUBECONFIG
# 4. The environment variable INSTALL_YAMLS is set to the the path of the
# install_yamls repo

apiVersion: kuttl.dev/v1beta1
kind: TestSuite
reportFormat: JSON
reportName: kuttl-test-swift
namespace: swift-kuttl-tests
timeout: 600
parallel: 1
suppress:
- events # Remove spammy event logs
54 changes: 54 additions & 0 deletions tests/kuttl/tests/basic-deploy/01-assert-deploy-swift.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: swift.openstack.org/v1beta1
kind: Swift
metadata:
name: swift
spec:
swiftRing:
ringReplicas: 1
containerImage: quay.io/podified-antelope-centos9/openstack-swift-proxy-server:current-podified
swiftStorage:
storageClass: local-storage
replicas: 1
containerImageAccount: quay.io/podified-antelope-centos9/openstack-swift-account:current-podified
containerImageContainer: quay.io/podified-antelope-centos9/openstack-swift-container:current-podified
containerImageObject: quay.io/podified-antelope-centos9/openstack-swift-object:current-podified
containerImageProxy: quay.io/podified-antelope-centos9/openstack-swift-proxy-server:current-podified
containerImageMemcached: quay.io/podified-antelope-centos9/openstack-memcached:current-podified
swiftProxy:
replicas: 1
passwordSelectors:
service: SwiftPassword
status:
conditions:
- message: Setup complete
reason: Ready
status: "True"
type: Ready
- message: RoleBinding created
reason: Ready
status: "True"
type: RoleBindingReady
- message: Role created
reason: Ready
status: "True"
type: RoleReady
- message: ServiceAccount created
reason: Ready
status: "True"
type: ServiceAccountReady
- message: Service config create completed
reason: Ready
status: "True"
type: ServiceConfigReady
- message: Setup complete
reason: Ready
status: "True"
type: SwiftProxyReady
- message: Setup complete
reason: Ready
status: "True"
type: SwiftRingReady
- message: Setup complete
reason: Ready
status: "True"
type: SwiftStorageReady
5 changes: 5 additions & 0 deletions tests/kuttl/tests/basic-deploy/01-deploy-swift.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
oc apply -n $NAMESPACE -f ../../../../config/samples/swift_v1beta1_swift.yaml
9 changes: 9 additions & 0 deletions tests/kuttl/tests/basic-deploy/02-cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
delete:
- apiVersion: swift.openstack.org/v1beta1
kind: Swift
name: swift
commands:
- script: |
oc delete --ignore-not-found=true -n $NAMESPACE pvc srv-swift-storage-0
15 changes: 15 additions & 0 deletions tests/kuttl/tests/basic-deploy/02-errors-cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: swift.openstack.org/v1beta1
kind: Swift
metadata:
name: swift
---
apiVersion: v1
kind: Pod
metadata:
labels:
app.kubernetes.io/name: SwiftProxy
---
apiVersion: v1
kind: Pod
metadata:
name: swift-storage-0

0 comments on commit 9ae5a51

Please sign in to comment.