test

package
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	FakeOrganizationID   = "fake-org-id"
	FakeOrganizationName = "fake-org-name"

	FakeTrustZoneID   = "fake-tz-id"
	FakeTrustZoneName = "fake-tz-name"
	FakeTrustDomain   = "fake.trust.domain"

	FakeTrustZoneServerID        = "fake-tzs-id"
	FakeKubernetesNamespace      = "fake-kubernetes-namespace"
	FakeKubernetesServiceAccount = "fake-kubernetes-service-account"

	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"
	FakeDNSName       = "fake.name.example.org"

	FakeRoleBindingID = "fake-rb-id"
	FakeRoleID        = "fake-role-id"
	FakeUserSubject   = "fake-user-subject"
	FakeResourceID    = FakeAPBindingID
	FakeResourceType  = "AttestationPolicyBinding"
)

Variables

This section is empty.

Functions

func AssertClientImplementsService added in v0.44.1

func AssertClientImplementsService(t *testing.T, client any, desc grpc.ServiceDesc)

AssertClientImplementsService asserts that an SDK client implements all RPC methods and streams provided by a service.

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 FakeOrganization added in v0.30.0

func FakeOrganization() *organizationpb.Organization

func FakeRoleBinding added in v0.31.0

func FakeRoleBinding() *rolebindingpb.RoleBinding

func FakeTrustZone

func FakeTrustZone() *trustzonepb.TrustZone

func FakeTrustZoneServer added in v0.39.0

func FakeTrustZoneServer() *trustzoneserverpb.TrustZoneServer

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