Skip to content

Commit dc47074

Browse files
committed
Use proper sshd startup waiting code
Signed-off-by: Jiahao XU <[email protected]>
1 parent a733206 commit dc47074

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: taiki-e/install-action@cargo-llvm-cov
3131
- run: |
3232
# Wait for startup of openssh-server
33-
sleep 15
33+
timeout 15 ./wait_for_sshd_start_up.sh
3434
chmod 600 .test-key
3535
mkdir /tmp/openssh-rs
3636
ssh -i .test-key -v -p 2222 -l test-user localhost -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/tmp/openssh-rs/known_hosts whoami

.github/workflows/minimal.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@v2
3131
- run: |
3232
# Wait for startup of openssh-server
33-
sleep 15
33+
timeout 15 ./wait_for_sshd_start_up.sh
3434
chmod 600 .test-key
3535
mkdir /tmp/openssh-rs
3636
ssh -i .test-key -v -p 2222 -l test-user 127.0.0.1 -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/tmp/openssh-rs/known_hosts whoami

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
- uses: actions/checkout@v2
3131
- run: |
3232
# Wait for startup of openssh-server
33+
timeout 15 ./wait_for_sshd_start_up.sh
3334
sleep 15
3435
chmod 600 .test-key
3536
mkdir /tmp/openssh-rs

wait_for_sshd_start_up.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
until ssh-keyscan -p 2222 localhost; do
6+
sleep 1
7+
done

0 commit comments

Comments
 (0)