deb-bootupd/test-deb.sh
robojerk 73b43239e9
Some checks failed
Build deb-bootupd Artifacts / build (push) Failing after 6m14s
Simple Build and Upload / build (push) Failing after 2m0s
Add Debian packaging and update Forgejo workflow
- Add complete Debian packaging configuration (debian/ directory)
- Create build-deb.sh script for building packages
- Update Forgejo workflow to build and upload .deb artifacts
- Add comprehensive version naming for both binary and Debian artifacts
- Update .gitignore to exclude build artifacts and packaging files
- Add PACKAGING.md documentation
- Add test-deb.sh for testing package installation
2025-08-10 11:30:19 -07:00

81 lines
2.6 KiB
Bash
Executable file

#!/bin/bash
set -e
# Test script for deb-bootupd Debian package
# This script validates and tests the built .deb package
echo "🧪 Testing deb-bootupd Debian package..."
# Check if package files exist
PACKAGE_FILE=$(find .. -name "deb-bootupd_*.deb" | head -1)
if [ -z "$PACKAGE_FILE" ]; then
echo "❌ Error: No deb-bootupd package found. Build the package first with ./build-deb.sh"
exit 1
fi
echo "📦 Found package: $PACKAGE_FILE"
# Validate package structure
echo "🔍 Validating package structure..."
dpkg-deb -I "$PACKAGE_FILE" | grep -E "(Package|Version|Architecture|Depends|Description)" || true
echo "📁 Package contents:"
dpkg-deb -c "$PACKAGE_FILE" | head -20
# Check package dependencies
echo "🔗 Package dependencies:"
dpkg-deb -I "$PACKAGE_FILE" | grep "Depends:" || echo "No dependencies listed"
# Test package installation (dry run)
echo "🧪 Testing package installation (dry run)..."
dpkg --dry-run -i "$PACKAGE_FILE" || echo "⚠️ Dry run installation check failed"
# Check for common packaging issues
echo "🔍 Checking for common packaging issues..."
# Check if binary is executable
if dpkg-deb -c "$PACKAGE_FILE" | grep -q "usr/libexec/bootupd"; then
echo "✅ Binary found in correct location"
else
echo "❌ Binary not found in usr/libexec/"
fi
# Check if symlink is present
if dpkg-deb -c "$PACKAGE_FILE" | grep -q "usr/bin/bootupctl"; then
echo "✅ Symlink found in correct location"
else
echo "❌ Symlink not found in usr/bin/"
fi
# Check if systemd files are NOT present (bootupd is not a daemon)
if dpkg-deb -c "$PACKAGE_FILE" | grep -q "etc/systemd/system/bootupd.service"; then
echo "❌ Systemd service file found (should not be present)"
else
echo "✅ No systemd service file (correct - bootupd is not a daemon)"
fi
if dpkg-deb -c "$PACKAGE_FILE" | grep -q "etc/systemd/system/bootupd.socket"; then
echo "❌ Systemd socket file found (should not be present)"
else
echo "✅ No systemd socket file (correct - bootupd is not a daemon)"
fi
# Check if documentation is present
if dpkg-deb -c "$PACKAGE_FILE" | grep -q "usr/share/doc/deb-bootupd"; then
echo "✅ Documentation directory found"
else
echo "❌ Documentation directory not found"
fi
echo ""
echo "🎯 Package validation complete!"
echo "📦 Package file: $PACKAGE_FILE"
echo ""
echo "💡 To install the package:"
echo " sudo dpkg -i $PACKAGE_FILE"
echo " sudo apt-get install -f # Fix any dependency issues"
echo ""
echo "💡 To test the package:"
echo " bootupctl --help"
echo " bootupctl status"
echo " bootupctl validate"