add PTY handler
This commit is contained in:
@@ -29,18 +29,18 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Test SSH connection
|
||||
run: |
|
||||
ip=$(docker inspect ssh-server-test | jq -r '.[0].NetworkSettings.Networks."test-net".IPAddress')
|
||||
echo "Server IP: $ip"
|
||||
output=$( { docker run --rm --network test-net alpine sh -c "apk add --no-cache openssh-client && ssh -p 22 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=10 root@$ip 'echo test559920'" ; } 2>&1 ; true )
|
||||
echo "Captured output: '$output'"
|
||||
if echo "$output" | grep -q "test559920"; then
|
||||
echo "SSH connection test passed"
|
||||
else
|
||||
echo "SSH connection test failed: $output"
|
||||
exit 1
|
||||
fi
|
||||
- name: Test SSH connection
|
||||
run: |
|
||||
ip=$(docker inspect ssh-server-test | jq -r '.[0].NetworkSettings.Networks."test-net".IPAddress')
|
||||
echo "Server IP: $ip"
|
||||
output=$( { docker run --rm --network test-net alpine sh -c "apk add --no-cache openssh-client && timeout 5 ssh -t -p 22 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=10 root@$ip" ; } 2>&1 ; true )
|
||||
echo "Captured output: '$output'"
|
||||
if echo "$output" | grep -q "Welcome to"; then
|
||||
echo "SSH connection test passed"
|
||||
else
|
||||
echo "SSH connection test failed: $output"
|
||||
exit 1
|
||||
fi
|
||||
docker stop ssh-server-test && docker rm ssh-server-test && docker network rm test-net
|
||||
|
||||
build-and-push:
|
||||
|
||||
Reference in New Issue
Block a user