INNER CODE UNIT · Go

PreCheckStandalone

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

func PreCheckStandalone(t *testing.T) {
	p := testProvider()
	server, err := p.InstanceServer("", "", "")
	if err != nil {
		t.Fatal(err)
	}

	if server.IsClustered() {
		t.Skipf("Test %q skipped. LXD server is not running in standalone mode.", t.Name())
	}
}

// PreCheckServerTests skips the test unless the LXD_TEST_SERVER environment
// variable is set to a truthy value. Server tests modify global LXD server
// configuration and are therefore opt-in.
func PreCheckServerTests(t *testing.T) {
	if !shared.IsTrue(os.Getenv("LXD_TEST_SERVER")) {
		t.Skipf("Test %q skipped. LXD_TEST_SERVER is not set to %q.", t.Name(), "true")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…