unrip/test/bootstrap_script_static_test.py
philipp 3cd88c682e Expose operator dashboard with basic auth
Proof: The rendered Kubernetes manifest now includes a Traefik TLS ingress for operator-dashboard and production basic auth, deploy workflow/bootstrap preserve the dashboard password as a secret, and static plus full node tests pass.

Assumptions: doran.133011.xyz is the intended public host because unrip.doran.133011.xyz and dashboard.doran.133011.xyz do not currently resolve.

Still fake: the public dashboard is not deployed or externally verified yet because the cluster host, Forgejo, and Kubernetes API timed out from this machine during this turn.
2026-05-13 18:08:27 +02:00

25 lines
1.2 KiB
Python

import pathlib
import unittest
ROOT = pathlib.Path(__file__).resolve().parents[1]
class BootstrapScriptStaticTest(unittest.TestCase):
def test_bootstrap_renders_existing_release_image_instead_of_reapplying_placeholders(self):
source = (ROOT / 'scripts/deploy/bootstrap.sh').read_text()
self.assertIn('PROJECT_RELEASE_IMAGE', source)
self.assertIn('current_release_image', source)
self.assertIn('render_release_manifest.py', source)
self.assertIn('ghcr.io/example/unrip:bootstrap', source)
self.assertIn('kubectl kustomize "$ROOT_DIR/deploy/k8s/base"', source)
def test_bootstrap_preserves_operator_dashboard_password_secret(self):
source = (ROOT / 'scripts/deploy/bootstrap.sh').read_text()
self.assertIn('OPERATOR_DASHBOARD_AUTH_PASSWORD="$(secret_value OPERATOR_DASHBOARD_AUTH_PASSWORD)"', source)
self.assertIn('OPERATOR_DASHBOARD_AUTH_PASSWORD:?set OPERATOR_DASHBOARD_AUTH_PASSWORD', source)
self.assertIn('--from-literal=OPERATOR_DASHBOARD_AUTH_PASSWORD="$OPERATOR_DASHBOARD_AUTH_PASSWORD"', source)
self.assertIn('--operator-dashboard-auth-password "$OPERATOR_DASHBOARD_AUTH_PASSWORD"', source)
if __name__ == '__main__':
unittest.main()