fixture

package
v0.0.54 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0 Imports: 20 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

Overview

Package fixture serves an execution provider over mTLS on a loopback port, for tests of its clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Certificate

func Certificate(
	t testing.TB,
	parent *x509.Certificate,
	parentKey *ecdsa.PrivateKey,
	serverName string,
	client bool,
) (tls.Certificate, *x509.Certificate, *ecdsa.PrivateKey)

Certificate issues a P-256 certificate signed by parent, or a self-signed CA when parent is nil. Client certificates carry clientIdentity; server certificates name localhost or example.test.

func ServeExecutor

func ServeExecutor(t testing.TB, register func(*grpc.Server)) grpc.ClientConnInterface

ServeExecutor serves register's services in memory, as one executor Pod would.

Types

type Options

type Options struct {
	Ready func() bool
	// Executor receives file and command calls; nil refuses them.
	Executor grpc.ClientConnInterface
	// NoExecutorServices omits the executor services, as older providers do.
	NoExecutorServices bool
	// Wrap, if set, intercepts the provider API.
	Wrap func(executionv1.ExecutionProviderServiceServer) executionv1.ExecutionProviderServiceServer
}

Options configures ServeProvider.

type Server

type Server struct {
	Endpoint  string
	ClientTLS *tls.Config
	Stop      func()
}

Server is a provider at Endpoint that accepts ClientTLS.

func Serve

func Serve(t testing.TB, register func(*grpc.Server)) Server

Serve serves the services register adds behind mTLS.

func ServeProvider

func ServeProvider(t testing.TB, backend kubeprovider.Backend, opts Options) Server

ServeProvider serves the provider handler over backend.

Jump to

Keyboard shortcuts

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