mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-21 23:20:24 +00:00
windows: fix test cases
This commit is contained in:
parent
c9e6fa0dd6
commit
e177366be9
2 changed files with 7 additions and 2 deletions
|
@ -1,14 +1,19 @@
|
|||
package sftpd
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestWrongActions(t *testing.T) {
|
||||
actionsCopy := actions
|
||||
badCommand := "/bad/command"
|
||||
if runtime.GOOS == "windows" {
|
||||
badCommand = "C:\\bad\\command"
|
||||
}
|
||||
actions = Actions{
|
||||
ExecuteOn: []string{operationDownload},
|
||||
Command: "/bad/command",
|
||||
Command: badCommand,
|
||||
HTTPNotificationURL: "",
|
||||
}
|
||||
err := executeAction(operationDownload, "username", "path", "")
|
||||
|
|
|
@ -737,7 +737,7 @@ func TestBandwidthAndConnections(t *testing.T) {
|
|||
t.Errorf("download bandwidth throttling not respected, elapsed: %v, wanted: %v", elapsed, wantedDownloadElapsed)
|
||||
}
|
||||
// test disconnection
|
||||
c = sftpUploadNonBlocking(testFilePath, testFileName, testFileSize, client)
|
||||
c = sftpUploadNonBlocking(testFilePath, testFileName+"_partial", testFileSize, client)
|
||||
waitForActiveTransfer()
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
sftpd.CheckIdleConnections()
|
||||
|
|
Loading…
Reference in a new issue