diff --git a/tests/e2e-chainsaw/v1beta2/acl-user/redis-cluster/chainsaw-test.yaml b/tests/e2e-chainsaw/v1beta2/acl-user/redis-cluster/chainsaw-test.yaml index bf84b37ea..3116f1564 100644 --- a/tests/e2e-chainsaw/v1beta2/acl-user/redis-cluster/chainsaw-test.yaml +++ b/tests/e2e-chainsaw/v1beta2/acl-user/redis-cluster/chainsaw-test.yaml @@ -19,95 +19,7 @@ spec: file: cluster.yaml - assert: file: ready-cluster.yaml - - assert: - file: ready-sts.yaml - - assert: - file: ready-svc.yaml - - assert: - file: ready-pvc.yaml - catch: - - description: Redis Operator Logs - podLogs: - namespace: redis-operator-system - selector: control-plane=redis-operator - container: manager - tail: -1 # tail all logs - - name: Ping Cluster Nodes - try: - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-0 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-1 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-2 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-0 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-1 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - name: Check Cluster Slots Coverage - try: - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-0 -- - redis-cli --cluster check 127.0.0.1:6379 | grep 'All 16384 slots covered.' - check: - (contains($stdout, '[OK] All 16384 slots covered')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-1 -- - redis-cli --cluster check 127.0.0.1:6379 | grep 'All 16384 slots covered' - check: - (contains($stdout, '[OK] All 16384 slots covered')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-2 -- - redis-cli --cluster check 127.0.0.1:6379 | grep 'All 16384 slots covered' - check: - (contains($stdout, '[OK] All 16384 slots covered')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-0 -- - redis-cli --cluster check 127.0.0.1:6379 | grep 'All 16384 slots covered' - check: - (contains($stdout, '[OK] All 16384 slots covered')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-1 -- - redis-cli --cluster check 127.0.0.1:6379 | grep 'All 16384 slots covered' - check: - (contains($stdout, '[OK] All 16384 slots covered')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- - redis-cli --cluster check 127.0.0.1:6379 | grep 'All 16384 slots covered' - check: - (contains($stdout, '[OK] All 16384 slots covered')): true + - name: Try saving a key With Password try: - script: diff --git a/tests/e2e-chainsaw/v1beta2/ha-setup/secured/partially-secured/replication-password/chainsaw-test.yaml b/tests/e2e-chainsaw/v1beta2/ha-setup/secured/partially-secured/replication-password/chainsaw-test.yaml deleted file mode 100644 index faa07b644..000000000 --- a/tests/e2e-chainsaw/v1beta2/ha-setup/secured/partially-secured/replication-password/chainsaw-test.yaml +++ /dev/null @@ -1,55 +0,0 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: Test -metadata: - name: redis-ha-setup-partial-secured-replication -spec: - steps: - - try: - - create: - file: secret.yaml - - assert: - file: secret.yaml - - apply: - file: replication.yaml - - assert: - file: ready-replication-sts.yaml - - assert: - file: ready-replication-svc.yaml - - assert: - file: ready-replication-pvc.yaml - - create: - file: password.yaml - - apply: - file: sentinel.yaml - - assert: - file: ready-sentinel-sts.yaml - - assert: - file: ready-sentinel-svc.yaml - - create: - file: cli-pod.yaml - - assert: - file: cli-pod.yaml - - - name: Sleep for five minutes - try: - - sleep: - duration: 5m - - - name: Ping Replicated Service from Cli Pod - try: - - script: - timeout: 10s - content: | - kubectl exec --namespace ${NAMESPACE} redis -- redis-cli -h redis-replication.${NAMESPACE}.svc -p 6379 -a Opstree@1234 ping - check: - (contains($stdout, 'PONG')): true - - name: Ping Sentinel Service from Cli Pod - try: - - script: - timeout: 10s - content: | - kubectl exec --namespace ${NAMESPACE} redis -- redis-cli -h redis-sentinel-sentinel.${NAMESPACE}.svc -p 26379 ping - check: - (contains($stdout, 'PONG')): true diff --git a/tests/e2e-chainsaw/v1beta2/ha-setup/unsecured/chainsaw-test.yaml b/tests/e2e-chainsaw/v1beta2/ha-setup/unsecured/chainsaw-test.yaml deleted file mode 100644 index 8dd70568a..000000000 --- a/tests/e2e-chainsaw/v1beta2/ha-setup/unsecured/chainsaw-test.yaml +++ /dev/null @@ -1,49 +0,0 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: Test -metadata: - name: redis-ha-setup-unsecured -spec: - steps: - - try: - - apply: - file: replication.yaml - - assert: - file: ready-replication-sts.yaml - - assert: - file: ready-replication-svc.yaml - - assert: - file: ready-replication-pvc.yaml - - apply: - file: sentinel.yaml - - assert: - file: ready-sentinel-sts.yaml - - assert: - file: ready-sentinel-svc.yaml - - create: - file: cli-pod.yaml - - assert: - file: cli-pod.yaml - - - name: Sleep for five minutes - try: - - sleep: - duration: 5m - - - name: Ping Replicated Service from Cli Pod - try: - - script: - timeout: 10s - content: | - kubectl exec --namespace ${NAMESPACE} redis -- redis-cli -h redis-replication.${NAMESPACE}.svc -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - name: Ping Sentinel Service from Cli Pod - try: - - script: - timeout: 10s - content: | - kubectl exec --namespace ${NAMESPACE} redis -- redis-cli -h redis-sentinel-sentinel.${NAMESPACE}.svc -p 26379 ping - check: - (contains($stdout, 'PONG')): true diff --git a/tests/e2e-chainsaw/v1beta2/hostnetwork/redis-cluster/chainsaw-test.yaml b/tests/e2e-chainsaw/v1beta2/hostnetwork/redis-cluster/chainsaw-test.yaml deleted file mode 100644 index b2c9a1708..000000000 --- a/tests/e2e-chainsaw/v1beta2/hostnetwork/redis-cluster/chainsaw-test.yaml +++ /dev/null @@ -1,150 +0,0 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: Test -metadata: - name: host-network -spec: - steps: - - name: Setup redis cluster on host network - try: - - apply: - file: cluster.yaml - - assert: - file: ready-cluster.yaml - - assert: - file: ready-sts.yaml - - assert: - file: ready-svc.yaml - - assert: - file: ready-pvc.yaml - - assert: - file: ready-pod.yaml - - - name: Install Redis Cli - try: - - script: - timeout: 5m - content: | - sudo apt install redis-tools -y - - - name: Ping Redis Cluster from every node - try: - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 1 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 ping - check: - (contains($stdout, 'PONG')): true - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 2 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 ping - check: - (contains($stdout, 'PONG')): true - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 3 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 ping - check: - (contains($stdout, 'PONG')): true - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 4 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 ping - check: - (contains($stdout, 'PONG')): true - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 5 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 ping - check: - (contains($stdout, 'PONG')): true - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 6 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 ping - check: - (contains($stdout, 'PONG')): true - - name: Curl Exporter from every node - try: - - script: - timeout: 30s - content: > - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 1 | tail -n 1 | - xargs -I {} curl -s http://{}:9122/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true - - script: - timeout: 30s - content: > - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 2 | tail -n 1 | - xargs -I {} curl -s http://{}:9122/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true - - script: - timeout: 30s - content: > - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 3 | tail -n 1 | - xargs -I {} curl -s http://{}:9122/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true - - script: - timeout: 30s - content: > - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 4 | tail -n 1 | - xargs -I {} curl -s http://{}:9122/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true - - script: - timeout: 30s - content: > - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 5 | tail -n 1 | - xargs -I {} curl -s http://{}:9122/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true - - script: - timeout: 30s - content: > - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 6 | tail -n 1 | - xargs -I {} curl -s http://{}:9122/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true - - name: Try saving a key from every node - try: - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 1 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 set foo-0 bar-0 - check: - (contains($stdout, 'OK')): true - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 2 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 set foo-1 bar-1 - check: - (contains($stdout, 'OK')): true - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 3 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 set foo-2 bar-2 - check: - (contains($stdout, 'OK')): true - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 4 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 set foo-3 bar-3 - check: - (contains($stdout, 'OK')): true - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 5 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 set foo-4 bar-4 - check: - (contains($stdout, 'OK')): true - - script: - timeout: 30s - content: | - kubectl get node -o wide | grep 'worker' | awk '{print $6}' | head -n 6 | tail -n 1 | xargs -I {} redis-cli -h {} -c -p 6380 set foo-5 bar-5 - check: - (contains($stdout, 'OK')): true diff --git a/tests/e2e-chainsaw/v1beta2/nodeport/redis-cluster/chainsaw-test.yaml b/tests/e2e-chainsaw/v1beta2/nodeport/redis-cluster/chainsaw-test.yaml index cc4fe22e1..3473eb09a 100644 --- a/tests/e2e-chainsaw/v1beta2/nodeport/redis-cluster/chainsaw-test.yaml +++ b/tests/e2e-chainsaw/v1beta2/nodeport/redis-cluster/chainsaw-test.yaml @@ -12,76 +12,7 @@ spec: file: cluster.yaml - assert: file: ready-cluster.yaml - - assert: - file: ready-sts.yaml - - assert: - file: ready-svc.yaml - - assert: - file: ready-pvc.yaml - - name: Ping Cluster - try: - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-0 -- redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-1 -- redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-2 -- redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-0 -- redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-1 -- redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - name: Check Cluster - try: - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-0 -- redis-cli --cluster check 127.0.0.1:6379 - check: - (contains($stdout, '[OK] All 16384 slots covered.')): true - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-1 -- redis-cli --cluster check 127.0.0.1:6379 - check: - (contains($stdout, '[OK] All 16384 slots covered.')): true - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-2 -- redis-cli --cluster check 127.0.0.1:6379 - check: - (contains($stdout, '[OK] All 16384 slots covered.')): true - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-0 -- redis-cli --cluster check 127.0.0.1:6379 - check: - (contains($stdout, '[OK] All 16384 slots covered.')): true - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-1 -- redis-cli --cluster check 127.0.0.1:6379 - check: - (contains($stdout, '[OK] All 16384 slots covered.')): true - - script: - content: | - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- redis-cli --cluster check 127.0.0.1:6379 - check: - (contains($stdout, '[OK] All 16384 slots covered.')): true + - name: Try saving a key With Password try: - script: diff --git a/tests/e2e-chainsaw/v1beta2/password/redis-cluster/chainsaw-test.yaml b/tests/e2e-chainsaw/v1beta2/password/redis-cluster/chainsaw-test.yaml deleted file mode 100644 index 7f27618d0..000000000 --- a/tests/e2e-chainsaw/v1beta2/password/redis-cluster/chainsaw-test.yaml +++ /dev/null @@ -1,243 +0,0 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: Test -metadata: - name: redis-cluster-password -spec: - steps: - - try: - - apply: - file: cluster.yaml - - apply: - file: secret.yaml - - assert: - file: ready-cluster.yaml - - assert: - file: ready-sts.yaml - - assert: - file: ready-svc.yaml - - assert: - file: ready-pvc.yaml - - assert: - file: secret.yaml - - name: Ping Cluster With Password - try: - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-0 -- - redis-cli -c -p 6379 -a Opstree1234 ping - check: - (contains($stdout, 'PONG')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-1 -- - redis-cli -c -p 6379 -a Opstree1234 ping - check: - (contains($stdout, 'PONG')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-2 -- - redis-cli -c -p 6379 -a Opstree1234 ping - check: - (contains($stdout, 'PONG')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-0 -- - redis-cli -c -p 6379 -a Opstree1234 ping - check: - (contains($stdout, 'PONG')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-1 -- - redis-cli -c -p 6379 -a Opstree1234 ping - check: - (contains($stdout, 'PONG')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- - redis-cli -c -p 6379 -a Opstree1234 ping - check: - (contains($stdout, 'PONG')): true - - name: Try saving a key With Password - try: - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-0 -- - redis-cli -c -p 6379 -a Opstree1234 set foo-0 bar-0 - check: - (contains($stdout, 'OK')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-1 -- - redis-cli -c -p 6379 -a Opstree1234 set foo-1 bar-1 - check: - (contains($stdout, 'OK')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-2 -- - redis-cli -c -p 6379 -a Opstree1234 set foo-2 bar-2 - check: - (contains($stdout, 'OK')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-0 -- - redis-cli -c -p 6379 -a Opstree1234 set foo-3 bar-3 - check: - (contains($stdout, 'OK')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-1 -- - redis-cli -c -p 6379 -a Opstree1234 set foo-4 bar-4 - check: - (contains($stdout, 'OK')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- - redis-cli -c -p 6379 -a Opstree1234 set foo-5 bar-5 - check: - (contains($stdout, 'OK')): true - - name: Ping Cluster Without Password - try: - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-0 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-1 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-2 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-0 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-1 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - name: Try saving a key Without Password - try: - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-0 -- - redis-cli -c -p 6379 set foo-0 bar-0 - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-1 -- - redis-cli -c -p 6379 set foo-1 bar-1 - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-2 -- - redis-cli -c -p 6379 set foo-2 bar-2 - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-0 -- - redis-cli -c -p 6379 set foo-3 bar-3 - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-1 -- - redis-cli -c -p 6379 set foo-4 bar-4 - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - script: - timeout: 10s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- - redis-cli -c -p 6379 set foo-5 bar-5 - check: - (contains($stdout, 'NOAUTH Authentication required')): true - - name: Test Redis Exporter - try: - - script: - timeout: 30s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-0 -- - wget -qO- http://localhost:9121/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true - - script: - timeout: 30s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-1 -- - wget -qO- http://localhost:9121/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true - - script: - timeout: 30s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-2 -- - wget -qO- http://localhost:9121/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true - - script: - timeout: 30s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-0 -- - wget -qO- http://localhost:9121/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true - - script: - timeout: 30s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-1 -- - wget -qO- http://localhost:9121/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true - - script: - timeout: 30s - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- - wget -qO- http://localhost:9121/metrics | grep -v '^#' | grep -E '\bredis_up\b' | awk '{print $2}' - check: - (contains($stdout, '1')): true diff --git a/tests/e2e-chainsaw/v1beta2/setup/redis-cluster/chainsaw-test.yaml b/tests/e2e-chainsaw/v1beta2/setup/redis-cluster/chainsaw-test.yaml index 052a714f3..b084d7460 100644 --- a/tests/e2e-chainsaw/v1beta2/setup/redis-cluster/chainsaw-test.yaml +++ b/tests/e2e-chainsaw/v1beta2/setup/redis-cluster/chainsaw-test.yaml @@ -19,52 +19,10 @@ spec: file: ready-svc.yaml - assert: file: ready-pvc.yaml - catch: - - description: Redis Operator Logs - podLogs: - namespace: redis-operator-system - selector: control-plane=redis-operator - container: manager - tail: -1 # tail all logs - - name: Ping Cluster - try: - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-0 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-1 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-leader redis-cluster-v1beta2-leader-2 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-0 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-1 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - script: - content: > - kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- - redis-cli -c -p 6379 ping - check: - (contains($stdout, 'PONG')): true - - name: Try saving a key With Password + - assert: + file: secret.yaml + + - name: Check Redis GET/SET try: - script: timeout: 30s