2e2c578298
This PR refactors some old PID isolation tests to make use of the e2e/v3 packages. Should be quite a bit easier to read. Adds 'alloc exec' capability to the jobs3 package.
53 lines
804 B
HCL
53 lines
804 B
HCL
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
job "exec_host" {
|
|
type = "batch"
|
|
|
|
constraint {
|
|
attribute = "${attr.kernel.name}"
|
|
value = "linux"
|
|
}
|
|
|
|
group "group" {
|
|
reschedule {
|
|
attempts = 0
|
|
unlimited = false
|
|
}
|
|
|
|
restart {
|
|
attempts = 0
|
|
mode = "fail"
|
|
}
|
|
|
|
task "bash" {
|
|
driver = "exec"
|
|
|
|
config {
|
|
command = "bash"
|
|
args = [
|
|
"-c", "local/pid.sh"
|
|
]
|
|
pid_mode = "host"
|
|
ipc_mode = "host"
|
|
}
|
|
|
|
template {
|
|
data = <<EOF
|
|
#!/usr/bin/env bash
|
|
echo my pid is $BASHPID
|
|
EOF
|
|
|
|
destination = "local/pid.sh"
|
|
perms = "777"
|
|
change_mode = "noop"
|
|
}
|
|
|
|
resources {
|
|
cpu = 10
|
|
memory = 16
|
|
}
|
|
}
|
|
}
|
|
}
|