Files
Seth Hoenig c17333d74a e2e refactor oversubscription (#19060)
* e2e: remove old oversubscription test

* e2e: fixup and cleanup oversubscription test suite

Fix and cleanup this old oversubscription test.

* use t.Cleanup instead of defer in tests
2023-11-10 09:25:32 -06:00

55 lines
955 B
HCL

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
job "oversubscription-exec" {
type = "batch"
constraint {
attribute = "${attr.kernel.name}"
operator = "="
value = "linux"
}
constraint {
attribute = "${attr.os.cgroups.version}"
operator = "="
value = "2"
}
group "group" {
task "sleep" {
driver = "exec"
config {
command = "/bin/sh"
args = ["-c", "sleep infinity"]
}
resources {
cpu = 500
memory = 20
memory_max = 30
}
}
task "cat" {
driver = "pledge"
lifecycle {
hook = "poststart"
}
config {
command = "/bin/cat"
args = ["/sys/fs/cgroup/nomad.slice/share.slice/${NOMAD_ALLOC_ID}.sleep.scope/memory.max"]
unveil = ["r:/sys/fs/cgroup/"]
}
resources {
cpu = 100
memory = 20
}
}
}
}