Documentation ¶
Index ¶
- Variables
- func EnsureProvidersAreInitialised()
- func Environment() (*azure.Environment, error)
- func EnvironmentName() string
- func GetAuthConfig(t *testing.T) *authentication.Config
- func PreCheck(t *testing.T)
- func RandTimeInt() int
- func RequiresImportError(resourceName string) *regexp.Regexp
- type ClientAuthDetails
- type ClientData
- type DisappearsStepData
- type Regions
- type TestData
- func (td TestData) Client() ClientData
- func (td TestData) DataSourceTest(t *testing.T, steps []resource.TestStep)
- func (td TestData) DisappearsStep(data DisappearsStepData) resource.TestStep
- func (td TestData) ImportStep(ignore ...string) resource.TestStep
- func (td *TestData) RandomIntOfLength(len int) int
- func (td *TestData) RandomStringOfLength(len int) string
- func (td TestData) RequiresImportErrorStep(configBuilder func(data TestData) string) resource.TestStep
- func (td TestData) ResourceTest(t *testing.T, testResource types.TestResource, steps []resource.TestStep)
Constants ¶
This section is empty.
Variables ¶
var AzureProvider *schema.Provider
var SupportedProviders map[string]terraform.ResourceProvider
Functions ¶
func EnsureProvidersAreInitialised ¶
func EnsureProvidersAreInitialised()
func Environment ¶
func Environment() (*azure.Environment, error)
func EnvironmentName ¶
func EnvironmentName() string
func GetAuthConfig ¶
func GetAuthConfig(t *testing.T) *authentication.Config
func RandTimeInt ¶
func RandTimeInt() int
func RequiresImportError ¶
Types ¶
type ClientAuthDetails ¶
type ClientData ¶
type ClientData struct { // Default is the Default Credentials being used to connect to Azure Default ClientAuthDetails // Alternate is an alternate set of Credentials being used to connect to Azure Alternate ClientAuthDetails // SubscriptionID is the UUID of the Azure Subscription where tests are being run SubscriptionID string // SubscriptionIDAlt is the UUID of the Alternate Azure Subscription where tests are being run SubscriptionIDAlt string // TenantID is the UUID of the Azure Tenant where tests are being run TenantID string // Are we connected as a Service Principal // this exists for allowing folks to run the test suite via other // credentials in the future; but requires code changes first IsServicePrincipal bool }
type DisappearsStepData ¶
type DisappearsStepData struct { // Config is a function which returns the Terraform Configuration which should be used for this step Config func(data TestData) string // TestResource is a reference to a TestResource which can destroy the resource // to enable a Disappears step TestResource types.TestResourceVerifyingRemoved }
type Regions ¶
type Regions struct { // Primary is the Primary/Default Azure Region which should be used for testing Primary string // Secondary is the Secondary Azure Region which should be used for testing Secondary string // Ternary is the Ternary Azure Region which should be used for testing Ternary string }
Regions is a list of Azure Regions which can be used for test purposes
type TestData ¶
type TestData struct { // Locations is a set of Azure Regions which should be used for this Test Locations Regions // RandomInteger is a random integer which is unique to this test case RandomInteger int // RandomString is a random 5 character string is unique to this test case RandomString string // ResourceName is the fully qualified resource name, comprising of the // resource type and then the resource label // e.g. `azurerm_resource_group.test` ResourceName string // ResourceType is the Terraform Resource Type - `azurerm_resource_group` ResourceType string // Environment is a struct containing Details about the Azure Environment // that we're running against Environment azure.Environment // EnvironmentName is the name of the Azure Environment where we're running EnvironmentName string // MetadataURL is the url of the endpoint where the environment is obtained MetadataURL string // contains filtered or unexported fields }
func BuildTestData ¶
BuildTestData generates some test data for the given resource
func (TestData) Client ¶
func (td TestData) Client() ClientData
Client returns a struct containing information about the Client being used to connect to Azure
func (TestData) DataSourceTest ¶
func (TestData) DisappearsStep ¶
func (td TestData) DisappearsStep(data DisappearsStepData) resource.TestStep
DisappearsStep returns a Test Step which first confirms the resource exists then destroys it, and expects that the plan at the end of this should show that the resource needs to be created (since it's been destroyed)
func (TestData) ImportStep ¶
ImportStep returns a Test Step which Imports the Resource, optionally ignoring any fields which may not be imported (for example, as they're not returned from the API)
func (*TestData) RandomIntOfLength ¶
RandomIntOfLength is a random 8 to 18 digit integer which is unique to this test case
func (*TestData) RandomStringOfLength ¶
RandomStringOfLength is a random 1 to 1024 character string which is unique to this test case
func (TestData) RequiresImportErrorStep ¶
func (td TestData) RequiresImportErrorStep(configBuilder func(data TestData) string) resource.TestStep
RequiresImportErrorStep returns a Test Step which expects a Requires Import error to be returned when running this step