#!/bin/bash # Test apt-ostree Architecture Fix set -e echo "=== Testing apt-ostree Architecture Fix ===" echo # Check if daemon is running echo "1. Checking if daemon is running..." if systemctl is-active --quiet apt-ostreed.service; then echo "✓ Daemon is running" else echo "⚠ Daemon is not running - will test fallback mode" fi echo # Test daemon ping echo "2. Testing daemon ping..." if sudo apt-ostree daemon-ping 2>/dev/null; then echo "✓ Daemon ping successful" else echo "⚠ Daemon ping failed - daemon may not be running" fi echo # Test daemon status echo "3. Testing daemon status..." if sudo apt-ostree daemon-status 2>/dev/null; then echo "✓ Daemon status successful" else echo "⚠ Daemon status failed - daemon may not be running" fi echo # Test command fallback (without daemon) echo "4. Testing command fallback (without daemon)..." if systemctl is-active --quiet apt-ostreed.service; then echo "Stopping daemon to test fallback..." sudo systemctl stop apt-ostreed.service sleep 2 fi # Test status command fallback echo "Testing status command fallback..." if apt-ostree status 2>/dev/null; then echo "✓ Status command fallback successful" else echo "⚠ Status command fallback failed" fi echo # Test search command fallback echo "Testing search command fallback..." if apt-ostree search test 2>/dev/null; then echo "✓ Search command fallback successful" else echo "⚠ Search command fallback failed" fi echo # Restart daemon if it was running echo "5. Restarting daemon if it was previously running..." if systemctl is-enabled --quiet apt-ostreed.service; then sudo systemctl start apt-ostreed.service echo "✓ Daemon restarted" else echo "⚠ Daemon not enabled - skipping restart" fi echo echo "=== Architecture Test Complete ===" echo "Summary:" echo "- Daemon-based commands should work when daemon is running" echo "- Commands should fallback to client-only when daemon is unavailable" echo "- This provides proper rpm-ostree architecture compatibility"