helm-charts/charts/other/app-template/tests/addons/vpn_test.yaml
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs a2a0b8ea2b
feat(common): Release version 1.1.0 (#81)
# Removed
- Promtail add-on has been removed

# Fixed
- Fixed httpGet probe whitespace rendering (#76)
- Fixed Secret management for ServiceAccounts (fixes #78)
- Fixed code-server add-on Service rendering

# Added
- Added support for Gateway API Routes (#59)

# Changed
- Services and their ports are now assumed enabled by default
- Updated `code-server` image to v4.8.3
- Updated `netshoot` image to v0.8

Signed-off-by: András Maróy <andras@maroy.hu>
Signed-off-by: András Maróy <andras@maroy.hu>
Co-authored-by: András Maróy <andras@maroy.hu>
Co-authored-by: pando85 <pando855@gmail.com>
2022-11-19 13:24:11 +01:00

206 lines
5.5 KiB
YAML

suite: addon vpn
templates:
- common.yaml
tests:
- it: default should pass
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
not: true
equal:
path: spec.template.spec.containers[0].name
value: vpn
- it: addon enabled should pass
set:
addons:
vpn:
enabled: true
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].name
value: gluetun
- it: addon enabled with configFile should pass
set:
addons:
vpn:
enabled: true
configFile: test
asserts:
- hasDocuments:
count: 3
- documentIndex: &AddonVPNConfigSecretDocument 2
isKind:
of: Secret
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /gluetun/config.conf
name: vpnconfig
subPath: vpnConfigfile
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.volumes
content:
name: vpnconfig
secret:
items:
- key: vpnConfigfile
path: vpnConfigfile
secretName: RELEASE-NAME-addon-vpn-config
- documentIndex: *AddonVPNConfigSecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-addon-vpn-config
- it: addon enabled with up/down scripts should pass
set:
addons:
vpn:
enabled: true
scripts:
up: |
test_up
down: |
test_down
asserts:
- hasDocuments:
count: 3
- documentIndex: &AddonVPNConfigConfigMapDocument 2
isKind:
of: ConfigMap
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /gluetun/scripts/up.sh
name: vpnscript
subPath: up.sh
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /gluetun/scripts/down.sh
name: vpnscript
subPath: down.sh
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.volumes
content:
configMap:
items:
- key: up.sh
mode: 511
path: up.sh
- key: down.sh
mode: 511
path: down.sh
name: RELEASE-NAME-addon-vpn
name: vpnscript
- documentIndex: *AddonVPNConfigConfigMapDocument
equal:
path: metadata.name
value: RELEASE-NAME-addon-vpn
- it: addon enabled with existing configFile secret should pass
set:
addons:
vpn:
enabled: true
configFileSecret: test-secret
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /gluetun/config.conf
name: vpnconfig
subPath: vpnConfigfile
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.volumes
content:
name: vpnconfig
secret:
items:
- key: vpnConfigfile
path: vpnConfigfile
secretName: test-secret
- it: addon enabled with custom env vars dict should pass
set:
addons:
vpn:
enabled: true
env:
int: 1
float: 1.5
string: value_of_env
template: "{{ .Release.Name }}-admin"
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
not: true
equal:
path: spec.template.spec.containers[1].name
value: vpn
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[0]
value:
name: float
value: "1.5"
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[1]
value:
name: int
value: "1"
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[2]
value:
name: string
value: value_of_env
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[3]
value:
name: template
value: RELEASE-NAME-admin