Skip to content

Commit 5d2e27b

Browse files
eleo007horsgithub-actions[bot]
authored
K8SPSMDB-1292: set requireTLS for physical restore tests (#2018)
* K8SPSMDB-1292: set requireTLS for physical restore tests * Update e2e-tests/functions Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Viacheslav Sarzhan <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 70e9bc1 commit 5d2e27b

12 files changed

+72
-31
lines changed

e2e-tests/demand-backup-physical-minio/compare/statefulset_some-name-rs0_restore-arbiter-nv-oc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
- --relaxPermChecks
5252
- --sslAllowInvalidCertificates
5353
- --clusterAuthMode=x509
54-
- --tlsMode=preferTLS
54+
- --tlsMode=requireTLS
5555
- --enableEncryption
5656
- --encryptionKeyFile=/etc/mongodb-encryption/encryption-key
5757
- --wiredTigerCacheSizeGB=0.25

e2e-tests/demand-backup-physical-minio/compare/statefulset_some-name-rs0_restore-arbiter-nv.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
- --relaxPermChecks
5252
- --sslAllowInvalidCertificates
5353
- --clusterAuthMode=x509
54-
- --tlsMode=preferTLS
54+
- --tlsMode=requireTLS
5555
- --enableEncryption
5656
- --encryptionKeyFile=/etc/mongodb-encryption/encryption-key
5757
- --wiredTigerCacheSizeGB=0.25

e2e-tests/demand-backup-physical-minio/compare/statefulset_some-name-rs0_restore-oc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
- --relaxPermChecks
5252
- --sslAllowInvalidCertificates
5353
- --clusterAuthMode=x509
54-
- --tlsMode=preferTLS
54+
- --tlsMode=requireTLS
5555
- --enableEncryption
5656
- --encryptionKeyFile=/etc/mongodb-encryption/encryption-key
5757
- --wiredTigerCacheSizeGB=0.25

e2e-tests/demand-backup-physical-minio/compare/statefulset_some-name-rs0_restore.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
- --relaxPermChecks
5252
- --sslAllowInvalidCertificates
5353
- --clusterAuthMode=x509
54-
- --tlsMode=preferTLS
54+
- --tlsMode=requireTLS
5555
- --enableEncryption
5656
- --encryptionKeyFile=/etc/mongodb-encryption/encryption-key
5757
- --wiredTigerCacheSizeGB=0.25

e2e-tests/demand-backup-physical-minio/conf/some-name-arbiter-nv.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ spec:
99
image:
1010
imagePullPolicy: Always
1111
updateStrategy: SmartUpdate
12+
tls:
13+
mode: requireTLS
1214
backup:
1315
enabled: true
1416
image: perconalab/percona-server-mongodb-operator:1.1.0-backup

e2e-tests/demand-backup-physical-minio/conf/some-name.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ spec:
99
image:
1010
imagePullPolicy: Always
1111
updateStrategy: SmartUpdate
12+
tls:
13+
mode: requireTLS
1214
backup:
1315
enabled: true
1416
image: perconalab/percona-server-mongodb-operator:1.1.0-backup

e2e-tests/demand-backup-physical-minio/run

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ sleep 60 # give time for resync to start
2727
wait_for_pbm_operations ${cluster}
2828

2929
echo 'Writing test data'
30-
run_mongo \
30+
run_mongo_tls \
3131
'db.createUser({user:"myApp",pwd:"myPass",roles:[{db:"myApp",role:"readWrite"}]})' \
3232
"userAdmin:userAdmin123456@${cluster}-rs0.${namespace}"
3333
sleep 1
34-
run_mongo \
34+
run_mongo_tls \
3535
'use myApp\n db.test.insert({ x: 100500 })' \
3636
"myApp:myPass@${cluster}-rs0.${namespace}"
3737
sleep 5
38-
compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-0.${cluster}-rs0.${namespace}"
39-
compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-1.${cluster}-rs0.${namespace}"
40-
compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-2.${cluster}-rs0.${namespace}"
38+
compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-0.${cluster}-rs0.${namespace}" "" "" "" "" "" "true"
39+
compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-1.${cluster}-rs0.${namespace}" "" "" "" "" "" "true"
40+
compare_mongo_cmd "find" "myApp:myPass@${cluster}-rs0-2.${cluster}-rs0.${namespace}" "" "" "" "" "" "true"
4141

4242
echo 'Running backups'
4343
backup_name_minio="backup-minio"
@@ -46,11 +46,11 @@ wait_backup "${backup_name_minio}"
4646
check_backup_in_storage ${backup_name_minio} minio rs0
4747

4848
echo 'Drop collection'
49-
run_mongo 'use myApp\n db.test.drop()' "myApp:myPass@${cluster}-rs0.${namespace}"
49+
run_mongo_tls 'use myApp\n db.test.drop()' "myApp:myPass@${cluster}-rs0.${namespace}"
5050
echo 'check backup and restore -- minio'
5151
backup_dest_minio=$(get_backup_dest "${backup_name_minio}")
5252
run_restore ${backup_name_minio}
53-
run_recovery_check ${backup_name_minio}
53+
run_recovery_check ${backup_name_minio} "" "" "true"
5454

5555
desc 'Testing with arbiter and non-voting nodes'
5656

@@ -66,11 +66,11 @@ wait_backup "${backup_name_minio}"
6666
check_backup_in_storage ${backup_name_minio} minio rs0
6767

6868
echo 'Drop collection'
69-
run_mongo 'use myApp\n db.test.drop()' "myApp:myPass@${cluster}-rs0.${namespace}"
69+
run_mongo_tls 'use myApp\n db.test.drop()' "myApp:myPass@${cluster}-rs0.${namespace}"
7070
echo 'check backup and restore -- minio'
7171
backup_dest_minio=$(get_backup_dest "${backup_name_minio}")
7272
run_restore ${backup_name_minio}
73-
run_recovery_check ${backup_name_minio} "_restore-arbiter-nv"
73+
run_recovery_check ${backup_name_minio} "_restore-arbiter-nv" "" "true"
7474

7575
destroy "$namespace"
7676

e2e-tests/demand-backup-physical-sharded-minio/compare/statefulset_some-name-rs0_restore_sharded-oc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
- --relaxPermChecks
5252
- --sslAllowInvalidCertificates
5353
- --clusterAuthMode=x509
54-
- --tlsMode=preferTLS
54+
- --tlsMode=requireTLS
5555
- --shardsvr
5656
- --enableEncryption
5757
- --encryptionKeyFile=/etc/mongodb-encryption/encryption-key

e2e-tests/demand-backup-physical-sharded-minio/compare/statefulset_some-name-rs0_restore_sharded.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
- --relaxPermChecks
5252
- --sslAllowInvalidCertificates
5353
- --clusterAuthMode=x509
54-
- --tlsMode=preferTLS
54+
- --tlsMode=requireTLS
5555
- --shardsvr
5656
- --enableEncryption
5757
- --encryptionKeyFile=/etc/mongodb-encryption/encryption-key

e2e-tests/demand-backup-physical-sharded-minio/conf/some-name-sharded.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ spec:
77
image:
88
imagePullPolicy: Always
99
updateStrategy: SmartUpdate
10+
tls:
11+
mode: requireTLS
1012
backup:
1113
enabled: true
1214
image: perconalab/percona-server-mongodb-operator:1.1.0-backup

0 commit comments

Comments
 (0)