acceptance

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SkipInstanceReadyPollKey = "skip_instance_ready_poll"
)

Variables

View Source
var (
	PublicKeyMaterial string
	TestAccProviders  map[string]*schema.Provider
	TestAccProvider   *schema.Provider
	ConfigTemplates   *template.Template
	TestImageLatest   string
	TestImagePrevious string
)

Functions

func AssertInstanceReboot

func AssertInstanceReboot(t *testing.T, shouldRestart bool, instance *linodego.Instance) func()

func CheckEventAbsent added in v1.25.0

func CheckEventAbsent(name string, entityType linodego.EntityType, action linodego.EventAction) resource.TestCheckFunc

func CheckFirewallExists added in v1.25.0

func CheckFirewallExists(provider *schema.Provider, name string, firewall *linodego.Firewall) resource.TestCheckFunc

func CheckInstanceDestroy

func CheckInstanceDestroy(s *terraform.State) error

func CheckInstanceExists

func CheckInstanceExists(name string, instance *linodego.Instance) resource.TestCheckFunc

func CheckLKEClusterDestroy

func CheckLKEClusterDestroy(s *terraform.State) error

func CheckMongoDatabaseExists added in v1.28.0

func CheckMongoDatabaseExists(name string, db *linodego.MongoDatabase) resource.TestCheckFunc

func CheckMySQLDatabaseExists added in v1.28.0

func CheckMySQLDatabaseExists(name string, db *linodego.MySQLDatabase) resource.TestCheckFunc

func CheckPostgresDatabaseExists added in v1.28.0

func CheckPostgresDatabaseExists(name string, db *linodego.PostgresDatabase) resource.TestCheckFunc

func CheckResourceAttrContains added in v1.23.0

func CheckResourceAttrContains(resName string, path, desiredValue string) resource.TestCheckFunc

func CheckResourceAttrGreaterThan added in v1.23.0

func CheckResourceAttrGreaterThan(resName, path string, target int) resource.TestCheckFunc

func CheckResourceAttrNotEqual

func CheckResourceAttrNotEqual(resName string, path, notValue string) resource.TestCheckFunc

func CheckVolumeDestroy

func CheckVolumeDestroy(s *terraform.State) error

func CheckVolumeExists

func CheckVolumeExists(name string, volume *linodego.Volume) resource.TestCheckFunc

func CreateTempFile added in v1.26.0

func CreateTempFile(t *testing.T, name, content string) *os.File

func CreateTestProvider added in v1.28.0

func CreateTestProvider() (*schema.Provider, map[string]*schema.Provider)

func ExecuteTemplate

func ExecuteTemplate(t *testing.T, templateName string, data interface{}) string

func GetClientForSweepers

func GetClientForSweepers() (*linodego.Client, error)

func GetRandomOBJCluster added in v1.29.3

func GetRandomOBJCluster() (string, error)

GetRandomOBJCluster gets a random Object Storage cluster.

func GetRandomRegionWithCaps added in v1.29.3

func GetRandomRegionWithCaps(capabilities []string) (string, error)

GetRandomRegionWithCaps gets a random region given a list of region capabilities.

func GetRegionsWithCaps added in v1.29.3

func GetRegionsWithCaps(capabilities []string) ([]string, error)

GetRegionsWithCaps returns a list of regions that support the given capabilities.

func GetSSHClient

func GetSSHClient(t *testing.T, user, addr string) (client *ssh.Client)

func ModifyProviderMeta added in v1.28.0

func ModifyProviderMeta(provider *schema.Provider, modifier ProviderMetaModifier)

func OptInTest

func OptInTest(t *testing.T)

func PreCheck

func PreCheck(t *testing.T)

func RunTestRetry added in v1.29.2

func RunTestRetry(t *testing.T, maxAttempts int, f func(t *TRetry))

RunTestRetry attempts to retry the given test if an intermittent error occurs. This function wraps the given testing.T and handles errors accordingly. This should only be used for flapping API tests.

func ShouldSweep

func ShouldSweep(prefix, name string) bool

func SweeperListOptions

func SweeperListOptions(prefix, field string) *linodego.ListOptions

func TestMain

func TestMain(m *testing.M)

func TestProvider

func TestProvider(t *testing.T)

func ValidateResourceAttr added in v1.23.0

func ValidateResourceAttr(resName, path string, comparisonFunc AttrValidateFunc) resource.TestCheckFunc

Types

type AttrValidateFunc added in v1.23.0

type AttrValidateFunc func(val string) error

type ProviderMetaModifier added in v1.28.0

type ProviderMetaModifier func(ctx context.Context, config *helper.ProviderMeta) error

type TRetry added in v1.29.2

type TRetry struct {
	ErrorChannel   chan error
	SuccessChannel chan bool
	// contains filtered or unexported fields
}

TRetry implements testing.T with additional retry logic

func NewTRetry added in v1.29.2

func NewTRetry(t *testing.T) *TRetry

func (*TRetry) Cleanup added in v1.29.2

func (t *TRetry) Cleanup(f func())

func (*TRetry) Close added in v1.29.2

func (t *TRetry) Close()

func (*TRetry) Error added in v1.29.2

func (t *TRetry) Error(args ...any)

func (*TRetry) Errorf added in v1.29.2

func (t *TRetry) Errorf(format string, args ...any)

func (*TRetry) Fail added in v1.29.2

func (t *TRetry) Fail()

func (*TRetry) FailNow added in v1.29.2

func (t *TRetry) FailNow()

func (*TRetry) Failed added in v1.29.2

func (t *TRetry) Failed() bool

func (*TRetry) Fatal added in v1.29.2

func (t *TRetry) Fatal(args ...any)

func (*TRetry) Fatalf added in v1.29.2

func (t *TRetry) Fatalf(format string, args ...any)

func (*TRetry) Helper added in v1.29.2

func (t *TRetry) Helper()

func (*TRetry) Log added in v1.29.2

func (t *TRetry) Log(args ...any)

func (*TRetry) Logf added in v1.29.2

func (t *TRetry) Logf(format string, args ...any)

func (*TRetry) Name added in v1.29.2

func (t *TRetry) Name() string

func (*TRetry) Parallel added in v1.29.2

func (t *TRetry) Parallel()

func (*TRetry) Setenv added in v1.29.2

func (t *TRetry) Setenv(key, value string)

func (*TRetry) Skip added in v1.29.2

func (t *TRetry) Skip(args ...any)

func (*TRetry) SkipNow added in v1.29.2

func (t *TRetry) SkipNow()

func (*TRetry) Skipf added in v1.29.2

func (t *TRetry) Skipf(format string, args ...any)

func (*TRetry) Skipped added in v1.29.2

func (t *TRetry) Skipped() bool

func (*TRetry) TempDir added in v1.29.2

func (t *TRetry) TempDir() string

Jump to

Keyboard shortcuts

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