From 0ff1b3c983da4c7d1f7ab02a3af004a3b1d61e9e Mon Sep 17 00:00:00 2001 From: PacoDw <__pm@outlook.com> Date: Mon, 23 Mar 2020 13:37:19 -0600 Subject: [PATCH] test: added preCheck function to use it in all the TF test --- nutanix/provider_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nutanix/provider_test.go b/nutanix/provider_test.go index 3335a4621..d23d37218 100644 --- a/nutanix/provider_test.go +++ b/nutanix/provider_test.go @@ -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 {