diff --git a/e2e/isolation/doc.go b/e2e/isolation/doc.go new file mode 100644 index 000000000..d423392a9 --- /dev/null +++ b/e2e/isolation/doc.go @@ -0,0 +1,3 @@ +// Package isolation provides tests around various kinds of isolation, such as +// artifact downloading, PID namespacing, and chroot task environments. +package isolation diff --git a/e2e/isolation/input/alloc_exec.hcl b/e2e/isolation/input/alloc_exec.hcl new file mode 100644 index 000000000..c0986d290 --- /dev/null +++ b/e2e/isolation/input/alloc_exec.hcl @@ -0,0 +1,41 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +job "alloc_exec" { + + constraint { + attribute = "${attr.kernel.name}" + value = "linux" + } + + group "group" { + + update { + min_healthy_time = "2s" + } + + reschedule { + attempts = 0 + unlimited = false + } + + restart { + attempts = 0 + mode = "fail" + } + + task "sleep" { + driver = "exec" + + config { + command = "sleep" + args = ["infinity"] + } + + resources { + cpu = 10 + memory = 16 + } + } + } +} diff --git a/e2e/isolation/input/alloc_exec.nomad b/e2e/isolation/input/alloc_exec.nomad deleted file mode 100644 index e6ea63b63..000000000 --- a/e2e/isolation/input/alloc_exec.nomad +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -job "alloc_exec" { - datacenters = ["dc1"] - type = "service" - - constraint { - attribute = "${attr.kernel.name}" - value = "linux" - } - - group "main" { - task "main" { - driver = "exec" - - config { - command = "/bin/sleep" - args = ["30s"] - } - - resources { - cpu = 100 - memory = 64 - } - } - } -} diff --git a/e2e/isolation/input/alloc_exec_java.nomad b/e2e/isolation/input/alloc_exec_java.hcl similarity index 57% rename from e2e/isolation/input/alloc_exec_java.nomad rename to e2e/isolation/input/alloc_exec_java.hcl index 12f89c79d..46092540a 100644 --- a/e2e/isolation/input/alloc_exec_java.nomad +++ b/e2e/isolation/input/alloc_exec_java.hcl @@ -1,11 +1,28 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: MPL-2.0 -job "java_sleep" { - datacenters = ["dc1"] - type = "batch" +job "java_exec" { - group "java" { + constraint { + attribute = "${attr.kernel.name}" + value = "linux" + } + + group "group" { + + update { + min_healthy_time = "2s" + } + + reschedule { + attempts = 0 + unlimited = false + } + + restart { + attempts = 0 + mode = "fail" + } task "build" { lifecycle { @@ -24,19 +41,30 @@ job "java_sleep" { data = <