change test
This commit is contained in:
@@ -18,7 +18,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Run SSH server
|
- name: Run SSH server
|
||||||
run: |
|
run: |
|
||||||
docker network create test-net || true
|
docker network rm test-net || true
|
||||||
|
docker network create test-net
|
||||||
docker rm -f ssh-server-test || true
|
docker rm -f ssh-server-test || true
|
||||||
docker run -d --network test-net --name ssh-server-test -e COMMAND="/bin/sh" ssh-server-test
|
docker run -d --network test-net --name ssh-server-test -e COMMAND="/bin/sh" ssh-server-test
|
||||||
sleep 2
|
sleep 2
|
||||||
@@ -30,8 +31,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Test SSH connection
|
- name: Test SSH connection
|
||||||
run: |
|
run: |
|
||||||
output=$(docker run --rm --network test-net alpine sh -c "apk add --no-cache openssh-client >/dev/null 2>&1 && ssh -p 22 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=10 root@ssh-server-test 'echo test559920'")
|
ip=$(docker inspect ssh-server-test | jq -r '.[0].NetworkSettings.Networks."test-net".IPAddress')
|
||||||
echo "OUTPUT $output"
|
output=$(docker run --rm --network test-net alpine sh -c "apk add --no-cache openssh-client >/dev/null 2>&1 && ssh -p 22 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=10 root@$ip 'echo test559920' 2>/dev/null")
|
||||||
if echo "$output" | grep -q "test559920"; then
|
if echo "$output" | grep -q "test559920"; then
|
||||||
echo "SSH connection test passed"
|
echo "SSH connection test passed"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user