Files
library-charts/library/common-test/tests/volsync/validation_test.yaml
Kjeld Schouten 096d349017 feat!: Add integrated Volsync support and remove Velero Support (#790)
**Description**
Velero has a whole host of issues:
1. It does not work with RWO blockdevice PVCs
2. It does not play nice with GitOps (as you don't want all manifests
ported)
3. It does not play nice with TrueNAS SCALE (which iX is to blame for)

But combined: It sucks and only works if you fit within a VERY tight
design-specification for your clustered resources.
So while we spend many ours on it: It has to go.

Introducing: VolSync support.

It just does storage backups and does it well.
If you reinstall with the same VolSync setup, it fetches your data from
S3 storage before starting stuff.
Just works (tm).

Also should just work(tm) with TrueNAS SCALE.

**⚙️ Type of change**

- [x] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [x] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [ ] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning
- [ ] I made sure the title starts with `feat(chart-name):`,
`fix(chart-name):` or `chore(chart-name):`

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._

---------

Co-authored-by: Stavros kois <s.kois@outlook.com>
2024-04-28 20:42:21 +02:00

198 lines
5.1 KiB
YAML

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: {}
asserts:
- failedTemplate:
errorMessage: VolSync - Expected credentials [my-secret] to be defined in [credentials.my-secret]
- 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]