From 805e936a12c9b1c28cdfe5c3592ac92033d4d476 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 23 Feb 2024 10:47:20 +0100 Subject: [PATCH] `icinga-kubernetes`: Test database creation --- .../global_database_statefulset_test.yaml | 27 +++++++++++++++++++ .../icinga-stack/tests/required_values.yaml | 5 ++++ 2 files changed, 32 insertions(+) diff --git a/charts/icinga-stack/tests/global_database_statefulset_test.yaml b/charts/icinga-stack/tests/global_database_statefulset_test.yaml index b870695..416ce62 100644 --- a/charts/icinga-stack/tests/global_database_statefulset_test.yaml +++ b/charts/icinga-stack/tests/global_database_statefulset_test.yaml @@ -240,6 +240,31 @@ tests: name: database-icingaweb2 key: password + # Icinga Kubernetes DB + - it: deploys an Icinga Kubernetes database StatefulSet using values + documentIndex: 8 + values: + - required_values.yaml + release: + name: my-icinga + asserts: + - containsDocument: + kind: StatefulSet + apiVersion: apps/v1 + - equal: + path: metadata.name + value: my-icinga-icinga-stack-icinga-kubernetes-database + - contains: + path: spec.template.spec.containers[0].env + content: + name: MARIADB_USER + value: kubernetes + - contains: + path: spec.template.spec.containers[0].env + content: + name: MARIADB_PASSWORD + value: insecurekubernetesdbpassword + # Test persistence for databases - it: deploys a PVC for a database if persistence is enabled documentIndex: 0 @@ -253,6 +278,8 @@ tests: global.databases.icingadb.password.value: insecurepassword global.databases.icingaweb2.username.value: icingaweb2 global.databases.icingaweb2.password.value: insecurepassword + global.databases.kubernetes.username.value: kubernetes + global.databases.kubernetes.password.value: insecurepassword release: name: my-icinga asserts: diff --git a/charts/icinga-stack/tests/required_values.yaml b/charts/icinga-stack/tests/required_values.yaml index b825235..6f501ff 100644 --- a/charts/icinga-stack/tests/required_values.yaml +++ b/charts/icinga-stack/tests/required_values.yaml @@ -32,3 +32,8 @@ global: value: icingadb password: value: insecureicingadbpassword + kubernetes: + username: + value: kubernetes + password: + value: insecurekubernetesdbpassword