Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hashicorp/nomad
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Mar 4, 2017
2 parents 498b077 + 339f007 commit 527672b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions command/integration_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package command_test

import (
"io/ioutil"
"os"
"os/exec"
"testing"
)

func TestIntegration_Command_NomadInit(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "nomadtest-rootsecretdir")
if err != nil {
t.Fatalf("unable to create tempdir for test: %v", err)
}
defer os.RemoveAll(tmpDir)

{
cmd := exec.Command("nomad", "init")
cmd.Dir = tmpDir
if err := cmd.Run(); err != nil {
t.Fatalf("error running init: %v", err)
}
}

{
cmd := exec.Command("nomad", "validate", "example.nomad")
cmd.Dir = tmpDir
cmd.Env = []string{`NOMAD_ADDR=http://127.0.0.2:1025`}
if err := cmd.Run(); err != nil {
t.Fatalf("error validating example.nomad: %v", err)
}
}
}

0 comments on commit 527672b

Please sign in to comment.