From c0f6df7cfd21b53e72ab5dddef0db16b356cb9c8 Mon Sep 17 00:00:00 2001 From: Kris Hicks Date: Tue, 26 Jan 2021 11:42:23 -0800 Subject: [PATCH] Add test for alloc exec --- e2e/isolation/input/alloc_exec.nomad | 25 ++++++ .../input/{echo_pid.nomad => exec.nomad} | 6 +- e2e/isolation/input/raw_exec.nomad | 38 +++++++++ e2e/isolation/isolation.go | 78 ++++++++++++++++--- 4 files changed, 133 insertions(+), 14 deletions(-) create mode 100644 e2e/isolation/input/alloc_exec.nomad rename e2e/isolation/input/{echo_pid.nomad => exec.nomad} (89%) create mode 100644 e2e/isolation/input/raw_exec.nomad diff --git a/e2e/isolation/input/alloc_exec.nomad b/e2e/isolation/input/alloc_exec.nomad new file mode 100644 index 000000000..4c36d4af6 --- /dev/null +++ b/e2e/isolation/input/alloc_exec.nomad @@ -0,0 +1,25 @@ +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/echo_pid.nomad b/e2e/isolation/input/exec.nomad similarity index 89% rename from e2e/isolation/input/echo_pid.nomad rename to e2e/isolation/input/exec.nomad index 9ebc167c4..67989c1c5 100644 --- a/e2e/isolation/input/echo_pid.nomad +++ b/e2e/isolation/input/exec.nomad @@ -1,4 +1,4 @@ -job "echo_pid" { +job "exec" { datacenters = ["dc1"] type = "batch" @@ -7,8 +7,8 @@ job "echo_pid" { value = "linux" } - group "echo_pid" { - task "echo_pid" { + group "exec" { + task "exec" { driver = "exec" config { diff --git a/e2e/isolation/input/raw_exec.nomad b/e2e/isolation/input/raw_exec.nomad new file mode 100644 index 000000000..f14604132 --- /dev/null +++ b/e2e/isolation/input/raw_exec.nomad @@ -0,0 +1,38 @@ +job "raw_exec" { + datacenters = ["dc1"] + type = "batch" + + constraint { + attribute = "${attr.kernel.name}" + value = "linux" + } + + group "raw_exec" { + task "raw_exec" { + driver = "raw_exec" + + config { + command = "bash" + args = [ + "-c", "local/pid.sh" + ] + } + + template { + data = <