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:
Nicola Murino
2020-01-09 12:00:37 +01:00
parent 37c602a477
commit eec60d6309
9 changed files with 169 additions and 73 deletions

View File

@@ -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")
}