improve transfer error log and TestSCPErrors

This commit is contained in:
Nicola Murino
2019-09-09 08:57:11 +02:00
parent bd0eb2f0a8
commit f4507aeec2
2 changed files with 7 additions and 3 deletions

View File

@@ -2003,8 +2003,6 @@ func TestSCPErrors(t *testing.T) {
t.Skip("scp command not found, unable to execute this test")
}
u := getTestUser(true)
u.UploadBandwidth = 4096
u.DownloadBandwidth = 4096
user, _, err := api.AddUser(u, http.StatusOK)
if err != nil {
t.Errorf("unable to add user: %v", err)
@@ -2023,6 +2021,12 @@ func TestSCPErrors(t *testing.T) {
if err != nil {
t.Errorf("error uploading file via scp: %v", err)
}
user.UploadBandwidth = 512
user.DownloadBandwidth = 512
_, _, err = api.UpdateUser(user, http.StatusOK)
if err != nil {
t.Errorf("unable to update user: %v", err)
}
cmd := getScpDownloadCommand(localPath, remoteDownPath, false, false)
go func() {
if cmd.Run() == nil {