Files
Cass Agent 55a617e880 test(sources): Add Docker-based SSH integration test infrastructure
Implements a reproducible SSH testing environment using Docker:
- Dockerfile.sshd: Alpine-based SSH server with rsync and test data
- ssh_test_helper.rs: RAII-style test helper for container management
- ssh_sync_integration.rs: Integration tests for sync operations

Features:
- Ephemeral SSH key generation per test run
- Dynamic port assignment for parallel test execution
- Pre-populated test data for Claude, Codex, and Gemini agents
- Tests marked with #[ignore = "requires Docker"]

Run with: cargo test --test ssh_sync_integration -- --ignored

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 09:05:36 -05:00

28 lines
774 B
Bash

#!/bin/bash
# Entrypoint script for SSH test container
# Allows injecting authorized keys via environment variable or volume mount
set -e
# If SSH_AUTHORIZED_KEY is provided, add it
if [ -n "$SSH_AUTHORIZED_KEY" ]; then
echo "$SSH_AUTHORIZED_KEY" > /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
echo "Added authorized key from environment"
fi
# If authorized_keys file was mounted, ensure correct permissions
if [ -f /root/.ssh/authorized_keys ]; then
chmod 600 /root/.ssh/authorized_keys
chown root:root /root/.ssh/authorized_keys
fi
# Print SSH fingerprints for debugging
echo "SSH host key fingerprints:"
for key in /etc/ssh/ssh_host_*_key.pub; do
ssh-keygen -lf "$key" 2>/dev/null || true
done
# Start SSH daemon
exec "$@"