INNER CODE UNIT · Go

PreCheckServerTests

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

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")
	}
}

// PreCheckCeph skips the test unless a Ceph cluster is available for acceptance
// testing. It returns the Ceph cluster name, the CephFS file system name, and
// the Ceph Object Gateway endpoint, all read from the LXD_CEPH_CLUSTER,
// LXD_CEPH_CEPHFS, and LXD_CEPH_CEPHOBJECT_RADOSGW environment variables. These
// are set by the CI workflow when MicroCeph is installed on the test runner.
func PreCheckCeph(t *testing.T) (clusterName string, cephfsName string, radosgwEndpoint string) {
	clusterName = os.Getenv("LXD_CEPH_CLUSTER")
	cephfsName = os.Getenv("LXD_CEPH_CEPHFS")
	radosgwEndpoint = os.Getenv("LXD_CEPH_CEPHOBJECT_RADOSGW")

	if clusterName == "" || cephfsName == "" || radosgwEndpoint == "" {
		t.Skipf("Test %q skipped. Ceph environment variables (LXD_CEPH_CLUSTER, LXD_CEPH_CEPHFS, LXD_CEPH_CEPHOBJECT_RADOSGW) are not set.", t.Name())

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…