Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 2.11 KB

test.md

File metadata and controls

63 lines (48 loc) · 2.11 KB

VMware Cloud on AWS

Testing the Terraform Provider for VMware Cloud on AWS

Testing the Terraform Provider for VMware Cloud on AWS requires having an VMware Cloud on AWS organization to test against. Generally, the acceptance tests create real resources, and often cost money to run.

Configuring Environment Variables

Set required environment variables based based on your infrastructure settings.

$ # clientId and client secret of the test OAuth2.0 app attached to the test organization with at least
$ # "Organization Member" role and service role  on "VMware Cloud on AWS" service that is allowed to deploy SDDCs.
$ # Note: it is recommended to use OAuth2.0 app with the least possible roles (the above mentioned) for testing
$ # purposes.
$ export CLIENT_ID=xxx
$ export CLIENT_SECRET=xxx
$ # Id of a VMC Org in which test SDDC are (to be) placed
$ export ORG_ID=xxxx
$ # Id of an existing SDDC used for SDDC data source (import) test
$ export TEST_SDDC_ID=xxx
$ # Name of above SDDC
$ export TEST_SDDC_NAME=xxx
$ # NSX URL of a non-ZEROCLOUD SDDC, used for real IP testing
$ export NSXT_REVERSE_PROXY_URL=xxx
$ # Account number of a connected to the above Org AWS account, required for test SDDC deployment
$ export AWS_ACCOUNT_NUMBER=xxx

Running the Acceptance Tests

Acceptance tests create real resources, and often cost money to run.

You can run the acceptance tests by running:

$ make testacc

If you want to run against a specific set of tests, run make testacc with the TESTARGS parameter containing the run mask. For example:

$ make testacc TESTARGS="-run=TestAccResourceVmcSddc_basic"

Additionally, A limited set of acceptance tests can be ran with the ZEROCLOUD cloud provider, which is much faster and cheaper, while providing decent API coverage:. For example:

$ make testacc TESTARGS="-run=TestAccResourceVmcSddcZerocloud"