Skip to content

Commit

Permalink
e2e: ensure group script check tests interpolation (#6972)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tgross committed Jan 22, 2020
1 parent 0b6b475 commit 2a89e47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion e2e/consul/input/checks_group.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ job "group_check" {
interval = "2s"
timeout = "2s"
command = "cat"
args = ["alive-2b"]
args = ["/tmp/${NOMAD_ALLOC_ID}-alive-2b"]
}
}

Expand Down
2 changes: 1 addition & 1 deletion e2e/consul/script_checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 2a89e47

Please sign in to comment.