#!/bin/bash # Test DEB package installation in Docker container set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")" BUILD_DIR="${PROJECT_ROOT}/build/deb" echo "==========================================" echo " Testing DEB Package Installation" echo "==========================================" # Find the DEB package DEB_PACKAGE=$(ls -1 "${BUILD_DIR}"/*.deb 2>/dev/null | head -1) if [ -z "$DEB_PACKAGE" ]; then echo "Error: No .deb package found in ${BUILD_DIR}" echo "Run 'make package-deb' first" exit 1 fi echo "Found package: ${DEB_PACKAGE}" # Copy package to test directory cp "${DEB_PACKAGE}" "${SCRIPT_DIR}/" # Build test image echo "Building test Docker image..." docker build -t ja4sentinel-test-deb \ -f "${SCRIPT_DIR}/Dockerfile.deb" \ "${SCRIPT_DIR}/" # Run tests echo "" echo "Running installation tests..." docker run --rm \ -v "${SCRIPT_DIR}/test-install-deb.sh:/test-install.sh:ro" \ ja4sentinel-test-deb \ /test-install.sh echo "" echo "==========================================" echo " DEB Package Test Complete" echo "=========================================="