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:
Tim Gross
2020-01-22 09:54:54 -05:00
committed by GitHub
parent 0b6b475e7d
commit 2a89e47746
2 changed files with 2 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ job "group_check" {
interval = "2s"
timeout = "2s"
command = "cat"
args = ["alive-2b"]
args = ["/tmp/${NOMAD_ALLOC_ID}-alive-2b"]
}
}

View File

@@ -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)