mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
custom actions: add env vars
action parameters can now be readed from env vars too. Added a timeout for the command execution
This commit is contained in:
@@ -69,17 +69,17 @@ func TestWrongActions(t *testing.T) {
|
||||
Command: badCommand,
|
||||
HTTPNotificationURL: "",
|
||||
}
|
||||
err := executeAction(operationDownload, "username", "path", "", "")
|
||||
err := executeAction(operationDownload, "username", "path", "", "", 0)
|
||||
if err == nil {
|
||||
t.Errorf("action with bad command must fail")
|
||||
}
|
||||
err = executeAction(operationDelete, "username", "path", "", "")
|
||||
err = executeAction(operationDelete, "username", "path", "", "", 0)
|
||||
if err != nil {
|
||||
t.Errorf("action not configured must silently fail")
|
||||
}
|
||||
actions.Command = ""
|
||||
actions.HTTPNotificationURL = "http://foo\x7f.com/"
|
||||
err = executeAction(operationDownload, "username", "path", "", "")
|
||||
err = executeAction(operationDownload, "username", "path", "", "", 0)
|
||||
if err == nil {
|
||||
t.Errorf("action with bad url must fail")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user