add test for kill signal in required signals
update changelog
This commit is contained in:
parent
77ab41124b
commit
3f231a0856
|
@ -11,6 +11,8 @@ __BACKWARDS INCOMPATIBILITIES:__
|
|||
IMPROVEMENTS:
|
||||
* core: Allow operators to reload TLS certificate and key files via SIGHUP
|
||||
[GH-3479]
|
||||
* core: allow configurable stop signals for a task, when drivers support
|
||||
sending stop signals. [GH-1755]
|
||||
* core: Allow agents to be run in `rpc_upgrade_mode` when migrating a cluster
|
||||
to TLS rather than changing `heartbeat_grace`
|
||||
* api: Allocations now track and return modify time in addition to create time
|
||||
|
@ -30,7 +32,6 @@ IMPROVEMENTS:
|
|||
* driver/docker: Adds support for `ulimit` and `sysctl` options [GH-3568]
|
||||
* driver/docker: Adds support for StopTimeout (set to the same value as
|
||||
kill_timeout [GH-3601]
|
||||
* driver/exec: allow controlling the stop signal in exec/raw_exec [GH-1755]
|
||||
* driver/rkt: Add support for passing through user [GH-3612]
|
||||
* driver/qemu: Support graceful shutdowns on unix platforms [GH-3411]
|
||||
* template: Updated to consul template 0.19.4 [GH-3543]
|
||||
|
|
|
@ -3228,7 +3228,9 @@ type Task struct {
|
|||
ShutdownDelay time.Duration
|
||||
|
||||
// The kill signal to use for the task. This is an optional specification,
|
||||
// and if not set, the driver will default to SIGINT
|
||||
|
||||
// KillSignal is the kill signal to use for the task. This is an optional
|
||||
// specification and defaults to SIGINT
|
||||
KillSignal string
|
||||
}
|
||||
|
||||
|
|
|
@ -806,6 +806,26 @@ func TestJob_RequiredSignals(t *testing.T) {
|
|||
},
|
||||
}
|
||||
|
||||
j2 := &Job{
|
||||
TaskGroups: []*TaskGroup{
|
||||
{
|
||||
Name: "foo",
|
||||
Tasks: []*Task{
|
||||
{
|
||||
Name: "t1",
|
||||
KillSignal: "SIGQUIT",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
e2 := map[string]map[string][]string{
|
||||
"foo": {
|
||||
"t1": {"SIGQUIT"},
|
||||
},
|
||||
}
|
||||
|
||||
cases := []struct {
|
||||
Job *Job
|
||||
Expected map[string]map[string][]string
|
||||
|
@ -818,6 +838,10 @@ func TestJob_RequiredSignals(t *testing.T) {
|
|||
Job: j1,
|
||||
Expected: e1,
|
||||
},
|
||||
{
|
||||
Job: j2,
|
||||
Expected: e2,
|
||||
},
|
||||
}
|
||||
|
||||
for i, c := range cases {
|
||||
|
|
Loading…
Reference in a new issue