From e177366be960d157ac1426a3c14c09b3f8a67957 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sat, 27 Jul 2019 21:19:30 +0200 Subject: [PATCH] windows: fix test cases --- sftpd/internal_test.go | 7 ++++++- sftpd/sftpd_test.go | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sftpd/internal_test.go b/sftpd/internal_test.go index ff8fe954..041b99e5 100644 --- a/sftpd/internal_test.go +++ b/sftpd/internal_test.go @@ -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", "") diff --git a/sftpd/sftpd_test.go b/sftpd/sftpd_test.go index c4ef8da8..1c785ef9 100644 --- a/sftpd/sftpd_test.go +++ b/sftpd/sftpd_test.go @@ -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()