mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
e2e: refactor pids isolation tests (#17717)
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.
This commit is contained in:
70
e2e/isolation/input/alloc_exec_java.hcl
Normal file
70
e2e/isolation/input/alloc_exec_java.hcl
Normal file
@@ -0,0 +1,70 @@
|
||||
# Copyright (c) HashiCorp, Inc.
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
job "java_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 "build" {
|
||||
lifecycle {
|
||||
hook = "prestart"
|
||||
sidecar = false
|
||||
}
|
||||
|
||||
driver = "exec"
|
||||
config {
|
||||
command = "javac"
|
||||
args = ["-d", "${NOMAD_ALLOC_DIR}", "local/Sleep.java"]
|
||||
}
|
||||
|
||||
template {
|
||||
destination = "local/Sleep.java"
|
||||
data = <<EOH
|
||||
public class Sleep {
|
||||
public static void main(String... s) throws Exception {
|
||||
Thread.sleep(999999999);
|
||||
}
|
||||
}
|
||||
EOH
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 50
|
||||
memory = 64
|
||||
}
|
||||
}
|
||||
|
||||
task "sleep" {
|
||||
driver = "java"
|
||||
|
||||
config {
|
||||
class_path = "${NOMAD_ALLOC_DIR}"
|
||||
class = "Sleep"
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 50
|
||||
memory = 64
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user