Files
library-charts/library/common-test/tests/addons/vpn_test.yaml
Kjeld Schouten-Lebbing 303df87c51 feat(common): readd TrueCharts specific features to refactor (#292)
**Description**
This PR re-adds TrueCharts specific portions back into the refactor done
by iX-Systems to the common-chart

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 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

** App addition**

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

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ 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>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
2023-01-23 00:37:30 +01:00

150 lines
4.2 KiB
YAML

suite: addon vpn
templates:
- common.yaml
tests:
- it: default should pass
asserts:
- hasDocuments:
count: 3
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
notEqual:
path: spec.template.spec.containers[0].name
value: RELEASE-NAME-common-test-additional-vpn
- it: addon enabled with configFile should pass
set:
addons:
vpn:
type: openvpn
configFile:
enabled: true
asserts:
- hasDocuments:
count: 4
- documentIndex: &AddonVPNConfigSecretDocument 0
isKind:
of: Secret
- documentIndex: &DeploymentDocument 1
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /vpn/vpn.conf
name: vpnconfig
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.volumes
content:
name: vpnconfig
hostPath:
path: /vpn/vpn.conf
type: File
- documentIndex: *AddonVPNConfigSecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-common-test-openvpn
- it: addon enabled with managed secret should pass
set:
addons:
vpn:
type: openvpn
openvpn:
username: something
password: something
asserts:
- hasDocuments:
count: 4
- documentIndex: &SecretDocument 0
isKind:
of: Secret
- documentIndex: 2
isKind:
of: Service
- documentIndex: &DeploymentDocument 1
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
notEqual:
path: spec.template.spec.containers[0].name
value: vpn
- it: tailscale addon enabled with authkey should pass
set:
addons:
vpn:
type: tailscale
tailscale:
authkey: something
asserts:
- hasDocuments:
count: 4
- documentIndex: &ServiceDocument 2
isKind:
of: Service
- documentIndex: &SecretDocument 0
isKind:
of: Secret
- documentIndex: *SecretDocument
isNotNull:
path: data.TS_AUTH_KEY
- documentIndex: *SecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-common-test-tailscale-secret
- documentIndex: &DeploymentDocument 1
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
notEqual:
path: spec.template.spec.containers[0].name
value: RELEASE-NAME-common-test-additional-tailscale
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].name
value: RELEASE-NAME-common-test-additional-tailscale
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].env
content:
name: TS_KUBE_SECRET
value: ""
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].env
content:
name: TS_SOCKET
value: /var/run/tailscale/tailscaled.sock
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].env
content:
name: TS_STATE_DIR
value: /var/lib/tailscale
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].env
content:
name: TS_AUTH_ONCE
value: "true"
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].env
content:
name: TS_USERSPACE
value: "true"
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].env
content:
name: TS_ACCEPT_DNS
value: "false"