tests

package
v1.1.0-beta6 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VirtualMesh         *networkingv1.VirtualMesh
	VirtualMeshManifest utils.Manifest
)
View Source
var (
	BookinfoNamespace = "bookinfo"

	MgmtClusterName   = "mgmt-cluster"
	RemoteClusterName = "remote-cluster"

	MgmtMesh = &v1.ObjectRef{
		Name:      "istiod-istio-system-mgmt-cluster",
		Namespace: "gloo-mesh",
	}

	RemoteMesh = &v1.ObjectRef{
		Name:      "istiod-istio-system-remote-cluster",
		Namespace: "gloo-mesh",
	}

	CurlReviews = func() string {
		return CurlFromProductpage("http://reviews:9080/reviews/1")
	}

	CurlHelloServer = func() string {
		return CurlFromProductpage(fmt.Sprintf("http://%v:%v/", extensions.HelloServerHostname, extensions.HelloServerPort))
	}

	CurlRemoteReviews = func(federatedSuffix string) func() string {
		return func() string {
			return CurlFromProductpage(fmt.Sprintf("http://reviews.%v.svc.%v.%s:9080/reviews/1", BookinfoNamespace, RemoteClusterName, federatedSuffix))
		}
	}

	CurlRatings = func() string {
		return CurlFromProductpage("http://ratings:9080/ratings/1")
	}

	CurlUrl = func(url string) func() string {
		return func() string {
			return CurlFromProductpage(url)
		}
	}

	// Public to be used in enterprise
	CurlFromProductpage = func(url string) string {
		env := e2e.GetEnv()
		ctx, cancel := context.WithTimeout(context.Background(), time.Minute/2)
		defer cancel()
		out := env.Management.GetPod(ctx, BookinfoNamespace, "productpage").Curl(ctx, url, "-v")
		GinkgoWriter.Write([]byte(out))
		return out
	}

	CurlGateway = func(hostname, path, body, method string) string {
		out, err := exec.Command("curl", "--connect-timeout", "1", "--max-time", "5", "-H", hostname, "http://localhost:32000"+path, "-v", "-d", body, "-X", method).CombinedOutput()
		Expect(err).NotTo(HaveOccurred())

		GinkgoWriter.Write(out)

		return string(out)
	}
)

Shared test vars

Functions

func AccessPolicyTest

func AccessPolicyTest()

run tests for AccessPolicy CRD functionality

func DiscoveryTest added in v1.0.0

func DiscoveryTest()

run Enterprise Discovery regression tests

func FederateClusters added in v0.12.3

func FederateClusters(dynamicClient client.Client, flatNetwork bool)

exported for use in enterprise

func FederationTest

func FederationTest()

func InitializeTests

func InitializeTests() bool

initialize all tests in suite should be called from init() function or top level var

func NetworkingExtensionsTest

func NetworkingExtensionsTest()

func SetupClustersAndFederation

func SetupClustersAndFederation(customDeployFuc func())

Before running tests, federate the two clusters by creating a VirtualMesh with mTLS enabled.

func TeardownFederationAndClusters

func TeardownFederationAndClusters()

func TrafficPolicyTest

func TrafficPolicyTest()

Types

This section is empty.

Jump to

Keyboard shortcuts

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