Skip to content

Commit

Permalink
Merge pull request nutanix#103 from terraform-providers/preCheckEnvVa…
Browse files Browse the repository at this point in the history
…riables

Added preCheck function to verify that env variables were set
  • Loading branch information
PacoDw authored Mar 24, 2020
2 parents 87e8a0e + 314440e commit 6ffc91a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nutanix/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ func TestProvider_impl(t *testing.T) {
}

func testAccPreCheck(t *testing.T) {
if os.Getenv("NUTANIX_USERNAME") == "" ||
os.Getenv("NUTANIX_PASSWORD") == "" ||
os.Getenv("NUTANIX_INSECURE") == "" ||
os.Getenv("NUTANIX_PORT") == "" ||
os.Getenv("NUTANIX_ENDPOINT") == "" {
t.Fatal("`NUTANIX_USERNAME`,`NUTANIX_PASSWORD`,`NUTANIX_INSECURE`,`NUTANIX_PORT`,`NUTANIX_ENDPOINT` must be set for acceptance testing")
}
}

func randIntBetween(min, max int) int {
Expand Down

0 comments on commit 6ffc91a

Please sign in to comment.