move common-test to test-chart and use it when present
This commit is contained in:
@@ -1,110 +0,0 @@
|
||||
suite: volsync replication dest metadata test
|
||||
templates:
|
||||
- common.yaml
|
||||
chart:
|
||||
appVersion: &appVer v9.9.9
|
||||
release:
|
||||
name: test-release-name
|
||||
namespace: test-release-namespace
|
||||
tests:
|
||||
- it: should pass with replication dest created with labels and annotations
|
||||
set:
|
||||
label1: label1
|
||||
label2: global_label2
|
||||
annotation1: annotation1
|
||||
annotation2: global_annotation2
|
||||
global:
|
||||
labels:
|
||||
g_label1: global_label1
|
||||
g_label2: "{{ .Values.label2 }}"
|
||||
annotations:
|
||||
g_annotation1: global_annotation1
|
||||
g_annotation2: "{{ .Values.annotation2 }}"
|
||||
persistence:
|
||||
destbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup
|
||||
type: restic
|
||||
credentials: mys3
|
||||
src:
|
||||
enabled: false
|
||||
dest:
|
||||
enabled: true
|
||||
labels:
|
||||
label1: "{{ .Values.label1 }}"
|
||||
label2: label2
|
||||
annotations:
|
||||
annotation1: "{{ .Values.annotation1 }}"
|
||||
annotation2: annotation2
|
||||
credentials:
|
||||
mys3:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: some-bucket
|
||||
encrKey: some-key
|
||||
accessKey: some-access-key
|
||||
secretKey: some-secret-key
|
||||
asserts:
|
||||
- documentIndex: &secretDoc 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *secretDoc
|
||||
isAPIVersion:
|
||||
of: v1
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
annotation1: annotation1
|
||||
annotation2: annotation2
|
||||
g_annotation1: global_annotation1
|
||||
g_annotation2: global_annotation2
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app: common-test-1.0.0
|
||||
release: test-release-name
|
||||
helm-revision: "0"
|
||||
helm.sh/chart: common-test-1.0.0
|
||||
app.kubernetes.io/name: common-test
|
||||
app.kubernetes.io/instance: test-release-name
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/version: *appVer
|
||||
g_label1: global_label1
|
||||
g_label2: global_label2
|
||||
label1: label1
|
||||
label2: label2
|
||||
- documentIndex: &replicationDestDoc 1
|
||||
isKind:
|
||||
of: ReplicationDestination
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
annotation1: annotation1
|
||||
annotation2: annotation2
|
||||
g_annotation1: global_annotation1
|
||||
g_annotation2: global_annotation2
|
||||
- documentIndex: *replicationDestDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app: common-test-1.0.0
|
||||
release: test-release-name
|
||||
helm-revision: "0"
|
||||
helm.sh/chart: common-test-1.0.0
|
||||
app.kubernetes.io/name: common-test
|
||||
app.kubernetes.io/instance: test-release-name
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/version: *appVer
|
||||
g_label1: global_label1
|
||||
g_label2: global_label2
|
||||
label1: label1
|
||||
label2: label2
|
||||
@@ -1,80 +0,0 @@
|
||||
suite: volsync replication dest name test
|
||||
templates:
|
||||
- common.yaml
|
||||
chart:
|
||||
appVersion: &appVer v9.9.9
|
||||
release:
|
||||
name: test-release-name
|
||||
namespace: test-release-namespace
|
||||
tests:
|
||||
- it: should generate correct name
|
||||
set:
|
||||
persistence:
|
||||
srcbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
src:
|
||||
enabled: false
|
||||
dest:
|
||||
enabled: true
|
||||
- name: mybackup2
|
||||
type: restic
|
||||
credentials: mys3
|
||||
src:
|
||||
enabled: false
|
||||
dest:
|
||||
enabled: true
|
||||
credentials:
|
||||
mys3:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: some-bucket
|
||||
encrKey: some-key
|
||||
accessKey: some-access-key
|
||||
secretKey: some-secret-key
|
||||
asserts:
|
||||
- documentIndex: &secretDoc 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *secretDoc
|
||||
isAPIVersion:
|
||||
of: v1
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-srcbackup-volsync-mybackup1
|
||||
- documentIndex: &replicationDestDoc 1
|
||||
isKind:
|
||||
of: ReplicationDestination
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-srcbackup-mybackup1-dest
|
||||
- documentIndex: &secretDoc 2
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *secretDoc
|
||||
isAPIVersion:
|
||||
of: v1
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-srcbackup-volsync-mybackup2
|
||||
- documentIndex: &replicationDestDoc 3
|
||||
isKind:
|
||||
of: ReplicationDestination
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-srcbackup-mybackup2-dest
|
||||
@@ -1,246 +0,0 @@
|
||||
suite: volsync replication dest spec test
|
||||
templates:
|
||||
- common.yaml
|
||||
chart:
|
||||
appVersion: &appVer v9.9.9
|
||||
release:
|
||||
name: test-release-name
|
||||
namespace: test-release-namespace
|
||||
tests:
|
||||
- it: should generate correct spec
|
||||
set:
|
||||
persistence:
|
||||
destbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
dest:
|
||||
enabled: true
|
||||
src:
|
||||
enabled: false
|
||||
credentials: &credentials
|
||||
mys3:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: some-bucket
|
||||
encrKey: some-key
|
||||
accessKey: some-access-key
|
||||
secretKey: some-secret-key
|
||||
asserts:
|
||||
- documentIndex: &secretDoc 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *secretDoc
|
||||
isAPIVersion:
|
||||
of: v1
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-destbackup-volsync-mybackup1
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: stringData
|
||||
value:
|
||||
AWS_ACCESS_KEY_ID: some-access-key
|
||||
AWS_SECRET_ACCESS_KEY: some-secret-key
|
||||
RESTIC_PASSWORD: some-key
|
||||
RESTIC_REPOSITORY: s3:some-url/some-bucket/test-release-name/volsync/destbackup-volsync-mybackup1
|
||||
- documentIndex: &replicationDestDoc 1
|
||||
isKind:
|
||||
of: ReplicationDestination
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
trigger:
|
||||
manual: restore-once
|
||||
restic:
|
||||
repository: test-release-name-common-test-destbackup-volsync-mybackup1
|
||||
copyMethod: Snapshot
|
||||
capacity: 100Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
moverSecurityContext:
|
||||
fsGroup: 568
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
|
||||
- it: should generate correct spec with changed defaults
|
||||
set:
|
||||
persistence:
|
||||
destbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
copyMethod: Clone
|
||||
dest:
|
||||
enabled: true
|
||||
capacity: 200Gi
|
||||
src:
|
||||
enabled: false
|
||||
credentials: *credentials
|
||||
asserts:
|
||||
- documentIndex: *replicationDestDoc
|
||||
isKind:
|
||||
of: ReplicationDestination
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
trigger:
|
||||
manual: restore-once
|
||||
restic:
|
||||
repository: test-release-name-common-test-destbackup-volsync-mybackup1
|
||||
copyMethod: Clone
|
||||
capacity: 200Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
moverSecurityContext:
|
||||
fsGroup: 568
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
|
||||
- it: should generate correct spec with storageClassName
|
||||
set:
|
||||
persistence:
|
||||
destbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
copyMethod: Clone
|
||||
dest:
|
||||
enabled: true
|
||||
storageClassName: somestorageclass
|
||||
src:
|
||||
enabled: false
|
||||
credentials: *credentials
|
||||
asserts:
|
||||
- documentIndex: *replicationDestDoc
|
||||
isKind:
|
||||
of: ReplicationDestination
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
trigger:
|
||||
manual: restore-once
|
||||
restic:
|
||||
repository: test-release-name-common-test-destbackup-volsync-mybackup1
|
||||
copyMethod: Clone
|
||||
capacity: 100Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: somestorageclass
|
||||
moverSecurityContext:
|
||||
fsGroup: 568
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
|
||||
- it: should generate correct spec with volumeSnapshotClass
|
||||
set:
|
||||
persistence:
|
||||
destbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
copyMethod: Clone
|
||||
dest:
|
||||
enabled: true
|
||||
volumeSnapshotClassName: somevsc
|
||||
src:
|
||||
enabled: false
|
||||
credentials: *credentials
|
||||
asserts:
|
||||
- documentIndex: *replicationDestDoc
|
||||
isKind:
|
||||
of: ReplicationDestination
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
trigger:
|
||||
manual: restore-once
|
||||
restic:
|
||||
repository: test-release-name-common-test-destbackup-volsync-mybackup1
|
||||
copyMethod: Clone
|
||||
capacity: 100Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeSnapshotClassName: somevsc
|
||||
moverSecurityContext:
|
||||
fsGroup: 568
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
|
||||
- it: should generate correct spec with volumeSnapshotClass and StorageClass
|
||||
set:
|
||||
persistence:
|
||||
destbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
copyMethod: Clone
|
||||
dest:
|
||||
enabled: true
|
||||
storageClassName: somestorageclass
|
||||
volumeSnapshotClassName: somevsc
|
||||
src:
|
||||
enabled: false
|
||||
credentials: *credentials
|
||||
asserts:
|
||||
- documentIndex: *replicationDestDoc
|
||||
isKind:
|
||||
of: ReplicationDestination
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
trigger:
|
||||
manual: restore-once
|
||||
restic:
|
||||
repository: test-release-name-common-test-destbackup-volsync-mybackup1
|
||||
copyMethod: Clone
|
||||
capacity: 100Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: somestorageclass
|
||||
volumeSnapshotClassName: somevsc
|
||||
moverSecurityContext:
|
||||
fsGroup: 568
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
@@ -1,110 +0,0 @@
|
||||
suite: volsync replication source metadata test
|
||||
templates:
|
||||
- common.yaml
|
||||
chart:
|
||||
appVersion: &appVer v9.9.9
|
||||
release:
|
||||
name: test-release-name
|
||||
namespace: test-release-namespace
|
||||
tests:
|
||||
- it: should pass with replication source created with labels and annotations
|
||||
set:
|
||||
label1: label1
|
||||
label2: global_label2
|
||||
annotation1: annotation1
|
||||
annotation2: global_annotation2
|
||||
global:
|
||||
labels:
|
||||
g_label1: global_label1
|
||||
g_label2: "{{ .Values.label2 }}"
|
||||
annotations:
|
||||
g_annotation1: global_annotation1
|
||||
g_annotation2: "{{ .Values.annotation2 }}"
|
||||
persistence:
|
||||
srcbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup
|
||||
type: restic
|
||||
credentials: mys3
|
||||
src:
|
||||
enabled: true
|
||||
dest:
|
||||
enabled: false
|
||||
labels:
|
||||
label1: "{{ .Values.label1 }}"
|
||||
label2: label2
|
||||
annotations:
|
||||
annotation1: "{{ .Values.annotation1 }}"
|
||||
annotation2: annotation2
|
||||
credentials:
|
||||
mys3:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: some-bucket
|
||||
encrKey: some-key
|
||||
accessKey: some-access-key
|
||||
secretKey: some-secret-key
|
||||
asserts:
|
||||
- documentIndex: &secretDoc 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *secretDoc
|
||||
isAPIVersion:
|
||||
of: v1
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
annotation1: annotation1
|
||||
annotation2: annotation2
|
||||
g_annotation1: global_annotation1
|
||||
g_annotation2: global_annotation2
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app: common-test-1.0.0
|
||||
release: test-release-name
|
||||
helm-revision: "0"
|
||||
helm.sh/chart: common-test-1.0.0
|
||||
app.kubernetes.io/name: common-test
|
||||
app.kubernetes.io/instance: test-release-name
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/version: *appVer
|
||||
g_label1: global_label1
|
||||
g_label2: global_label2
|
||||
label1: label1
|
||||
label2: label2
|
||||
- documentIndex: &replicationSourceDoc 1
|
||||
isKind:
|
||||
of: ReplicationSource
|
||||
- documentIndex: *replicationSourceDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationSourceDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
annotation1: annotation1
|
||||
annotation2: annotation2
|
||||
g_annotation1: global_annotation1
|
||||
g_annotation2: global_annotation2
|
||||
- documentIndex: *replicationSourceDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app: common-test-1.0.0
|
||||
release: test-release-name
|
||||
helm-revision: "0"
|
||||
helm.sh/chart: common-test-1.0.0
|
||||
app.kubernetes.io/name: common-test
|
||||
app.kubernetes.io/instance: test-release-name
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/version: *appVer
|
||||
g_label1: global_label1
|
||||
g_label2: global_label2
|
||||
label1: label1
|
||||
label2: label2
|
||||
@@ -1,80 +0,0 @@
|
||||
suite: volsync replication source name test
|
||||
templates:
|
||||
- common.yaml
|
||||
chart:
|
||||
appVersion: &appVer v9.9.9
|
||||
release:
|
||||
name: test-release-name
|
||||
namespace: test-release-namespace
|
||||
tests:
|
||||
- it: should generate correct name
|
||||
set:
|
||||
persistence:
|
||||
srcbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
src:
|
||||
enabled: true
|
||||
dest:
|
||||
enabled: false
|
||||
- name: mybackup2
|
||||
type: restic
|
||||
credentials: mys3
|
||||
src:
|
||||
enabled: true
|
||||
dest:
|
||||
enabled: false
|
||||
credentials:
|
||||
mys3:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: some-bucket
|
||||
encrKey: some-key
|
||||
accessKey: some-access-key
|
||||
secretKey: some-secret-key
|
||||
asserts:
|
||||
- documentIndex: &secretDoc 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *secretDoc
|
||||
isAPIVersion:
|
||||
of: v1
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-srcbackup-volsync-mybackup1
|
||||
- documentIndex: &replicationSourceDoc 1
|
||||
isKind:
|
||||
of: ReplicationSource
|
||||
- documentIndex: *replicationSourceDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationSourceDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-srcbackup-mybackup1
|
||||
- documentIndex: &secretDoc 2
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *secretDoc
|
||||
isAPIVersion:
|
||||
of: v1
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-srcbackup-volsync-mybackup2
|
||||
- documentIndex: &replicationSourceDoc 3
|
||||
isKind:
|
||||
of: ReplicationSource
|
||||
- documentIndex: *replicationSourceDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationSourceDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: test-release-name-common-test-srcbackup-mybackup2
|
||||
@@ -1,329 +0,0 @@
|
||||
suite: volsync replication src spec test
|
||||
templates:
|
||||
- common.yaml
|
||||
chart:
|
||||
appVersion: &appVer v9.9.9
|
||||
release:
|
||||
name: test-release-name
|
||||
namespace: test-release-namespace
|
||||
tests:
|
||||
- it: should generate correct spec
|
||||
set:
|
||||
persistence:
|
||||
srcbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
dest:
|
||||
enabled: false
|
||||
src:
|
||||
enabled: true
|
||||
credentials: &credentials
|
||||
mys3:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: some-bucket
|
||||
encrKey: some-key
|
||||
accessKey: some-access-key
|
||||
secretKey: some-secret-key
|
||||
asserts:
|
||||
- documentIndex: &secretDoc 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *secretDoc
|
||||
isAPIVersion:
|
||||
of: v1
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: stringData
|
||||
value:
|
||||
AWS_ACCESS_KEY_ID: some-access-key
|
||||
AWS_SECRET_ACCESS_KEY: some-secret-key
|
||||
RESTIC_PASSWORD: some-key
|
||||
RESTIC_REPOSITORY: s3:some-url/some-bucket/test-release-name/volsync/srcbackup-volsync-mybackup1
|
||||
- documentIndex: &replicationDestDoc 1
|
||||
isKind:
|
||||
of: ReplicationSource
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
isSubset:
|
||||
path: spec
|
||||
content:
|
||||
sourcePVC: test-release-name-common-test-srcbackup
|
||||
trigger:
|
||||
schedule: "0 0 * * *"
|
||||
- documentIndex: *replicationDestDoc
|
||||
isSubset:
|
||||
path: spec.restic
|
||||
content:
|
||||
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
|
||||
copyMethod: Snapshot
|
||||
pruneIntervalDays: 7
|
||||
retain:
|
||||
hourly: 24
|
||||
daily: 7
|
||||
weekly: 5
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
moverSecurityContext:
|
||||
fsGroup: 568
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
- documentIndex: *replicationDestDoc
|
||||
matchRegex:
|
||||
path: spec.restic.unlock
|
||||
pattern: "^[0-9]{14}$"
|
||||
|
||||
- it: should generate correct spec with changed defaults
|
||||
set:
|
||||
persistence:
|
||||
srcbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
copyMethod: Clone
|
||||
dest:
|
||||
enabled: false
|
||||
src:
|
||||
enabled: true
|
||||
trigger:
|
||||
schedule: "1 0 * * *"
|
||||
retain:
|
||||
hourly: 20
|
||||
daily: 5
|
||||
weekly: 3
|
||||
pruneIntervalDays: 5
|
||||
credentials: *credentials
|
||||
asserts:
|
||||
- documentIndex: *replicationDestDoc
|
||||
isKind:
|
||||
of: ReplicationSource
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
isSubset:
|
||||
path: spec
|
||||
content:
|
||||
sourcePVC: test-release-name-common-test-srcbackup
|
||||
trigger:
|
||||
schedule: "1 0 * * *"
|
||||
- documentIndex: *replicationDestDoc
|
||||
isSubset:
|
||||
path: spec.restic
|
||||
content:
|
||||
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
|
||||
copyMethod: Clone
|
||||
pruneIntervalDays: 5
|
||||
retain:
|
||||
hourly: 20
|
||||
daily: 5
|
||||
weekly: 3
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
moverSecurityContext:
|
||||
fsGroup: 568
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
- documentIndex: *replicationDestDoc
|
||||
matchRegex:
|
||||
path: spec.restic.unlock
|
||||
pattern: "^[0-9]{14}$"
|
||||
|
||||
- it: should generate correct spec with storageClassName
|
||||
set:
|
||||
persistence:
|
||||
srcbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
copyMethod: Clone
|
||||
dest:
|
||||
enabled: false
|
||||
src:
|
||||
enabled: true
|
||||
storageClassName: somestorageclass
|
||||
trigger:
|
||||
schedule: "1 0 * * *"
|
||||
retain:
|
||||
hourly: 20
|
||||
daily: 5
|
||||
weekly: 3
|
||||
pruneIntervalDays: 5
|
||||
credentials: *credentials
|
||||
asserts:
|
||||
- documentIndex: *replicationDestDoc
|
||||
isKind:
|
||||
of: ReplicationSource
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
isSubset:
|
||||
path: spec
|
||||
content:
|
||||
sourcePVC: test-release-name-common-test-srcbackup
|
||||
trigger:
|
||||
schedule: "1 0 * * *"
|
||||
- documentIndex: *replicationDestDoc
|
||||
isSubset:
|
||||
path: spec.restic
|
||||
content:
|
||||
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
|
||||
copyMethod: Clone
|
||||
pruneIntervalDays: 5
|
||||
retain:
|
||||
hourly: 20
|
||||
daily: 5
|
||||
weekly: 3
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: somestorageclass
|
||||
moverSecurityContext:
|
||||
fsGroup: 568
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
- documentIndex: *replicationDestDoc
|
||||
matchRegex:
|
||||
path: spec.restic.unlock
|
||||
pattern: "^[0-9]{14}$"
|
||||
|
||||
- it: should generate correct spec with volumeSnapshotClass
|
||||
set:
|
||||
persistence:
|
||||
srcbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
copyMethod: Clone
|
||||
dest:
|
||||
enabled: false
|
||||
src:
|
||||
enabled: true
|
||||
volumeSnapshotClassName: somevsc
|
||||
trigger:
|
||||
schedule: "1 0 * * *"
|
||||
retain:
|
||||
hourly: 20
|
||||
daily: 5
|
||||
weekly: 3
|
||||
pruneIntervalDays: 5
|
||||
credentials: *credentials
|
||||
asserts:
|
||||
- documentIndex: *replicationDestDoc
|
||||
isKind:
|
||||
of: ReplicationSource
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
isSubset:
|
||||
path: spec
|
||||
content:
|
||||
sourcePVC: test-release-name-common-test-srcbackup
|
||||
trigger:
|
||||
schedule: "1 0 * * *"
|
||||
- documentIndex: *replicationDestDoc
|
||||
isSubset:
|
||||
path: spec.restic
|
||||
content:
|
||||
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
|
||||
copyMethod: Clone
|
||||
pruneIntervalDays: 5
|
||||
retain:
|
||||
hourly: 20
|
||||
daily: 5
|
||||
weekly: 3
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeSnapshotClassName: somevsc
|
||||
moverSecurityContext:
|
||||
fsGroup: 568
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
- documentIndex: *replicationDestDoc
|
||||
matchRegex:
|
||||
path: spec.restic.unlock
|
||||
pattern: "^[0-9]{14}$"
|
||||
|
||||
- it: should generate correct spec with volumeSnapshotClass and StorageClass
|
||||
set:
|
||||
persistence:
|
||||
srcbackup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: mybackup1
|
||||
type: restic
|
||||
credentials: mys3
|
||||
copyMethod: Clone
|
||||
dest:
|
||||
enabled: false
|
||||
src:
|
||||
enabled: true
|
||||
storageClassName: somestorageclass
|
||||
volumeSnapshotClassName: somevsc
|
||||
trigger:
|
||||
schedule: "1 0 * * *"
|
||||
retain:
|
||||
hourly: 20
|
||||
daily: 5
|
||||
weekly: 3
|
||||
pruneIntervalDays: 5
|
||||
credentials: *credentials
|
||||
asserts:
|
||||
- documentIndex: *replicationDestDoc
|
||||
isKind:
|
||||
of: ReplicationSource
|
||||
- documentIndex: *replicationDestDoc
|
||||
isAPIVersion:
|
||||
of: volsync.backube/v1alpha1
|
||||
- documentIndex: *replicationDestDoc
|
||||
isSubset:
|
||||
path: spec
|
||||
content:
|
||||
sourcePVC: test-release-name-common-test-srcbackup
|
||||
trigger:
|
||||
schedule: "1 0 * * *"
|
||||
- documentIndex: *replicationDestDoc
|
||||
isSubset:
|
||||
path: spec.restic
|
||||
content:
|
||||
repository: test-release-name-common-test-srcbackup-volsync-mybackup1
|
||||
copyMethod: Clone
|
||||
pruneIntervalDays: 5
|
||||
retain:
|
||||
hourly: 20
|
||||
daily: 5
|
||||
weekly: 3
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: somestorageclass
|
||||
volumeSnapshotClassName: somevsc
|
||||
moverSecurityContext:
|
||||
fsGroup: 568
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
- documentIndex: *replicationDestDoc
|
||||
matchRegex:
|
||||
path: spec.restic.unlock
|
||||
pattern: "^[0-9]{14}$"
|
||||
@@ -1,226 +0,0 @@
|
||||
suite: volsync validation test
|
||||
templates:
|
||||
- common.yaml
|
||||
release:
|
||||
name: test-release-name
|
||||
namespace: test-release-namespace
|
||||
tests:
|
||||
- it: should fail with empty name
|
||||
set:
|
||||
persistence:
|
||||
src-backup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backed-up
|
||||
volsync:
|
||||
- name: ""
|
||||
type: restic
|
||||
credentials: my-secret
|
||||
src:
|
||||
enabled: true
|
||||
dest:
|
||||
enabled: false
|
||||
credentials: {}
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected non-empty [name]
|
||||
|
||||
- it: should fail with empty credentials
|
||||
set:
|
||||
persistence:
|
||||
src-backup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: my-backup
|
||||
type: restic
|
||||
credentials: ""
|
||||
src:
|
||||
enabled: true
|
||||
dest:
|
||||
enabled: false
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected non-empty [credentials]
|
||||
|
||||
- it: should fail if referenced credentials does not exist
|
||||
set:
|
||||
persistence: &persistence
|
||||
src-backup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: my-backup
|
||||
type: restic
|
||||
credentials: my-secret
|
||||
src:
|
||||
enabled: true
|
||||
dest:
|
||||
enabled: false
|
||||
credentials:
|
||||
my-other-secret:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: some-bucket
|
||||
encrKey: some-key
|
||||
accessKey: some-access-key
|
||||
secretKey: some-secret-key
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected credentials [my-secret] to be defined in [credentials] which currently contains [my-other-secret] keys
|
||||
|
||||
- it: should fail if credentials.url is empty
|
||||
set:
|
||||
persistence: *persistence
|
||||
credentials:
|
||||
my-secret:
|
||||
type: s3
|
||||
url: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected non-empty [url] in [credentials.my-secret]
|
||||
|
||||
- it: should fail if credentials.bucket is empty
|
||||
set:
|
||||
persistence: *persistence
|
||||
credentials:
|
||||
my-secret:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected non-empty [bucket] in [credentials.my-secret]
|
||||
|
||||
- it: should fail if credentials.encrKey is empty
|
||||
set:
|
||||
persistence: *persistence
|
||||
credentials:
|
||||
my-secret:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: some-bucket
|
||||
encrKey: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected non-empty [encrKey] in [credentials.my-secret]
|
||||
|
||||
- it: should fail if credentials.accessKey is empty
|
||||
set:
|
||||
persistence: *persistence
|
||||
credentials:
|
||||
my-secret:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: some-bucket
|
||||
encrKey: some-key
|
||||
accessKey: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected non-empty [accessKey] in [credentials.my-secret]
|
||||
|
||||
- it: should fail if credentials.secretKey is empty
|
||||
set:
|
||||
persistence: *persistence
|
||||
credentials:
|
||||
my-secret:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: some-bucket
|
||||
encrKey: some-key
|
||||
accessKey: some-access-key
|
||||
secretKey: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected non-empty [secretKey] in [credentials.my-secret]
|
||||
|
||||
- it: should fail with invalid copy method
|
||||
set:
|
||||
persistence:
|
||||
src-backup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: my-backup
|
||||
type: restic
|
||||
credentials: my-secret
|
||||
copyMethod: invalid
|
||||
src:
|
||||
enabled: true
|
||||
dest:
|
||||
enabled: false
|
||||
credentials: &credentials
|
||||
my-secret:
|
||||
type: s3
|
||||
url: some-url
|
||||
bucket: some-bucket
|
||||
encrKey: some-key
|
||||
accessKey: some-access-key
|
||||
secretKey: some-secret-key
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected [copyMethod] to be one of [Clone, Direct, Snapshot], but got [invalid]
|
||||
|
||||
- it: should fail with empty type
|
||||
set:
|
||||
persistence:
|
||||
src-backup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: my-backup
|
||||
type: ""
|
||||
credentials: my-secret
|
||||
src:
|
||||
enabled: true
|
||||
dest:
|
||||
enabled: false
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected non-empty [type]
|
||||
|
||||
- it: should fail with invalid type
|
||||
set:
|
||||
persistence:
|
||||
src-backup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: my-backup
|
||||
type: invalid
|
||||
credentials: my-secret
|
||||
src:
|
||||
enabled: true
|
||||
dest:
|
||||
enabled: false
|
||||
credentials: *credentials
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected [type] to be one of [restic], but got [invalid]
|
||||
|
||||
- it: should fail with invalid credentials type
|
||||
set:
|
||||
persistence:
|
||||
src-backup:
|
||||
enabled: true
|
||||
type: pvc
|
||||
mountPath: /backedup
|
||||
volsync:
|
||||
- name: my-backup
|
||||
type: restic
|
||||
credentials: my-creds
|
||||
src:
|
||||
enabled: true
|
||||
dest:
|
||||
enabled: false
|
||||
credentials:
|
||||
my-creds:
|
||||
type: invalid
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: VolSync - Expected [type] in [credentials.my-creds] to be one of [s3], but got [invalid]
|
||||
Reference in New Issue
Block a user