INNER CODE UNIT · Go

PreCheckLocalServerHTTPS

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

func PreCheckLocalServerHTTPS(t *testing.T) string {
	address := testRemotes()[testProviderRemoteName].Address
	if strings.HasPrefix(address, "unix://") {
		address = "https://127.0.0.1:8443"
	}

	conn, err := net.DialTimeout("tcp", strings.TrimPrefix(address, "https://"), 1*time.Second)
	if err != nil {
		t.Skipf("Test %q skipped. LXD server is not available on %q.", t.Name(), address)
	}

	_ = conn.Close()

	return address
}

// ConfigureTrustPassword sets and returns the trust password. If the server
// does not support trust password, the test is skipped.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…