Files
nomad/e2e/e2eutil/input/restart-node.nomad
Tim Gross a156ca7b71 e2e: test for allocations replacement on disconnected clients (#12375)
This test exercises the behavior of clients that become disconnected
and have their allocations replaced. Future test cases will exercise
the `max_client_disconnect` field on the job spec.
2022-03-25 12:26:43 -04:00

36 lines
580 B
HCL

variable "nodeID" {
type = string
}
variable "time" {
type = string
default = "0"
}
job "restart-node" {
type = "batch"
datacenters = ["dc1", "dc2"]
group "group" {
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
constraint {
attribute = "${node.unique.id}"
value = "${var.nodeID}"
}
task "task" {
driver = "raw_exec"
config {
command = "/bin/sh"
args = ["-c",
"systemctl stop nomad; sleep ${var.time}; systemctl start nomad"]
}
}
}
}