fix test cases

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2024-05-29 19:35:42 +02:00
parent faa994e3b3
commit 5bde4b92a2
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -1197,9 +1197,9 @@ func TestProxyProtocol(t *testing.T) {
assert.NoError(t, checkBasicSFTP(client))
}
conn, client, err = getSftpClientWithAddr(user, usePubKey, "127.0.0.1:2224")
if !assert.Error(t, err) {
client.Close()
conn.Close()
if assert.NoError(t, err) {
defer client.Close()
defer conn.Close()
}
_, err = httpdtest.RemoveUser(user, http.StatusOK)
assert.NoError(t, err)