Skip to content

Commit

Permalink
Test (#659)
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Gupta <[email protected]>
  • Loading branch information
shubham-cmyk authored Oct 6, 2023
1 parent 667ceae commit 5b14d94
Show file tree
Hide file tree
Showing 8 changed files with 198 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ testbin/*
*~
.vscode

docs/build
docs/build
kubeconfig
2 changes: 2 additions & 0 deletions tests/_config/kuttl-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ startKIND: false
kindConfig: "./kind-config.yaml"
parallel: 1
timeout: 300
testDirs:
- tests/e2e/v1beta2/setup
suppress :
- events
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ apply :
- cluster.yaml
assert :
- ready-cluster.yaml
- ready-cluster-sts.yaml
- ready-cluster-sts.yaml
- ready-pvc.yaml
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: RedisCluster
metadata:
name: redis-cluster-v1beta2
status:
# readyFollowerReplicas: 3
readyFollowerReplicas: 3
readyLeaderReplicas: 3
181 changes: 181 additions & 0 deletions tests/e2e/v1beta2/setup/redis-cluster/ready-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: node-conf-redis-cluster-v1beta2-leader-0
labels:
app: redis-cluster-v1beta2-leader
redis_setup_type: cluster
role: leader
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: node-conf-redis-cluster-v1beta2-leader-1
labels:
app: redis-cluster-v1beta2-leader
redis_setup_type: cluster
role: leader
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: node-conf-redis-cluster-v1beta2-leader-2
labels:
app: redis-cluster-v1beta2-leader
redis_setup_type: cluster
role: leader
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: node-conf-redis-cluster-v1beta2-follower-0
labels:
app: redis-cluster-v1beta2-follower
redis_setup_type: cluster
role: follower
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: node-conf-redis-cluster-v1beta2-follower-1
labels:
app: redis-cluster-v1beta2-follower
redis_setup_type: cluster
role: follower
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: node-conf-redis-cluster-v1beta2-follower-2
labels:
app: redis-cluster-v1beta2-follower
redis_setup_type: cluster
role: follower
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-cluster-v1beta2-leader-redis-cluster-v1beta2-leader-0
labels:
app: redis-cluster-v1beta2-leader
redis_setup_type: cluster
role: leader
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-cluster-v1beta2-leader-redis-cluster-v1beta2-leader-1
labels:
app: redis-cluster-v1beta2-leader
redis_setup_type: cluster
role: leader
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-cluster-v1beta2-leader-redis-cluster-v1beta2-leader-2
labels:
app: redis-cluster-v1beta2-leader
redis_setup_type: cluster
role: leader
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-cluster-v1beta2-follower-redis-cluster-v1beta2-follower-0
labels:
app: redis-cluster-v1beta2-follower
redis_setup_type: cluster
role: follower
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-cluster-v1beta2-follower-redis-cluster-v1beta2-follower-1
labels:
app: redis-cluster-v1beta2-follower
redis_setup_type: cluster
role: follower
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-cluster-v1beta2-follower-redis-cluster-v1beta2-follower-2
labels:
app: redis-cluster-v1beta2-follower
redis_setup_type: cluster
role: follower
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
phase: Bound
12 changes: 10 additions & 2 deletions tests/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Ensure you have the following tools installed:
Create a 3-node kind cluster using the provided configuration:

```bash
kind create cluster --config /redis-operator/tests/_config/kind-config.yaml
kind create cluster --config tests/_config/kind-config.yaml
```

### 2. Install the Redis Operator
Expand All @@ -35,6 +35,14 @@ Please refer to the repository's README for detailed instructions on installing

Execute the kuttl test using the following command:

To run all default tests ( _config/kuttl-test.yaml is the default config file )

```bash
kubectl kuttl test --config tests/_config/kuttl-test.yaml
```

To run a test at specified path

```bash
kubectl kuttl test redis-operator/tests/e2e/v1beta2 --config /redis-operator/tests/_config/kuttl-test.yaml --timeout 600
kubectl kuttl test tests/e2e/v1beta2 --config tests/_config/kuttl-test.yaml --timeout 600
```

0 comments on commit 5b14d94

Please sign in to comment.