test

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FakeTrustZoneID   = "fake-tz-id"
	FakeTrustZoneName = "fake-tz-name"
	FakeTrustDomain   = "fake.trust.domain"

	FakeClusterID   = "fake-cluster-id"
	FakeClusterName = "fake-cluster-name"

	FakeAgentToken = "fake-agent-token"
	FakeAgentID    = "fake-agent-id"

	FakeFSID   = "fake-fs-id"
	FakeFSName = "fake-fs-name"

	FakeAttestationPolicyID   = "fake-ap-id"
	FakeAttestationPolicyName = "fake-ap-name"

	FakeAPBindingID = "fake-ap-binding-id"

	FakeWorkloadID      = "fake-workload-id"
	FakeK8sPodUID       = "fake-k8s-pod-uid"
	FakeK8sPodName      = "fake-k8s-pod-name"
	FakeK8sPodNamespace = "fake-k8s-pod-namespace"

	FakeIdentityID    = "fake-identity-id"
	FakeSPIFFEID      = "spiffe://fake.trust.domain/ns/fake-k8s-pod-namespace/sa/fake-k8s-pod-service-account"
	FakeParentID      = "spiffe://fake.trust.domain/spire/agent/k8s_psat/fake-cluster-name/fake-spire-agent"
	FakeSelectorType  = "fake-selector-type"
	FakeSelectorValue = "fake-selector-value"
)

Variables

This section is empty.

Functions

func FakeAPBinding

func FakeAPBinding() *apbindingpb.APBinding

func FakeAgent

func FakeAgent() *agentpb.Agent

func FakeAttestationPolicy

func FakeAttestationPolicy() *attestationpolicypb.AttestationPolicy

func FakeBundle

func FakeBundle() *types.Bundle

func FakeCluster

func FakeCluster() *clusterpb.Cluster

func FakeFederatedService

func FakeFederatedService() *federatedservicepb.FederatedService

func FakeIdentity added in v0.24.2

func FakeIdentity() *identitypb.Identity

func FakeK8sPodWorkload added in v0.24.2

func FakeK8sPodWorkload() *workloadpb.Workload

func FakeTrustZone

func FakeTrustZone() *trustzonepb.TrustZone

func PtrOf

func PtrOf[T any](val T) *T

func RequireUnimplemented

func RequireUnimplemented(t *testing.T, err error)

RequireUnimplemented requires that an error is a gRPC Status with the Unimplemented code.

Types

type TestServer

type TestServer struct {
	Listener *bufconn.Listener
	Server   *grpc.Server
	// contains filtered or unexported fields
}

TestServer provides a gRPC server for testing with an in-memory bufconn transport.

func NewTestServer

func NewTestServer(t *testing.T) *TestServer

func (*TestServer) CreateClientConn

func (ts *TestServer) CreateClientConn() *grpc.ClientConn

BuildTestConn creates a gRPC client connection for the provided TestServer.

func (*TestServer) Serve

func (ts *TestServer) Serve()

Jump to

Keyboard shortcuts

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