fix ping@openssh being passed to unsupported sshd (#326)

* add testcase

* Fix formatting in e2e/fixed_test.go

* disable ping until we have a solution
This commit is contained in:
Boshi Lian 2024-02-14 22:24:21 -08:00 committed by GitHub
parent 715bcbdb49
commit fb8eba9f91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 5 deletions

View file

@ -86,7 +86,7 @@ services:
- DOCKER_API_VERSION=1.40
build:
context: ../
target: builder
target: testrunner
args:
- BUILDTAGS=e2e
volumes:

View file

@ -40,12 +40,14 @@ func TestFixed(t *testing.T) {
"StrictHostKeyChecking=no",
"-o",
"UserKnownHostsFile=/dev/null",
"-o",
"RequestTTY=yes",
"-p",
piperport,
"-l",
"user",
"127.0.0.1",
fmt.Sprintf(`sh -c "echo -n %v > /shared/%v"`, randtext, targetfie),
fmt.Sprintf(`sh -c "echo SSHREADY && sleep 1 && echo -n %v > /shared/%v"`, randtext, targetfie), // sleep 1 to cover https://github.com/tg123/sshpiper/issues/323
)
if err != nil {
@ -56,7 +58,11 @@ func TestFixed(t *testing.T) {
enterPassword(stdin, stdout, "pass")
time.Sleep(time.Second) // wait for file flush
waitForStdoutContains(stdout, "SSHREADY", func(_ string) {
_, _ = stdin.Write([]byte(fmt.Sprintf("%v\n", "triggerping")))
})
time.Sleep(time.Second * 3) // wait for file flush
checkSharedFileContent(t, targetfie, randtext)
}