.
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 18s

This commit is contained in:
Your Name
2025-05-10 12:51:19 +12:00
parent 9e9d80570c
commit d070baed0a
6 changed files with 80 additions and 11 deletions

View File

@ -74,26 +74,58 @@ else
fi
echo
# Test working directory feature
echo "Test 5: Working directory"
JSON='{"command":"pwd","working_directory":"/tmp"}'
BASE64=$(echo -n "$JSON" | base64)
echo "JSON: $JSON"
echo "Running command (should show /tmp)..."
OUTPUT=$(build/runner "$BASE64")
if [ $? -eq 0 ] && [[ "$OUTPUT" == "/tmp"* ]]; then
echo "✅ Test 5 passed (command ran in the correct directory)"
else
echo "❌ Test 5 failed, unexpected output: '$OUTPUT'"
exit 1
fi
echo
# Optional SSH test (disabled by default)
# Set ENABLE_SSH_TEST=1 to enable this test
if [ "${ENABLE_SSH_TEST}" = "1" ]; then
echo "Test 5: SSH to localhost (make sure SSH server is running and you can connect to localhost)"
echo "Test 6: SSH to localhost (make sure SSH server is running and you can connect to localhost)"
if [ -f "examples/local_ssh.json" ]; then
echo "Using examples/local_ssh.json for the test..."
./run.sh examples/local_ssh.json || {
echo "❌ Test 5 failed"
echo "❌ Test 6 failed"
echo "Note: This test requires SSH server running on localhost and proper key-based authentication."
echo "Check your SSH configuration or disable this test."
exit 1
}
echo "✅ Test 5 passed"
echo "✅ Test 6 passed"
else
echo "❌ Test 5 failed: examples/local_ssh.json not found"
echo "❌ Test 6 failed: examples/local_ssh.json not found"
exit 1
fi
echo
echo "Test 7: SSH with working directory (make sure SSH server is running and you can connect to localhost)"
if [ -f "examples/ssh_working_dir.json" ]; then
echo "Using examples/ssh_working_dir.json for the test..."
OUTPUT=$(./run.sh examples/ssh_working_dir.json | grep "/tmp")
if [[ "$OUTPUT" == *"/tmp"* ]]; then
echo "✅ Test 7 passed (SSH command ran in the correct directory)"
else
echo "❌ Test 7 failed, directory was not changed correctly"
echo "Note: This test requires SSH server running on localhost and proper key-based authentication."
exit 1
fi
else
echo "❌ Test 7 failed: examples/ssh_working_dir.json not found"
exit 1
fi
echo
else
echo "Test 5: SSH test disabled (set ENABLE_SSH_TEST=1 to enable)"
echo "Test 6-7: SSH tests disabled (set ENABLE_SSH_TEST=1 to enable)"
echo
fi