sftp actions: add a parameter to distinguish local and remote files

This commit is contained in:
Nicola Murino
2020-01-23 23:23:28 +01:00
parent 5f4efc9148
commit 6884ce3f3e
6 changed files with 16 additions and 12 deletions

View File

@@ -130,17 +130,17 @@ func TestWrongActions(t *testing.T) {
Command: badCommand,
HTTPNotificationURL: "",
}
err := executeAction(operationDownload, "username", "path", "", "", 0)
err := executeAction(operationDownload, "username", "path", "", "", 0, true)
if err == nil {
t.Errorf("action with bad command must fail")
}
err = executeAction(operationDelete, "username", "path", "", "", 0)
err = executeAction(operationDelete, "username", "path", "", "", 0, true)
if err != nil {
t.Errorf("action not configured must silently fail")
}
actions.Command = ""
actions.HTTPNotificationURL = "http://foo\x7f.com/"
err = executeAction(operationDownload, "username", "path", "", "", 0)
err = executeAction(operationDownload, "username", "path", "", "", 0, true)
if err == nil {
t.Errorf("action with bad url must fail")
}