Skip to content

Commit

Permalink
chore: adjust backup e2e test cases (#5604)
Browse files Browse the repository at this point in the history
  • Loading branch information
linghan-hub authored Oct 25, 2023
1 parent 0bc5411 commit 0470c13
Show file tree
Hide file tree
Showing 23 changed files with 268 additions and 173 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ else
endif

.PHONY: test-e2e
test-e2e: helm-package render-smoke-testdata-manifests ## Run E2E tests.
test-e2e: helm-package install-s3-csi-driver render-smoke-testdata-manifests ## Run E2E tests.
$(MAKE) -e VERSION=$(VERSION) PROVIDER=$(PROVIDER) REGION=$(REGION) SECRET_ID=$(SECRET_ID) SECRET_KEY=$(SECRET_KEY) INIT_ENV=$(INIT_ENV) TEST_TYPE=$(TEST_TYPE) SKIP_CASE=$(SKIP_CASE) CONFIG_TYPE=$(CONFIG_TYPE) -C test/e2e run

.PHONY: render-smoke-testdata-manifests-local
Expand Down
10 changes: 0 additions & 10 deletions test/e2e/testdata/smoketest/mongodb/09_backup_snapshot.yaml

This file was deleted.

13 changes: 13 additions & 0 deletions test/e2e/testdata/smoketest/mongodb/09_backup_volume_snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: Backup
metadata:
name: backup-mongodb-cluster-snapshot
spec:
backupPolicyName: mongodb-cluster-mongodb-backup-policy
retentionPeriod: 7d
backupMethod: volume-snapshot
deletionPolicy: Delete
status:
duration: 60s
backupRepoName: my-repo
phase: Completed
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# Source: mongodb-cluster/templates/replicaset.yaml
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
name: mongo-cluster-snapshot
annotations:
kubeblocks.io/restore-from-backup: '{"mongodb":{"name":"backup-mongodb-cluster-snapshot","namespace":"default","managementPolicy":"Parallel"}}'
spec:
clusterDefinitionRef: mongodb
clusterVersionRef: mongodb-5.0
terminationPolicy: Halt
affinity:
topologyKeys:
- kubernetes.io/hostname
componentSpecs:
- name: mongodb
componentDefRef: mongodb
monitor: false
replicas: 3
serviceAccountName: kb-mongodb-cluster
volumeClaimTemplates:
- name: data # ref clusterdefinition components.containers.volumeMounts.name
spec:
storageClassName:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 21Gi
13 changes: 13 additions & 0 deletions test/e2e/testdata/smoketest/mongodb/11_backup_datafile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: Backup
metadata:
name: backup-mongodb-cluster
spec:
backupPolicyName: mongodb-cluster-mongodb-backup-policy
retentionPeriod: 7d
backupMethod: datafile
deletionPolicy: Delete
status:
duration: 60s
backupRepoName: my-repo
phase: Completed
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
name: mongocluster-snapshot
name: mongo-cluster-datafile
annotations:
kubeblocks.io/restore-from-backup: "{\"mongodb\":\"backup-snapshot-mongocluster\"}"
kubeblocks.io/restore-from-backup: '{"mongodb":{"name":"backup-mongodb-cluster","namespace":"default","managementPolicy":"Parallel"}}'
spec:
clusterDefinitionRef: mongodb
clusterVersionRef: mongodb-5.0.14
clusterVersionRef: mongodb-5.0
terminationPolicy: Halt
affinity:
topologyKeys:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: kb-pg-cluster
namespace: default
labels:
helm.sh/chart: postgresql-cluster-0.7.0-alpha.0
helm.sh/chart: postgresql-cluster-0.8.0-alpha.0
app.kubernetes.io/version: "14.8.0"
app.kubernetes.io/instance: pg-cluster
---
Expand All @@ -16,7 +16,7 @@ kind: ClusterRoleBinding
metadata:
name: kb-pg-cluster
labels:
helm.sh/chart: postgresql-cluster-0.7.0-alpha.0
helm.sh/chart: postgresql-cluster-0.8.0-alpha.0
app.kubernetes.io/version: "14.8.0"
app.kubernetes.io/instance: pg-cluster
roleRef:
Expand All @@ -34,7 +34,7 @@ kind: RoleBinding
metadata:
name: kb-pg-cluster
labels:
helm.sh/chart: postgresql-cluster-0.7.0-alpha.0
helm.sh/chart: postgresql-cluster-0.8.0-alpha.0
app.kubernetes.io/version: "14.8.0"
app.kubernetes.io/instance: pg-cluster
roleRef:
Expand All @@ -53,7 +53,7 @@ metadata:
name: pg-cluster
namespace: default
labels:
helm.sh/chart: postgresql-cluster-0.7.0-alpha.0
helm.sh/chart: postgresql-cluster-0.8.0-alpha.0
app.kubernetes.io/version: "14.8.0"
app.kubernetes.io/instance: pg-cluster
spec:
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/testdata/smoketest/postgresql/11_backup_basebackup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: Backup
metadata:
name: backup-postgresql-cluster
spec:
backupPolicyName: pg-cluster-postgresql-backup-policy
retentionPeriod: 7d
backupMethod: pg-basebackup
deletionPolicy: Delete
status:
duration: 60s
backupRepoName: my-repo
phase: Completed
10 changes: 0 additions & 10 deletions test/e2e/testdata/smoketest/postgresql/11_backup_snapshot.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# Source: postgresql-cluster/templates/cluster.yaml
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
name: pg-cluster-snapshot
annotations:
kubeblocks.io/restore-from-backup: '{"postgresql":{"name":"backup-postgresql-cluster","namespace":"default","managementPolicy":"Parallel"}}'
spec:
clusterDefinitionRef: postgresql
clusterVersionRef: postgresql-14.7.2-latest
terminationPolicy: WipeOut
componentSpecs:
- name: postgresql
componentDefRef: postgresql
serviceAccountName: kb-mycluster-pgcluster
monitor: false
replicas: 1
volumeClaimTemplates:
- name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 21Gi
112 changes: 0 additions & 112 deletions test/e2e/testdata/smoketest/postgresql/12_backup_snapshot_restore.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: Backup
metadata:
name: backup-postgresql-cluster-snapshot
spec:
backupPolicyName: pg-cluster-postgresql-backup-policy
retentionPeriod: 7d
backupMethod: volume-snapshot
deletionPolicy: Delete
status:
duration: 60s
backupRepoName: my-repo
phase: Completed
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# Source: postgresql-cluster/templates/cluster.yaml
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
name: pg-cluster-snapshot
annotations:
kubeblocks.io/restore-from-backup: '{"postgresql":{"name":"backup-postgresql-cluster-snapshot","namespace":"default","managementPolicy":"Parallel"}}'
spec:
clusterDefinitionRef: postgresql
clusterVersionRef: postgresql-14.7.2-latest
terminationPolicy: WipeOut
componentSpecs:
- name: postgresql
componentDefRef: postgresql
serviceAccountName: kb-mycluster-pgcluster
monitor: false
replicas: 1
volumeClaimTemplates:
- name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 21Gi
10 changes: 0 additions & 10 deletions test/e2e/testdata/smoketest/redis/09_backup_snapshot.yaml

This file was deleted.

13 changes: 13 additions & 0 deletions test/e2e/testdata/smoketest/redis/09_backup_volume_snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: Backup
metadata:
name: backup-redis-cluster-snapshot
spec:
backupPolicyName: redis-cluster-redis-backup-policy
retentionPeriod: 7d
backupMethod: volume-snapshot
deletionPolicy: Delete
status:
duration: 60s
backupRepoName: my-repo
phase: Completed
Loading

0 comments on commit 0470c13

Please sign in to comment.