acceptance

package
v1.12.5 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: MPL-2.0 Imports: 15 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")
	SBC_DWS_MUTIL_AZS                      = os.Getenv("SBC_DWS_MUTIL_AZS")
	SBC_ENTERPRISE_MIGRATE_PROJECT_ID_TEST = os.Getenv("SBC_ENTERPRISE_MIGRATE_PROJECT_ID_TEST")

	SBC_CHARGING_MODE   = os.Getenv("SBC_CHARGING_MODE")
	SBC_KMS_ENVIRONMENT = os.Getenv("SBC_KMS_ENVIRONMENT")

	SBC_SHARED_BACKUP_ID     = os.Getenv("SBC_SHARED_BACKUP_ID")
	SBC_DEST_PROJECT_ID      = os.Getenv("SBC_DEST_PROJECT_ID")
	SBC_DEST_PROJECT_ID_TEST = os.Getenv("SBC_DEST_PROJECT_ID_TEST")
	SBC_DEST_REGION          = os.Getenv("SBC_DEST_REGION")

	SBC_CERTIFICATE_CONTENT                = os.Getenv("SBC_CERTIFICATE_CONTENT")
	SBC_CERTIFICATE_CONTENT_UPDATE         = os.Getenv("SBC_CERTIFICATE_CONTENT_UPDATE")
	SBC_CERTIFICATE_PRIVATE_KEY            = os.Getenv("SBC_CERTIFICATE_PRIVATE_KEY")
	SBC_NEW_CERTIFICATE_CONTENT            = os.Getenv("SBC_NEW_CERTIFICATE_CONTENT")
	SBC_NEW_CERTIFICATE_PRIVATE_KEY        = os.Getenv("SBC_NEW_CERTIFICATE_PRIVATE_KEY")
	SBC_CERTIFICATE_ROOT_CA                = os.Getenv("SBC_CERTIFICATE_ROOT_CA")
	SBC_NEW_CERTIFICATE_ROOT_CA            = os.Getenv("SBC_NEW_CERTIFICATE_ROOT_CA")
	SBC_GM_CERTIFICATE_CONTENT             = os.Getenv("SBC_GM_CERTIFICATE_CONTENT")
	SBC_GM_CERTIFICATE_PRIVATE_KEY         = os.Getenv("SBC_GM_CERTIFICATE_PRIVATE_KEY")
	SBC_GM_ENC_CERTIFICATE_CONTENT         = os.Getenv("SBC_GM_ENC_CERTIFICATE_CONTENT")
	SBC_GM_ENC_CERTIFICATE_PRIVATE_KEY     = os.Getenv("SBC_GM_ENC_CERTIFICATE_PRIVATE_KEY")
	SBC_GM_CERTIFICATE_CHAIN               = os.Getenv("SBC_GM_CERTIFICATE_CHAIN")
	SBC_NEW_GM_CERTIFICATE_CONTENT         = os.Getenv("SBC_NEW_GM_CERTIFICATE_CONTENT")
	SBC_NEW_GM_CERTIFICATE_PRIVATE_KEY     = os.Getenv("SBC_NEW_GM_CERTIFICATE_PRIVATE_KEY")
	SBC_NEW_GM_ENC_CERTIFICATE_CONTENT     = os.Getenv("SBC_NEW_GM_ENC_CERTIFICATE_CONTENT")
	SBC_NEW_GM_ENC_CERTIFICATE_PRIVATE_KEY = os.Getenv("SBC_NEW_GM_ENC_CERTIFICATE_PRIVATE_KEY")
	SBC_NEW_GM_CERTIFICATE_CHAIN           = os.Getenv("SBC_NEW_GM_CERTIFICATE_CHAIN")
	SBC_CODEARTS_RESOURCE_POOL_ID          = os.Getenv("SBC_CODEARTS_RESOURCE_POOL_ID")

	SBC_RDS_INSTANCE_ID = os.Getenv("SBC_RDS_INSTANCE_ID")

	SBC_OBS_ENDPOINT        = os.Getenv("SBC_OBS_ENDPOINT")
	SBC_SFS_TURBO_BACKUP_ID = os.Getenv("SBC_SFS_TURBO_BACKUP_ID")

	SBC_VPC_ID            = os.Getenv("SBC_VPC_ID")
	SBC_SUBNET_ID         = os.Getenv("SBC_SUBNET_ID")
	SBC_SECURITY_GROUP_ID = os.Getenv("SBC_SECURITY_GROUP_ID")
)
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 TestAccPreCheckAcceptBackup added in v1.12.2

func TestAccPreCheckAcceptBackup(t *testing.T)

func TestAccPreCheckAdminOnly

func TestAccPreCheckAdminOnly(t *testing.T)

func TestAccPreCheckCertificateFull added in v1.12.3

func TestAccPreCheckCertificateFull(t *testing.T)

lintignore:AT003

func TestAccPreCheckCertificateWithoutRootCA added in v1.12.3

func TestAccPreCheckCertificateWithoutRootCA(t *testing.T)

lintignore:AT003

func TestAccPreCheckChargingMode added in v1.12.1

func TestAccPreCheckChargingMode(t *testing.T)

lintignore:AT003

func TestAccPreCheckCodeArtsDeployResourcePoolID added in v1.12.3

func TestAccPreCheckCodeArtsDeployResourcePoolID(t *testing.T)

lintignore:AT003

func TestAccPreCheckDeprecated

func TestAccPreCheckDeprecated(t *testing.T)

func TestAccPreCheckDestProjectIds added in v1.12.2

func TestAccPreCheckDestProjectIds(t *testing.T)

func TestAccPreCheckEpsID

func TestAccPreCheckEpsID(t *testing.T)

func TestAccPreCheckFgsTrigger added in v1.11.0

func TestAccPreCheckFgsTrigger(t *testing.T)

func TestAccPreCheckGMCertificate added in v1.12.3

func TestAccPreCheckGMCertificate(t *testing.T)

lintignore:AT003

func TestAccPreCheckKms added in v1.12.2

func TestAccPreCheckKms(t *testing.T)

func TestAccPreCheckMigrateEpsID added in v1.12.1

func TestAccPreCheckMigrateEpsID(t *testing.T)

func TestAccPreCheckMutilAZ added in v1.12.2

func TestAccPreCheckMutilAZ(t *testing.T)

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 TestAccPreCheckOBSEndpoint added in v1.12.4

func TestAccPreCheckOBSEndpoint(t *testing.T)

func TestAccPreCheckProject

func TestAccPreCheckProject(t *testing.T)

func TestAccPreCheckProjectID added in v1.12.0

func TestAccPreCheckProjectID(t *testing.T)

func TestAccPreCheckRdsInstanceId added in v1.12.4

func TestAccPreCheckRdsInstanceId(t *testing.T)

func TestAccPreCheckReplication added in v1.12.2

func TestAccPreCheckReplication(t *testing.T)

func TestAccPreCheckSWRDomian added in v1.11.0

func TestAccPreCheckSWRDomian(t *testing.T)

func TestAccPreCheckSecurityGroupId added in v1.12.4

func TestAccPreCheckSecurityGroupId(t *testing.T)

func TestAccPreCheckSubnetId added in v1.12.4

func TestAccPreCheckSubnetId(t *testing.T)

func TestAccPreCheckUpdateCertificateContent added in v1.12.3

func TestAccPreCheckUpdateCertificateContent(t *testing.T)

func TestAccPreCheckVpcId added in v1.12.4

func TestAccPreCheckVpcId(t *testing.T)

func TestAccPrecheckDomainId added in v1.12.0

func TestAccPrecheckDomainId(t *testing.T)

func TestAccPrecheckSFSTurboBackupId added in v1.12.4

func TestAccPrecheckSFSTurboBackupId(t *testing.T)

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) CheckResourceDestroy added in v1.11.4

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

CheckResourceDestroy check whether resources destroyed

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