mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
e2e: ensure group script check tests interpolation (#6972)
Fixes a bug introduced in 0aa58b9 where we're writing a test file to
a taskdir-interpolated location, which works when we `alloc exec` but
not in the jobspec for a group script check.
This changeset also makes the test safe to run multiple times by
namespacing the file with the alloc ID, which has the added bonus of
exercising our alloc interpolation code for group script checks.
This commit is contained in:
@@ -51,7 +51,7 @@ job "group_check" {
|
||||
interval = "2s"
|
||||
timeout = "2s"
|
||||
command = "cat"
|
||||
args = ["alive-2b"]
|
||||
args = ["/tmp/${NOMAD_ALLOC_ID}-alive-2b"]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ func (tc *ScriptChecksE2ETest) TestGroupScriptCheck(f *framework.F) {
|
||||
|
||||
// Check in warning state becomes healthy after check passes
|
||||
_, _, err := exec(nomadClient, allocs,
|
||||
[]string{"/bin/sh", "-c", "touch ${NOMAD_TASK_DIR}/alive-2b"})
|
||||
[]string{"/bin/sh", "-c", "touch /tmp/${NOMAD_ALLOC_ID}-alive-2b"})
|
||||
require.NoError(err)
|
||||
e2eutil.RequireConsulStatus(require, consulClient, "group-service-2", capi.HealthPassing)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user