Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
egegunes committed Jan 11, 2025
1 parent 015a472 commit fb7b682
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
55 changes: 55 additions & 0 deletions e2e-tests/preinit-updates/conf/some-name.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: psmdb.percona.com/v1
kind: PerconaServerMongoDB
metadata:
name: some-name
spec:
#platform: openshift
image:
imagePullPolicy: Always
allowUnsafeConfigurations: false
updateStrategy: SmartUpdate
backup:
enabled: false
image: perconalab/percona-server-mongodb-operator:0.4.0-backup
replsets:
- name: rs0
# readinessDelaySec: 40
# livenessDelaySec: 120
affinity:
antiAffinityTopologyKey: none
resources:
limits:
cpu: 500m
memory: 0.5G
requests:
cpu: 100m
memory: 0.1G
configuration: |
operationProfiling:
mode: slowOp
slowOpThresholdMs: 100
security:
enableEncryption: true
redactClientLogData: false
setParameter:
ttlMonitorSleepSecs: 60
wiredTigerConcurrentReadTransactions: 128
wiredTigerConcurrentWriteTransactions: 128
storage:
engine: wiredTiger
wiredTiger:
collectionConfig:
blockCompressor: snappy
engineConfig:
directoryForIndexes: false
journalCompressor: snappy
indexConfig:
prefixCompression: true
volumeSpec:
persistentVolumeClaim:
resources:
requests:
storage: 1Gi
size: 3
secrets:
users: some-users
28 changes: 28 additions & 0 deletions e2e-tests/preinit-updates/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -o errexit

test_dir=$(realpath $(dirname $0))
. ${test_dir}/../functions
set_debug

create_infra ${namespace}

cluster="some-name"
desc "test starts on cluster: ${cluster}"

apply_cluster ${test_dir}/conf/${cluster}.yml
wait_for_running ${cluster}-rs0 1 "false"
echo "enabling backups"
kubectl_bin patch psmdb ${cluster} --type=merge -p '{"spec":{"backup":{"enabled":true}}}'
echo "sleeping for 7 seconds..."
sleep 7
echo "changing rs0 resources"
kubectl_bin patch psmdb ${cluster} --type=json -p '[{"op":"replace","path":"/spec/replsets/0/resources/limits/cpu","value":"550m"}]'

wait_for_running ${cluster}-rs0 3
wait_cluster_consistency "${cluster}"

desc 'test passed'

destroy $namespace
1 change: 1 addition & 0 deletions e2e-tests/run-pr.csv
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ operator-self-healing-chaos
pitr
pitr-sharded
pitr-physical
preinit-updates
pvc-resize
recover-no-primary
replset-overrides
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/run-release.csv
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ operator-self-healing-chaos
pitr
pitr-sharded
pitr-physical
preinit-updates
pvc-resize
recover-no-primary
replset-overrides
Expand Down

0 comments on commit fb7b682

Please sign in to comment.