testing

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterResource      = "tanzu-mission-control_cluster"
	ClusterResourceVar   = "test_attach_cluster"
	ClusterDataSourceVar = "test_data_attach_cluster"

	// EKS Constants.
	EksClusterResource    = "tanzu-mission-control_ekscluster"
	EksClusterGroup       = "tanzu-mission-control_cluster_group"
	EksClusterResourceVar = "test_create_eks_cluster"
	EksClusterGroupVar    = "test_create_eks_cluster_group"
)
View Source
const (
	MetaTemplate = `meta {
		description = "resource with description"
		labels = {
			"key1" : "value1"
			"key2" : "value2"
		}
	}`
)

Variables

View Source
var (
	ClusterResourceName   = fmt.Sprintf("%s.%s", ClusterResource, ClusterResourceVar)
	ClusterDataSourceName = fmt.Sprintf("data.%s.%s", ClusterResource, ClusterDataSourceVar)

	EksClusterResourceName = fmt.Sprintf("%s.%s", EksClusterResource, EksClusterResourceVar)
	EksClusterGroupName    = fmt.Sprintf("data.%s.%s", EksClusterGroup, EksClusterGroupVar)
)

Functions

func GetTestProviderFactories

func GetTestProviderFactories(provider *schema.Provider) map[string]func() (*schema.Provider, error)

func MetaDataSourceAttributeCheck

func MetaDataSourceAttributeCheck(dataSourceName, resourceName string) []resource.TestCheckFunc

func MetaResourceAttributeCheck

func MetaResourceAttributeCheck(resourceName string) []resource.TestCheckFunc

func Parse added in v1.1.4

func Parse(m interface{}, objects string) (string, error)

func TestPreCheck

func TestPreCheck(t *testing.T) func()

Types

type AcceptanceTestType added in v1.1.4

type AcceptanceTestType int
const (
	AttachClusterType AcceptanceTestType = iota
	AttachClusterTypeWithKubeConfig
	AttachClusterTypeWithKubeconfigImageRegistry
	AttachClusterTypeWithKubeconfigProxy
	TkgAWSCluster
	TkgsCluster
	TkgVsphereCluster
	CreateEksCluster
)

type TestAcceptanceConfig added in v1.1.4

type TestAcceptanceConfig struct {
	ResourceName          string
	ResourceNameVar       string
	DataSourceNameVar     string
	Name                  string
	KubeConfigPath        string
	Meta                  string
	AccTestType           AcceptanceTestType
	TemplateData          string
	ManagementClusterName string
	ProvisionerName       string
	Version               string
	StorageClass          string
	ControlPlaneEndPoint  string
	// EKS
	KubernetesVersion        string
	Region                   string
	AWSAccountNumber         string
	CloudFormationTemplateID string
	CredentialName           string
	OrgID                    string
	ClusterGroupName         string
	ImageRegistry            string
	Proxy                    string
}

func TestGetDefaultAcceptanceConfig added in v1.1.4

func TestGetDefaultAcceptanceConfig() *TestAcceptanceConfig

func TestGetDefaultEksAcceptanceConfig added in v1.1.4

func TestGetDefaultEksAcceptanceConfig() *TestAcceptanceConfig

type TestAcceptanceOption added in v1.1.4

type TestAcceptanceOption func(config *TestAcceptanceConfig)

func WithClusterName added in v1.1.4

func WithClusterName(name string) TestAcceptanceOption

func WithDataSourceScript added in v1.1.4

func WithDataSourceScript() TestAcceptanceOption

func WithEKSCluster added in v1.1.4

func WithEKSCluster() TestAcceptanceOption

func WithKubeConfig added in v1.1.4

func WithKubeConfig() TestAcceptanceOption

func WithKubeConfigImageRegistry added in v1.2.1

func WithKubeConfigImageRegistry() TestAcceptanceOption

func WithKubeConfigProxy added in v1.2.1

func WithKubeConfigProxy() TestAcceptanceOption

func WithTKGmAWSCluster added in v1.1.4

func WithTKGmAWSCluster() TestAcceptanceOption

func WithTKGmVsphereCluster added in v1.1.4

func WithTKGmVsphereCluster() TestAcceptanceOption

func WithTKGsCluster added in v1.1.4

func WithTKGsCluster() TestAcceptanceOption

Jump to

Keyboard shortcuts

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