Compare commits
1 Commits
171107d359
...
df0c36922a
| Author | SHA1 | Date | |
|---|---|---|---|
| df0c36922a |
92
.github/workflows/test.yml
vendored
92
.github/workflows/test.yml
vendored
@@ -29,9 +29,26 @@ jobs:
|
|||||||
- name: Verify Stalwart service is running
|
- name: Verify Stalwart service is running
|
||||||
run: |
|
run: |
|
||||||
sleep 10 # Give service time to start
|
sleep 10 # Give service time to start
|
||||||
sudo systemctl status stalwart --no-pager
|
|
||||||
if ! sudo systemctl is-active --quiet stalwart; then
|
# Check if systemd is available
|
||||||
echo "::error::Stalwart service is not running"
|
if command -v systemctl >/dev/null 2>&1 && systemctl --version >/dev/null 2>&1; then
|
||||||
|
echo "Checking service status with systemd..."
|
||||||
|
sudo systemctl status stalwart --no-pager || true
|
||||||
|
if sudo systemctl is-active --quiet stalwart; then
|
||||||
|
echo "✓ Stalwart service is running (systemd)"
|
||||||
|
else
|
||||||
|
echo "::warning::Stalwart service not active in systemd, checking process..."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "::warning::systemd not available, checking process directly..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if process is running
|
||||||
|
if pgrep -x stalwart >/dev/null; then
|
||||||
|
echo "✓ Stalwart process is running"
|
||||||
|
else
|
||||||
|
echo "::error::Stalwart process is not running"
|
||||||
|
ps aux | grep stalwart || true
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -78,8 +95,19 @@ jobs:
|
|||||||
- name: Verify service is running
|
- name: Verify service is running
|
||||||
run: |
|
run: |
|
||||||
sleep 10
|
sleep 10
|
||||||
sudo systemctl status stalwart --no-pager
|
|
||||||
sudo systemctl is-active --quiet stalwart
|
# Check if systemd is available
|
||||||
|
if command -v systemctl >/dev/null 2>&1 && systemctl --version >/dev/null 2>&1; then
|
||||||
|
sudo systemctl status stalwart --no-pager || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check process
|
||||||
|
if ! pgrep -x stalwart >/dev/null; then
|
||||||
|
echo "::error::Stalwart process is not running"
|
||||||
|
ps aux | grep stalwart || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "✓ Stalwart is running"
|
||||||
|
|
||||||
- name: Test authentication with new password
|
- name: Test authentication with new password
|
||||||
run: |
|
run: |
|
||||||
@@ -154,8 +182,19 @@ jobs:
|
|||||||
- name: Verify service is running
|
- name: Verify service is running
|
||||||
run: |
|
run: |
|
||||||
sleep 10
|
sleep 10
|
||||||
sudo systemctl status stalwart --no-pager
|
|
||||||
sudo systemctl is-active --quiet stalwart
|
# Check if systemd is available
|
||||||
|
if command -v systemctl >/dev/null 2>&1 && systemctl --version >/dev/null 2>&1; then
|
||||||
|
sudo systemctl status stalwart --no-pager || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check process
|
||||||
|
if ! pgrep -x stalwart >/dev/null; then
|
||||||
|
echo "::error::Stalwart process is not running"
|
||||||
|
ps aux | grep stalwart || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "✓ Stalwart is running"
|
||||||
|
|
||||||
- name: Verify admin password was changed
|
- name: Verify admin password was changed
|
||||||
run: |
|
run: |
|
||||||
@@ -209,13 +248,26 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
echo "=== Stalwart Service Status ==="
|
echo "=== Stalwart Service Status ==="
|
||||||
sudo systemctl status stalwart --no-pager || true
|
if command -v systemctl >/dev/null 2>&1; then
|
||||||
|
sudo systemctl status stalwart --no-pager || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\n=== Process Status ==="
|
||||||
|
ps aux | grep stalwart || true
|
||||||
|
|
||||||
echo -e "\n=== Stalwart Logs ==="
|
echo -e "\n=== Stalwart Logs ==="
|
||||||
sudo journalctl -u stalwart -n 100 --no-pager || true
|
if command -v journalctl >/dev/null 2>&1; then
|
||||||
|
sudo journalctl -u stalwart -n 100 --no-pager || true
|
||||||
|
else
|
||||||
|
sudo tail -n 100 /opt/stalwart/logs/*.log 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\n=== Configuration File ==="
|
echo -e "\n=== Configuration File ==="
|
||||||
sudo cat /opt/stalwart/etc/config.toml || true
|
sudo cat /opt/stalwart/etc/config.toml || true
|
||||||
|
|
||||||
|
echo -e "\n=== Network Ports ==="
|
||||||
|
sudo netstat -tuln | grep -E ':(25|587|465|993|8080)' || true
|
||||||
|
sudo ss -tuln | grep -E ':(25|587|465|993|8080)' || true
|
||||||
|
|
||||||
# Test error handling
|
# Test error handling
|
||||||
test-error-handling:
|
test-error-handling:
|
||||||
@@ -245,7 +297,16 @@ jobs:
|
|||||||
- name: Clean up after failed test
|
- name: Clean up after failed test
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
sudo systemctl stop stalwart || true
|
# Stop service
|
||||||
|
if command -v systemctl >/dev/null 2>&1; then
|
||||||
|
sudo systemctl stop stalwart || true
|
||||||
|
sudo systemctl disable stalwart || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Kill process if still running
|
||||||
|
sudo pkill -9 stalwart || true
|
||||||
|
|
||||||
|
# Remove installation
|
||||||
sudo rm -rf /opt/stalwart || true
|
sudo rm -rf /opt/stalwart || true
|
||||||
|
|
||||||
# Test on different Ubuntu versions
|
# Test on different Ubuntu versions
|
||||||
@@ -274,8 +335,15 @@ jobs:
|
|||||||
- name: Verify installation
|
- name: Verify installation
|
||||||
run: |
|
run: |
|
||||||
sleep 10
|
sleep 10
|
||||||
sudo systemctl is-active --quiet stalwart
|
|
||||||
echo "✓ Stalwart running on ${{ matrix.os }}"
|
# Check if process is running
|
||||||
|
if pgrep -x stalwart >/dev/null; then
|
||||||
|
echo "✓ Stalwart running on ${{ matrix.os }}"
|
||||||
|
else
|
||||||
|
echo "::error::Stalwart not running on ${{ matrix.os }}"
|
||||||
|
ps aux | grep stalwart || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Test API accessibility
|
- name: Test API accessibility
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user