Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
1.0 kB ยท 49 lines
Shell
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950#!/bin/bash
# Test script to verify daemon shutdown behavior
echo "๐งช Testing daemon shutdown behavior..."
# Start daemon in background and capture its PIDecho "๐ Starting daemon..."cd "$(dirname "$0")"cargo run &DAEMON_PID=$!
echo "๐ Daemon PID: $DAEMON_PID"
# Wait a moment for daemon to startsleep 2
# Send a test notificationecho "๐ก Sending test notification..."../ac-notify success "test"
# Wait a momentsleep 1
# Check if daemon is runningif ps -p $DAEMON_PID > /dev/null; then echo "โ
Daemon is running (PID $DAEMON_PID)"else echo "โ Daemon is not running" exit 1fi
# Test signal handlingecho "๐ค Sending SIGTERM to daemon..."kill -TERM $DAEMON_PID
# Wait a moment for graceful shutdownsleep 2
# Check if daemon stoppedif ps -p $DAEMON_PID > /dev/null; then echo "โ Daemon still running after SIGTERM" kill -9 $DAEMON_PID # Force kill exit 1else echo "โ
Daemon stopped gracefully after SIGTERM"fi
echo "๐ All tests passed!"