acctest

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TestImage = "images:alpine/edge/amd64"

TestImage is a constant that specifies the default image used in all tests.

Variables

View Source
var ProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
	"incus": providerserver.NewProtocol6WithError(provider.NewIncusProvider("test")()),
}

ProtoV6ProviderFactories are used to instantiate a provider during acceptance testing. The factory function will be invoked for every Terraform CLI command executed to create a provider server to which the CLI can reattach.

Functions

func PreCheck

func PreCheck(t *testing.T)

PreCheck is a precheck that ensures test requirements, such as existing environment variables, are met. It should be included in every acc test.

func PreCheckAPIExtensions

func PreCheckAPIExtensions(t *testing.T, extensions ...string)

PreCheckAPIExtensions skips the test if the Incus server does not support the required extensions.

func PreCheckClustering

func PreCheckClustering(t *testing.T)

PreCheckClustering skips the test if Incus server is not running in clustered mode.

func PreCheckIncusVersion

func PreCheckIncusVersion(t *testing.T, versionConstraint string)

PreCheckIncusVersion skips the test if the server's version does not satisfy the provided version constraints. The version constraints are detailed at: https://pkg.go.dev/github.com/hashicorp/go-version#readme-version-constraints

func PreCheckVirtualization

func PreCheckVirtualization(t *testing.T)

PreCheckVirtualization skips the test if the Incus server does not support virtualization.

func PrintResourceState

func PrintResourceState(t *testing.T, resName string) resource.TestCheckFunc

PrintResourceState is a test check function that prints the entire state of a resource with the given name. This check should be used only for debuging purposes.

Example resource name: incus_profile.profile2

Types

This section is empty.

Jump to

Keyboard shortcuts

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