acceptance

package
v1.11.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SBC_REGION_NAME = os.Getenv("SBC_REGION_NAME")

	SBC_ENTERPRISE_PROJECT_ID      = os.Getenv("SBC_ENTERPRISE_PROJECT_ID")
	SBC_ENTERPRISE_PROJECT_ID_TEST = os.Getenv("SBC_ENTERPRISE_PROJECT_ID_TEST")
	SBC_PROJECT_ID                 = os.Getenv("SBC_PROJECT_ID")

	SBC_DEPRECATED_ENVIRONMENT = os.Getenv("SBC_DEPRECATED_ENVIRONMENT")

	SBC_ADMIN       = os.Getenv("SBC_ADMIN")
	SBC_DOMAIN_ID   = os.Getenv("SBC_DOMAIN_ID")
	SBC_DOMAIN_NAME = os.Getenv("SBC_DOMAIN_NAME")

	SBC_ACCESS_KEY = os.Getenv("SBC_ACCESS_KEY")
	SBC_SECRET_KEY = os.Getenv("SBC_SECRET_KEY")

	SBC_DLI_FLINK_JAR_OBS_PATH = os.Getenv("SBC_DLI_FLINK_JAR_OBS_PATH")

	SBC_SWR_SHARING_ACCOUNT = os.Getenv("SBC_SWR_SHARING_ACCOUNT")

	SBC_FGS_TRIGGER_LTS_AGENCY = os.Getenv("SBC_FGS_TRIGGER_LTS_AGENCY")
	SBC_OBS_BUCKET_NAME        = os.Getenv("SBC_OBS_BUCKET_NAME")
)
View Source
var TestAccProvider *schema.Provider

TestAccProvider is the "main" provider instance

View Source
var TestAccProviderFactories map[string]func() (*schema.Provider, error)

TestAccProviderFactories is a static map containing only the main provider instance

Functions

func CheckDeleted added in v1.11.0

func CheckDeleted(d *schema.ResourceData, err error, msg string) error

CheckDeleted checks the error to see if it's a 404 (Not Found) and, if so, sets the resource ID to the empty string instead of throwing an error.

func GetEnterpriseProjectID added in v1.11.0

func GetEnterpriseProjectID(d *schema.ResourceData, config *config.Config) string

GetEnterpriseProjectID returns the enterprise_project_id that was specified in the resource. If it was not set, the provider-level value is checked. The provider-level value can either be set by the `enterprise_project_id` argument or by SBC_ENTERPRISE_PROJECT_ID.

func GetRegion added in v1.11.0

func GetRegion(d *schema.ResourceData, config *config.Config) string

GetRegion returns the region that was specified in the resource. If a region was not set, the provider-level region is checked. The provider-level region can either be set by the region argument or by SBC_REGION_NAME.

func InitDataSourceCheck

func InitDataSourceCheck(sourceName string) *resourceCheck

InitDataSourceCheck build a 'resourceCheck' object. Only used to check datasource attributes.

Parameters:
  resourceName:    The resource name is used to check in the terraform.State.e.g. : sbercloud_waf_domain.domain_1.
Return:
  *resourceCheck: resourceCheck object

func InitResourceCheck

func InitResourceCheck(resourceName string, resourceObject interface{}, getResourceFunc ServiceFunc) *resourceCheck

InitResourceCheck build a 'resourceCheck' object. The common test methods are provided in 'resourceCheck'.

Parameters:
  resourceName:    The resource name is used to check in the terraform.State.e.g. : sbercloud_waf_domain.domain_1.
  resourceObject:  Resource object, used to check whether the resource exists in SberCloud.
  getResourceFunc: The function used to get the resource object.
Return:
  *resourceCheck: resourceCheck object

func RandomAccResourceName

func RandomAccResourceName() string

func RandomAccResourceNameWithDash

func RandomAccResourceNameWithDash() string

func RandomCidr

func RandomCidr() string

func RandomCidrAndGatewayIp

func RandomCidrAndGatewayIp() (string, string)

func ReplaceVarsForTest added in v1.11.2

func ReplaceVarsForTest(rs *terraform.ResourceState, linkTmpl string) (string, error)

func TestAccPreCheck

func TestAccPreCheck(t *testing.T)

func TestAccPreCheckAdminOnly

func TestAccPreCheckAdminOnly(t *testing.T)

func TestAccPreCheckDeprecated

func TestAccPreCheckDeprecated(t *testing.T)

func TestAccPreCheckEpsID

func TestAccPreCheckEpsID(t *testing.T)

func TestAccPreCheckFgsTrigger added in v1.11.0

func TestAccPreCheckFgsTrigger(t *testing.T)

lintignore:AT003

func TestAccPreCheckOBS added in v1.10.0

func TestAccPreCheckOBS(t *testing.T)

func TestAccPreCheckOBSBucket added in v1.11.0

func TestAccPreCheckOBSBucket(t *testing.T)

func TestAccPreCheckProject

func TestAccPreCheckProject(t *testing.T)

func TestAccPreCheckSWRDomian added in v1.11.0

func TestAccPreCheckSWRDomian(t *testing.T)

lintignore:AT003

func TestBaseComputeResources added in v1.11.4

func TestBaseComputeResources(name string) string

TestBaseComputeResources vpc, subnet, security group, availability zone, keypair, image, flavor

func TestBaseNetwork added in v1.11.0

func TestBaseNetwork(name string) string

func TestCheckResourceAttrWithVariable

func TestCheckResourceAttrWithVariable(resourceName, key, varStr string) resource.TestCheckFunc

TestCheckResourceAttrWithVariable validates the variable in state for the given name/key combination.

Parameters:
  resourceName: The resource name is used to check in the terraform.State.
  key:          The field name of the resource.
  variable:     The variable name of the value to be checked.

  variable such like ${sbercloud_waf_certificate.certificate_1.id}
  or ${data.sbercloud_waf_policies.policies_2.policies.0.id}

func TestSecGroup added in v1.11.0

func TestSecGroup(name string) string

TestSecGroup can be referred as `sbercloud_networking_secgroup.test`

func TestVpc added in v1.11.0

func TestVpc(name string) string

TestVpc can be referred as `sbercloud_vpc.test` and `sbercloud_vpc_subnet.test`

func UnsubscribePrePaidResource added in v1.11.0

func UnsubscribePrePaidResource(d *schema.ResourceData, config *config.Config, resourceIDs []string) error

UnsubscribePrePaidResource impl the action of unsubscribe resource

Types

type ResourceCheck added in v1.11.4

type ResourceCheck struct {
	// contains filtered or unexported fields
}

ResourceCheck resource check object

func (*ResourceCheck) CheckMultiResourcesExists added in v1.11.4

func (rc *ResourceCheck) CheckMultiResourcesExists(count int) resource.TestCheckFunc

CheckMultiResourcesExists checks whether multiple resources created by count are both existed.

Parameters:
  count: the expected number of resources that will be created.

func (*ResourceCheck) CheckResourceDestroy added in v1.11.4

func (rc *ResourceCheck) CheckResourceDestroy() resource.TestCheckFunc

CheckResourceDestroy check whether resources destroyed

func (*ResourceCheck) CheckResourceExists added in v1.11.4

func (rc *ResourceCheck) CheckResourceExists() resource.TestCheckFunc

CheckResourceExists check whether resources exist

type ServiceFunc

type ServiceFunc func(*config.Config, *terraform.ResourceState) (interface{}, error)

ServiceFunc the SberCloud resource query functions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL