INNER CODE UNIT · Go

PreCheck

terraform-lxd/terraform-provider-lxd · internal/acctest/checks.go:26

func PreCheck(t *testing.T) {
	// if os.Getenv("TEST_LXD_REQUIRED_VAR") == "" {
	// 	t.Fatal("TEST_LXD_REQUIRED_VAR must be set for acceptance tests")
	// }
}

// PreCheckVMTests skips VM tests if the LXD_TEST_SKIP_VMS environment variable is set.
func PreCheckVMTests(t *testing.T) {
	if shared.IsTrue(os.Getenv("LXD_TEST_SKIP_VMS")) {
		t.Skipf("Test %q skipped. VM tests are disabled because LXD_TEST_SKIP_VMS is set.", t.Name())
	}
}

// PreCheckLxdVersion 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 PreCheckLxdVersion(t *testing.T, versionConstraint string) {
	p := testProvider()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…