prole/tests/final_test.sh
chrisfu a069989315 Rename prole-db to knoe-db, add knoe-auth as cluster-internal KDC
Itemized changes:

1. knoe-auth: New cluster-internal KDC and SSO gateway service
   - Created etc/init_knoe_auth.sh based on init_kdc.sh with knoe-auth naming
   - Namespace defaults to SERVICE_NAMESPACE (knoe-system)
   - ConfigMap: knoe-auth-kdc-config, Secret: knoe-auth-secrets
   - Legacy cleanup removes old auth/dog/authority deployments

2. Orchestration: knoe-auth initializes before CloudNativePG
   - Updated prole.sh to insert init_knoe_auth.sh as step 2 (before CNPG)
   - Renumbered all subsequent initialization steps

3. Kong routing: Updated init_kong.sh to route to knoe-auth in SERVICE_NAMESPACE

4. Comment/reference updates for knoe-auth
   - Updated init_common_services.sh, init_service_layer.sh, init_kerberos.sh

5. prole-db renamed to knoe-db across the entire codebase
   - Renamed prole-db/ directory to knoe-db/
   - Renamed all prole-db Kubernetes manifests (deploy/opentofu, k8s/)
   - Renamed scripts: docker-root-knoe-db.sh, docker-run-knoe-db.sh, test-cnpg-knoe-db.sh
   - Renamed etc/init_prole-db-reset.sh to etc/init_knoe-db-reset.sh
   - Renamed etc/prole-db-passwwd.sh to etc/knoe-db-passwwd.sh
   - Renamed mock_val counterparts accordingly
   - Renamed tests/etc/test_init_prole-db-reset.sh to test_init_knoe-db-reset.sh
   - Renamed docs/prole-db-documentation-mcp-architecture.md to knoe-db variant
   - Renamed modes/k3d/prole-db/ to modes/k3d/knoe-db/
   - Renamed prole-db.iml to knoe-db.iml

6. Configuration updates
   - Updated conf/dev, conf/prod, conf/test, conf/service prole.cfg files
   - Updated conf/port-mapping.cfg
   - Updated etc/prole_cfg.sh and mock_val/prole_cfg.sh
   - Updated service/prole.cfg

7. Kubernetes manifests and deploy configuration
   - Updated deploy/opentofu/k3s ArgoCD application YAMLs
   - Updated kong-configmap.yaml and kustomization.yaml
   - Updated k3s/kong-config.yml and prole-resources.yaml
   - Updated prole-mssql-db deployment YAMLs
   - Updated supabase helm render and deploy scripts

8. Infrastructure and GCP Terraform
   - Updated deploy/gcp/terraform: folders, groups, IAM, service-projects

9. Python/installer code updates
   - Updated knoe/core: actions, build_context, controller, env, milestones
   - Updated knoe/milestone.py
   - Updated knoe/ui/screens: cfg, database, database_options, deploy, docker,
     navigation, security, services, validate
   - Updated knoe.spec, status.py

10. Shell script updates
    - Updated etc/: build_db, init_cloudnative_pg, init_cnpg_backup,
      init_db_manager, init_forgejo, init_gitlab, init_monitoring, init_openbao,
      init_port_forwards, init_postgrest, init_supabase_ports, status
    - Updated mock_val/ counterparts for all above scripts
    - Updated prole-net/init-prole-dns.sh
    - Updated bin/prole-kpf.sh, gitea/deploy.sh, supabase/deploy.sh

11. Test updates
    - Updated tests/etc/: test_init_cloudnative_pg*, test_init_cnpg_backup*,
      test_init_kdc*, test_init_kerberos*, test_init_kong*, test_prole_cfg*
    - Updated tests/installer/: test_actions_helpers, test_cfg_save_kubecontext,
      test_controller, test_core_classes, test_milestones, test_milestones_extended,
      test_namespace_propagation
    - Updated tests/: test_database_options, test_navigation,
      test_render_supabase_hostname, test_docker_build_fix,
      test_all_prole_home_fixes, silent_install_test, final_test

12. Documentation updates
    - Updated docs/: DOCKER-BUILD-FIX, PROLE-CFG-SECRETS, PROLE-HOME-DIRECTORY,
      build-system, patent
    - Updated scan/network_description.txt
    - Updated pom.xml

13. Miscellaneous script updates
    - Updated root-level: _adopt_replica_pvcs, _fix_replica_merlin, _import_pi,
      _patch_cluster, _prebind_pvcs, _rebind_d002, _rebind_d002b, test_resolve
    - Updated scripts/generate_spec.py

Co-authored-by: Junie <junie@jetbrains.com>
2026-03-22 22:16:21 -07:00

135 lines
3.9 KiB
Bash
Executable File

#!/bin/bash
echo "=============================================="
echo " FINAL COMPREHENSIVE TEST"
echo " Prole Database Installer"
echo "=============================================="
echo ""
TESTS_PASSED=0
TESTS_TOTAL=0
test_item() {
TESTS_TOTAL=$((TESTS_TOTAL + 1))
echo -n "[$TESTS_TOTAL] $1... "
shift
if "$@" > /dev/null 2>&1; then
echo "✓"
TESTS_PASSED=$((TESTS_PASSED + 1))
return 0
else
echo "✗"
return 1
fi
}
# Core Features
echo "CORE FEATURES"
test_item "Install.py imports" python3 -c "from install import ProleController, get_resource_path"
test_item "Ncurses interface" python3 -c "from knoe.ncurses_installer import run_ncurses_installer"
test_item "Display auto-detection" python3 -c "from install import has_display"
test_item "CLI arguments" python3 install.py --help
# Build System
echo ""
echo "BUILD SYSTEM"
test_item "Makefile" make help
test_item "Spec generator" python3 scripts/generate_spec.py
test_item "Icon conversion" make build/prole.icns
# Image Resources
echo ""
echo "IMAGE RESOURCES"
test_item "proleIcon.png" test -f img/proleIcon.png
test_item "proleLogo.png" test -f img/proleLogo.png
test_item "proleLogoSepia.png" test -f img/proleLogoSepia.png
# Binary Resources
echo ""
echo "BINARY RESOURCES"
test_item "prole-agent exists" test -f prole-net/prole-agent
test_item "prole-agent executable" test -x prole-net/prole-agent
# App Bundle
echo ""
echo "APP BUNDLE"
test_item "Prole Tools.app exists" test -d "prole-app/dist/Prole Tools.app"
# Docker Build Context
echo ""
echo "DOCKER BUILD CONTEXT"
test_item "knoe-db directory" test -d knoe-db
test_item "Dockerfile exists" test -f knoe-db/Dockerfile
# Spec Verification
echo ""
echo "SPEC FILE VERIFICATION"
python3 scripts/generate_spec.py > /dev/null 2>&1
test_item "Spec includes img" grep -q "img" installer.spec
test_item "Spec includes knoe-db" grep -q "knoe-db" installer.spec
test_item "Spec includes prole-agent" grep -q "prole-agent" installer.spec
test_item "Spec includes Prole Tools" grep -q "Prole Tools" installer.spec
# Resource Path Tests
echo ""
echo "RESOURCE PATH RESOLUTION"
test_item "Image paths work" python3 -c "
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd()))
from install import get_resource_path
assert get_resource_path('img/proleIcon.png').exists()
"
test_item "Binary paths work" python3 -c "
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd()))
from install import get_resource_path
assert get_resource_path('prole-net/prole-agent').exists()
"
test_item "Docker context works" python3 -c "
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd()))
from install import get_resource_path
assert get_resource_path('knoe-db').exists()
"
# Summary
echo ""
echo "=============================================="
echo " RESULTS: $TESTS_PASSED/$TESTS_TOTAL PASSED"
echo "=============================================="
echo ""
if [ $TESTS_PASSED -eq $TESTS_TOTAL ]; then
echo "✓✓✓ ALL TESTS PASSED ✓✓✓"
echo ""
echo "READY TO BUILD:"
echo " make package"
echo ""
echo "FEATURES IMPLEMENTED:"
echo " ✓ Ncurses terminal interface"
echo " ✓ Automatic display detection"
echo " ✓ Static universal binary build system"
echo " ✓ Image resources embedded"
echo " ✓ prole-agent binary embedded"
echo " ✓ Prole Tools.app embedded"
echo " ✓ Docker build context embedded"
echo " ✓ Docker build uses ~/.prole/build (writable)"
echo ""
echo "PACKAGE WILL INCLUDE:"
echo " • Images (~11 MB)"
echo " • prole-agent (6.8 MB)"
echo " • Prole Tools.app (~12 MB)"
echo " • knoe-db build context (~1-5 MB)"
echo " • Python runtime + deps (~30-50 MB)"
echo " • Total: ~50-100 MB"
echo ""
exit 0
else
echo "✗ SOME TESTS FAILED"
echo "Fix issues before building package"
exit 1
fi