deb-bootc-image-builder/test-debos-build.sh
robojerk 1acdcdfd57 🚀 CLI Integration Complete: debos Backend Now Available
This commit completes the CLI integration for the debos backend:

 IMPLEMENTED:
- New debos build path accessible via --use-debos flag
- Full CLI compatibility with existing bootc-image-builder interface
- Automatic fallback to osbuild when --use-debos not specified
- Comprehensive debos-specific command line options

🔧 NEW FLAGS:
- --use-debos: Enable debos backend instead of osbuild
- --debos-suite: Override Debian suite detection
- --debos-packages: Additional packages to install
- --debos-ostree: Enable/disable OSTree integration
- --debos-repository: OSTree repository path
- --debos-branch: OSTree branch name
- --debos-dry-run: Perform dry run without building

🧪 TESTING:
- All tests passing with comprehensive test script
- Dry-run functionality working correctly
- Suite and architecture detection functional
- Help output properly displays all debos options

🎯 USAGE EXAMPLES:
- Basic: ./bootc-image-builder --use-debos debian:trixie
- Custom suite: --use-debos --debos-suite bookworm debian:bookworm
- Dry run: --use-debos --debos-dry-run debian:trixie

The debos backend is now fully integrated and ready for end-to-end testing!
2025-08-11 13:38:27 -07:00

90 lines
2.8 KiB
Bash
Executable file

#!/bin/bash
# Test script for debos backend integration
set -e
echo "🧪 Testing Debian Bootc Image Builder - debos Backend"
echo "======================================================"
# Check if debos is available
if ! command -v debos >/dev/null 2>&1; then
echo "❌ debos is not installed. Please install it first:"
echo " sudo apt install debos"
exit 1
fi
echo "✅ debos is available"
# Check if we have a test image
if ! sudo podman image exists localhost/debian-bootc-example:latest; then
echo "❌ Test image not found. Please ensure you have a local test image."
exit 1
fi
echo "✅ Test image found: localhost/debian-bootc-example:latest"
# Test 1: Dry run with debos backend
echo ""
echo "🔍 Test 1: Dry run with debos backend"
echo "--------------------------------------"
if sudo ./bootc-image-builder --use-debos --debos-dry-run localhost/debian-bootc-example:latest; then
echo "✅ Dry run test passed"
else
echo "❌ Dry run test failed"
exit 1
fi
# Test 2: Help output shows debos flags
echo ""
echo "🔍 Test 2: Help output shows debos flags"
echo "----------------------------------------"
if ./bootc-image-builder build --help | grep -q "use-debos"; then
echo "✅ Help output test passed"
else
echo "❌ Help output test failed"
exit 1
fi
# Test 3: Suite detection
echo ""
echo "🔍 Test 3: Suite detection"
echo "---------------------------"
if sudo ./bootc-image-builder --use-debos --debos-dry-run --verbose localhost/debian-bootc-example:latest 2>&1 | grep -q "Detected Debian suite: trixie"; then
echo "✅ Suite detection test passed"
else
echo "❌ Suite detection test failed"
exit 1
fi
# Test 4: Architecture detection
echo ""
echo "🔍 Test 4: Architecture detection"
echo "---------------------------------"
if sudo ./bootc-image-builder --use-debos --debos-dry-run --verbose localhost/debian-bootc-example:latest 2>&1 | grep -q "Architecture: x86_64"; then
echo "✅ Architecture detection test passed"
else
echo "❌ Architecture detection test failed"
exit 1
fi
echo ""
echo "🎉 All tests passed! The debos backend integration is working correctly."
echo ""
echo "🚀 Next steps:"
echo " 1. Test with real debos builds (remove --debos-dry-run)"
echo " 2. Test with different Debian suites"
echo " 3. Test with different architectures"
echo " 4. Test OSTree integration"
echo ""
echo "📚 Usage examples:"
echo " # Basic debos build"
echo " sudo ./bootc-image-builder --use-debos debian:trixie"
echo ""
echo " # Custom suite"
echo " sudo ./bootc-image-builder --use-debos --debos-suite bookworm debian:bookworm"
echo ""
echo " # Custom packages"
echo " sudo ./bootc-image-builder --use-debos --debos-packages vim,htop debian:trixie"
echo ""
echo " # Dry run first"
echo " sudo ./bootc-image-builder --use-debos --debos-dry-run debian:trixie"