Documentation
¶
Index ¶
- Constants
- Variables
- func GetApiServerClient(t *testing.T, serverInfo *ApiServerInfo) *http.Client
- func InjectProxyStartFailures(port int32, failures uint32)
- func MakeResourceCleanupRequest(ctx context.Context, serverInfo *ApiServerInfo) (*http.Request, error)
- func NewLoggingWriteCloser(log logr.Logger, inner io.Writer) usvc_io.WriteSyncerCloser
- func NewTestProxy(mode apiv1.PortProtocol, listenAddress string, listenPort int32, ...) proxy.Proxy
- func TestFingerprint(ts *dcptunproto.TunnelSpec) dcptunproto.TunnelRequestFingerprint
- func WaitApiServerStatus(ctx context.Context, client *http.Client, serverInfo *ApiServerInfo, ...) error
- func WaitObjectCount[T commonapi.ObjectStruct, LT commonapi.ObjectList, ...](t *testing.T, ctx context.Context, client ctrl_client.Client, ...)
- func WaitObjectDeleted[T commonapi.ObjectStruct, PT commonapi.PObjectStruct[T]](t *testing.T, ctx context.Context, client ctrl_client.Client, deleted PT)
- func WaitObjectExists[T commonapi.ObjectStruct, LT commonapi.ObjectList, ...](t *testing.T, ctx context.Context, client ctrl_client.Client, ...) PT
- type ApiServerFlag
- type ApiServerInfo
- type StartFailureData
- type TestContainerOrchestrator
- func (to *TestContainerOrchestrator) BuildImage(ctx context.Context, options containers.BuildImageOptions) error
- func (to *TestContainerOrchestrator) CaptureContainerLogs(ctx context.Context, containerNameOrId string, ...) error
- func (to *TestContainerOrchestrator) CheckStatus(_ context.Context, _ containers.CachedRuntimeStatusUsage) containers.ContainerRuntimeStatus
- func (to *TestContainerOrchestrator) Close() error
- func (to *TestContainerOrchestrator) ConnectNetwork(ctx context.Context, options containers.ConnectNetworkOptions) error
- func (*TestContainerOrchestrator) ContainerHost() string
- func (to *TestContainerOrchestrator) CreateContainer(ctx context.Context, options containers.CreateContainerOptions) (string, error)
- func (to *TestContainerOrchestrator) CreateFiles(ctx context.Context, options containers.CreateFilesOptions) error
- func (to *TestContainerOrchestrator) CreateNetwork(ctx context.Context, options containers.CreateNetworkOptions) (string, error)
- func (to *TestContainerOrchestrator) CreateVolume(ctx context.Context, options containers.CreateVolumeOptions) error
- func (to *TestContainerOrchestrator) DefaultNetworkName() string
- func (to *TestContainerOrchestrator) DisconnectNetwork(ctx context.Context, options containers.DisconnectNetworkOptions) error
- func (to *TestContainerOrchestrator) EnsureBackgroundStatusUpdates(ctx context.Context)
- func (to *TestContainerOrchestrator) ExecContainer(ctx context.Context, options containers.ExecContainerOptions) (<-chan int32, error)
- func (to *TestContainerOrchestrator) FailMatchingContainers(ctx context.Context, name string, exitCode int32, stdErr string)
- func (to *TestContainerOrchestrator) GetCreatedFiles(name string) ([]*containerCreateFile, error)
- func (to *TestContainerOrchestrator) GetDiagnostics(ctx context.Context) (containers.ContainerDiagnostics, error)
- func (to *TestContainerOrchestrator) GetSocketFilePath() string
- func (to *TestContainerOrchestrator) HasImage(id string) bool
- func (to *TestContainerOrchestrator) ImageCount() int
- func (to *TestContainerOrchestrator) InspectContainers(ctx context.Context, options containers.InspectContainersOptions) ([]containers.InspectedContainer, error)
- func (to *TestContainerOrchestrator) InspectImages(ctx context.Context, options containers.InspectImagesOptions) ([]containers.InspectedImage, error)
- func (to *TestContainerOrchestrator) InspectNetworks(ctx context.Context, options containers.InspectNetworksOptions) ([]containers.InspectedNetwork, error)
- func (to *TestContainerOrchestrator) InspectVolumes(ctx context.Context, options containers.InspectVolumesOptions) ([]containers.InspectedVolume, error)
- func (*TestContainerOrchestrator) IsDefault() bool
- func (to *TestContainerOrchestrator) ListContainers(ctx context.Context, options containers.ListContainersOptions) ([]containers.ListedContainer, error)
- func (to *TestContainerOrchestrator) ListNetworks(ctx context.Context, options containers.ListNetworksOptions) ([]containers.ListedNetwork, error)
- func (*TestContainerOrchestrator) Name() string
- func (to *TestContainerOrchestrator) PullImage(ctx context.Context, options containers.PullImageOptions) (string, error)
- func (to *TestContainerOrchestrator) RemoveContainers(ctx context.Context, options containers.RemoveContainersOptions) ([]string, error)
- func (to *TestContainerOrchestrator) RemoveNetworks(ctx context.Context, options containers.RemoveNetworksOptions) ([]string, error)
- func (to *TestContainerOrchestrator) RemoveVolumes(ctx context.Context, options containers.RemoveVolumesOptions) ([]string, error)
- func (to *TestContainerOrchestrator) RunContainer(ctx context.Context, options containers.RunContainerOptions) (string, error)
- func (to *TestContainerOrchestrator) SetHealthcheckMatchingContainers(ctx context.Context, name string, healthcheck containers.ContainerHealthcheck)
- func (to *TestContainerOrchestrator) SetRuntimeHealth(healthy bool)
- func (to *TestContainerOrchestrator) SimulateContainerExecCommandLogging(container string, command string, target apiv1.LogStreamSource, content []byte) error
- func (to *TestContainerOrchestrator) SimulateContainerExecExit(ctx context.Context, container string, command string, exitCode int32) error
- func (to *TestContainerOrchestrator) SimulateContainerExit(ctx context.Context, name string, exitCode int32) error
- func (to *TestContainerOrchestrator) SimulateContainerLogging(containerName string, target apiv1.LogStreamSource, content []byte) error
- func (to *TestContainerOrchestrator) SimulateContainerRestart(ctx context.Context, name string) error
- func (to *TestContainerOrchestrator) SimulateContainerStartupLogs(name string, stdout, stderr []byte)
- func (to *TestContainerOrchestrator) SimulateHealthcheck(ctx context.Context, name string, health *containers.InspectedContainerHealth) error
- func (to *TestContainerOrchestrator) StartContainers(ctx context.Context, options containers.StartContainersOptions) ([]string, error)
- func (to *TestContainerOrchestrator) StopContainers(ctx context.Context, options containers.StopContainersOptions) ([]string, error)
- func (to *TestContainerOrchestrator) WatchContainers(sink chan<- containers.EventMessage) (*pubsub.Subscription[containers.EventMessage], error)
- func (to *TestContainerOrchestrator) WatchNetworks(sink chan<- containers.EventMessage) (*pubsub.Subscription[containers.EventMessage], error)
- type TestContainerOrchestratorOption
- type TestContainerPortConfig
- type TestIdeRun
- type TestIdeRunner
- func (r *TestIdeRunner) FindAll(exePath string, cond func(run TestIdeRun) bool) []TestIdeRun
- func (r *TestIdeRunner) SimulateFailedRunStart(exeName types.NamespacedName, startupError error) error
- func (r *TestIdeRunner) SimulateRunEnd(runID controllers.RunID, exitCode int32) error
- func (r *TestIdeRunner) SimulateRunStart(isDesiredRun func(types.NamespacedName, *TestIdeRun) bool, ...) error
- func (r *TestIdeRunner) SimulateSuccessfulRunStart(runID controllers.RunID, pid process.Pid_t) error
- func (r *TestIdeRunner) StartRun(_ context.Context, exe *apiv1.Executable, ...) *controllers.ExecutableStartResult
- func (r *TestIdeRunner) StopRun(_ context.Context, runID controllers.RunID, _ logr.Logger) error
- type TestProcessExecutableRunner
- func (r *TestProcessExecutableRunner) InstallAutoExecution(ae testutil.AutoExecution)
- func (e *TestProcessExecutableRunner) RemoveAutoExecution(sc testutil.ProcessSearchCriteria)
- func (r *TestProcessExecutableRunner) StartRun(ctx context.Context, exe *apiv1.Executable, ...) *controllers.ExecutableStartResult
- func (r *TestProcessExecutableRunner) StopRun(ctx context.Context, runID controllers.RunID, log logr.Logger) error
- type TestProxy
- func (tp *TestProxy) Configure(config proxy.ProxyConfig) error
- func (tp *TestProxy) EffectiveAddress() string
- func (tp *TestProxy) EffectivePort() int32
- func (tp *TestProxy) ListenAddress() string
- func (tp *TestProxy) ListenPort() int32
- func (tp *TestProxy) Start() error
- func (tp *TestProxy) State() proxy.ProxyState
- type TestTunnelControlClient
- func (t *TestTunnelControlClient) DeleteTunnel(ctx context.Context, tr *dcptunproto.TunnelRef, opts ...grpc.CallOption) (*emptypb.Empty, error)
- func (t *TestTunnelControlClient) DisableTunnel(rf dcptunproto.TunnelRequestFingerprint) bool
- func (t *TestTunnelControlClient) EnableTunnel(tunnelSpec *dcptunproto.TunnelSpec)
- func (t *TestTunnelControlClient) GetTunnelSpec(rf dcptunproto.TunnelRequestFingerprint) *dcptunproto.TunnelSpec
- func (t *TestTunnelControlClient) NewStreamsConnection(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[dcptunproto.NewStreamResult, dcptunproto.StreamRef], ...)
- func (t *TestTunnelControlClient) PrepareTunnel(ctx context.Context, req *dcptunproto.TunnelReq, _ ...grpc.CallOption) (*dcptunproto.TunnelSpec, error)
- func (t *TestTunnelControlClient) Shutdown(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
Constants ¶
const ( TestEventActionStopWithoutRemove containers.EventAction = "stop_without_remove" // Range of ports used for "host port" if container port configuration does not specify a host port. // (Docker/Podman assigns a random port in this case) // Note that these ports are not actually used during the test (no sockets are bound to them), // they are just for verification purposes. MinRandomHostPort int = 40001 MaxRandomHostPort int = 50000 )
const AutoStartExecutableAnnotation = "test.usvc-dev.developer.microsoft.com/auto-start-executable"
const InvalidTunnelID uint32 = 0
Variables ¶
var (
ContainerNameAttribute string = apiv1.GroupVersion.Group + ".container_name"
)
Functions ¶
func GetApiServerClient ¶
func GetApiServerClient(t *testing.T, serverInfo *ApiServerInfo) *http.Client
func NewLoggingWriteCloser ¶
func NewTestProxy ¶
func TestFingerprint ¶
func TestFingerprint(ts *dcptunproto.TunnelSpec) dcptunproto.TunnelRequestFingerprint
Creates a TunnelRequestFingerprint from a proto.TunnelSpec, compatible with ones created from TunnelReq. Used for testing only.
func WaitApiServerStatus ¶
func WaitApiServerStatus( ctx context.Context, client *http.Client, serverInfo *ApiServerInfo, expectedStatus apiserver.ApiServerExecutionStatus, ) error
func WaitObjectCount ¶
func WaitObjectCount[T commonapi.ObjectStruct, LT commonapi.ObjectList, PT commonapi.PObjectStruct[T], PLT commonapi.PObjectList[T, LT, PT]]( t *testing.T, ctx context.Context, client ctrl_client.Client, expectedCount int, contextStr string, selector func(obj PT) bool, )
func WaitObjectDeleted ¶
func WaitObjectDeleted[T commonapi.ObjectStruct, PT commonapi.PObjectStruct[T]]( t *testing.T, ctx context.Context, client ctrl_client.Client, deleted PT, )
func WaitObjectExists ¶
func WaitObjectExists[T commonapi.ObjectStruct, LT commonapi.ObjectList, PT commonapi.PObjectStruct[T], PLT commonapi.PObjectList[T, LT, PT]]( t *testing.T, ctx context.Context, client ctrl_client.Client, contextStr string, selector func(obj PT) (bool, error), ) PT
Types ¶
type ApiServerFlag ¶
type ApiServerFlag uint32
const ( ApiServerFlagsNone ApiServerFlag = 0 ApiServerUseTrueContainerOrchestrator ApiServerFlag = 1 )
type ApiServerInfo ¶
type ApiServerInfo struct {
// Stops the API server process and cleans up associated resources.
Dispose func()
// The event that will be set when the API server process exits.
ApiServerExited *concurrency.AutoResetEvent
// The event that will be set when the cleanup of the API server and associated resources is complete.
ApiServerDisposalComplete *concurrency.AutoResetEvent
// Strongly-typed client for the API server.
Client ctrl_client.Client
// REST client for the API server.
RestClient *clientgorest.RESTClient
// Configuration for the client used to connect to the API server.
ClientConfig *clientgorest.Config
// Container orchestrator used by the API server.
ContainerOrchestrator containers.ContainerOrchestrator
// The process ID for the API server process.
ApiServerPID process.Pid_t
// contains filtered or unexported fields
}
ApiServerInfo contains data for interacting with DCP API server instance.
func StartApiServer ¶
func StartApiServer( testRunCtx context.Context, flags ApiServerFlag, log logr.Logger, ) (*ApiServerInfo, error)
Starts the API server in a separate process.
type StartFailureData ¶
Data structure to keep track of how many times a proxy start should fail, and how many times the ServiceReconciler has attempted to start the proxy for a given port.
func GetStartFailureData ¶
func GetStartFailureData(port int32) (StartFailureData, bool)
type TestContainerOrchestrator ¶
type TestContainerOrchestrator struct {
// contains filtered or unexported fields
}
func NewTestContainerOrchestrator ¶
func NewTestContainerOrchestrator( lifetimeCtx context.Context, log logr.Logger, opts TestContainerOrchestratorOption, ) (*TestContainerOrchestrator, error)
func (*TestContainerOrchestrator) BuildImage ¶
func (to *TestContainerOrchestrator) BuildImage(ctx context.Context, options containers.BuildImageOptions) error
func (*TestContainerOrchestrator) CaptureContainerLogs ¶
func (to *TestContainerOrchestrator) CaptureContainerLogs(ctx context.Context, containerNameOrId string, stdout usvc_io.WriteSyncerCloser, stderr usvc_io.WriteSyncerCloser, options containers.StreamContainerLogsOptions) error
func (*TestContainerOrchestrator) CheckStatus ¶
func (to *TestContainerOrchestrator) CheckStatus(_ context.Context, _ containers.CachedRuntimeStatusUsage) containers.ContainerRuntimeStatus
func (*TestContainerOrchestrator) Close ¶
func (to *TestContainerOrchestrator) Close() error
func (*TestContainerOrchestrator) ConnectNetwork ¶
func (to *TestContainerOrchestrator) ConnectNetwork(ctx context.Context, options containers.ConnectNetworkOptions) error
func (*TestContainerOrchestrator) ContainerHost ¶
func (*TestContainerOrchestrator) ContainerHost() string
func (*TestContainerOrchestrator) CreateContainer ¶
func (to *TestContainerOrchestrator) CreateContainer(ctx context.Context, options containers.CreateContainerOptions) (string, error)
func (*TestContainerOrchestrator) CreateFiles ¶
func (to *TestContainerOrchestrator) CreateFiles(ctx context.Context, options containers.CreateFilesOptions) error
func (*TestContainerOrchestrator) CreateNetwork ¶
func (to *TestContainerOrchestrator) CreateNetwork(ctx context.Context, options containers.CreateNetworkOptions) (string, error)
func (*TestContainerOrchestrator) CreateVolume ¶
func (to *TestContainerOrchestrator) CreateVolume(ctx context.Context, options containers.CreateVolumeOptions) error
func (*TestContainerOrchestrator) DefaultNetworkName ¶
func (to *TestContainerOrchestrator) DefaultNetworkName() string
func (*TestContainerOrchestrator) DisconnectNetwork ¶
func (to *TestContainerOrchestrator) DisconnectNetwork(ctx context.Context, options containers.DisconnectNetworkOptions) error
func (*TestContainerOrchestrator) EnsureBackgroundStatusUpdates ¶
func (to *TestContainerOrchestrator) EnsureBackgroundStatusUpdates(ctx context.Context)
func (*TestContainerOrchestrator) ExecContainer ¶
func (to *TestContainerOrchestrator) ExecContainer(ctx context.Context, options containers.ExecContainerOptions) (<-chan int32, error)
func (*TestContainerOrchestrator) FailMatchingContainers ¶
func (*TestContainerOrchestrator) GetCreatedFiles ¶
func (to *TestContainerOrchestrator) GetCreatedFiles(name string) ([]*containerCreateFile, error)
func (*TestContainerOrchestrator) GetDiagnostics ¶
func (to *TestContainerOrchestrator) GetDiagnostics(ctx context.Context) (containers.ContainerDiagnostics, error)
GetDiagnostics returns an empty diagnostics object, as the test container orchestrator does not support diagnostics.
func (*TestContainerOrchestrator) GetSocketFilePath ¶
func (to *TestContainerOrchestrator) GetSocketFilePath() string
func (*TestContainerOrchestrator) HasImage ¶
func (to *TestContainerOrchestrator) HasImage(id string) bool
func (*TestContainerOrchestrator) ImageCount ¶
func (to *TestContainerOrchestrator) ImageCount() int
func (*TestContainerOrchestrator) InspectContainers ¶
func (to *TestContainerOrchestrator) InspectContainers(ctx context.Context, options containers.InspectContainersOptions) ([]containers.InspectedContainer, error)
func (*TestContainerOrchestrator) InspectImages ¶
func (to *TestContainerOrchestrator) InspectImages(ctx context.Context, options containers.InspectImagesOptions) ([]containers.InspectedImage, error)
func (*TestContainerOrchestrator) InspectNetworks ¶
func (to *TestContainerOrchestrator) InspectNetworks(ctx context.Context, options containers.InspectNetworksOptions) ([]containers.InspectedNetwork, error)
func (*TestContainerOrchestrator) InspectVolumes ¶
func (to *TestContainerOrchestrator) InspectVolumes(ctx context.Context, options containers.InspectVolumesOptions) ([]containers.InspectedVolume, error)
func (*TestContainerOrchestrator) IsDefault ¶
func (*TestContainerOrchestrator) IsDefault() bool
func (*TestContainerOrchestrator) ListContainers ¶
func (to *TestContainerOrchestrator) ListContainers(ctx context.Context, options containers.ListContainersOptions) ([]containers.ListedContainer, error)
func (*TestContainerOrchestrator) ListNetworks ¶
func (to *TestContainerOrchestrator) ListNetworks(ctx context.Context, options containers.ListNetworksOptions) ([]containers.ListedNetwork, error)
func (*TestContainerOrchestrator) Name ¶
func (*TestContainerOrchestrator) Name() string
func (*TestContainerOrchestrator) PullImage ¶
func (to *TestContainerOrchestrator) PullImage(ctx context.Context, options containers.PullImageOptions) (string, error)
func (*TestContainerOrchestrator) RemoveContainers ¶
func (to *TestContainerOrchestrator) RemoveContainers(ctx context.Context, options containers.RemoveContainersOptions) ([]string, error)
func (*TestContainerOrchestrator) RemoveNetworks ¶
func (to *TestContainerOrchestrator) RemoveNetworks(ctx context.Context, options containers.RemoveNetworksOptions) ([]string, error)
func (*TestContainerOrchestrator) RemoveVolumes ¶
func (to *TestContainerOrchestrator) RemoveVolumes(ctx context.Context, options containers.RemoveVolumesOptions) ([]string, error)
func (*TestContainerOrchestrator) RunContainer ¶
func (to *TestContainerOrchestrator) RunContainer(ctx context.Context, options containers.RunContainerOptions) (string, error)
func (*TestContainerOrchestrator) SetHealthcheckMatchingContainers ¶
func (to *TestContainerOrchestrator) SetHealthcheckMatchingContainers(ctx context.Context, name string, healthcheck containers.ContainerHealthcheck)
func (*TestContainerOrchestrator) SetRuntimeHealth ¶
func (to *TestContainerOrchestrator) SetRuntimeHealth(healthy bool)
func (*TestContainerOrchestrator) SimulateContainerExecCommandLogging ¶
func (to *TestContainerOrchestrator) SimulateContainerExecCommandLogging(container string, command string, target apiv1.LogStreamSource, content []byte) error
func (*TestContainerOrchestrator) SimulateContainerExecExit ¶
func (*TestContainerOrchestrator) SimulateContainerExit ¶
func (*TestContainerOrchestrator) SimulateContainerLogging ¶
func (to *TestContainerOrchestrator) SimulateContainerLogging(containerName string, target apiv1.LogStreamSource, content []byte) error
func (*TestContainerOrchestrator) SimulateContainerRestart ¶
func (to *TestContainerOrchestrator) SimulateContainerRestart(ctx context.Context, name string) error
func (*TestContainerOrchestrator) SimulateContainerStartupLogs ¶
func (to *TestContainerOrchestrator) SimulateContainerStartupLogs(name string, stdout, stderr []byte)
func (*TestContainerOrchestrator) SimulateHealthcheck ¶
func (to *TestContainerOrchestrator) SimulateHealthcheck(ctx context.Context, name string, health *containers.InspectedContainerHealth) error
func (*TestContainerOrchestrator) StartContainers ¶
func (to *TestContainerOrchestrator) StartContainers(ctx context.Context, options containers.StartContainersOptions) ([]string, error)
func (*TestContainerOrchestrator) StopContainers ¶
func (to *TestContainerOrchestrator) StopContainers(ctx context.Context, options containers.StopContainersOptions) ([]string, error)
func (*TestContainerOrchestrator) WatchContainers ¶
func (to *TestContainerOrchestrator) WatchContainers(sink chan<- containers.EventMessage) (*pubsub.Subscription[containers.EventMessage], error)
func (*TestContainerOrchestrator) WatchNetworks ¶
func (to *TestContainerOrchestrator) WatchNetworks(sink chan<- containers.EventMessage) (*pubsub.Subscription[containers.EventMessage], error)
type TestContainerOrchestratorOption ¶
type TestContainerOrchestratorOption uint32
const ( TcoOptionNone TestContainerOrchestratorOption = 0 // Enables communication with the test container orchestrator via a Unix domain socket. // Used for tests that involve calls to API server to fetch container logs (the API server is a different process // from the the one that runs the container controller and the test container orchestrator). TcoOptionEnableSocketListener = 0x01 )
type TestContainerPortConfig ¶
type TestContainerPortConfig struct {
containers.InspectedContainerHostPortConfig
UseRandomHostPort bool
}
type TestIdeRun ¶
type TestIdeRun struct {
ID controllers.RunID
Exe *apiv1.Executable
FinishTimestamp metav1.MicroTime
ExitCode *int32
StartWaitingCalled bool
ChangeHandler controllers.RunChangeHandler
StartWaitingCallback func()
// contains filtered or unexported fields
}
func (*TestIdeRun) Finished ¶
func (r *TestIdeRun) Finished() bool
func (*TestIdeRun) Running ¶
func (r *TestIdeRun) Running() bool
type TestIdeRunner ¶
type TestIdeRunner struct {
Runs *syncmap.Map[types.NamespacedName, *TestIdeRun]
// contains filtered or unexported fields
}
func NewTestIdeRunner ¶
func NewTestIdeRunner(lifetimeCtx context.Context) *TestIdeRunner
func (*TestIdeRunner) FindAll ¶
func (r *TestIdeRunner) FindAll(exePath string, cond func(run TestIdeRun) bool) []TestIdeRun
func (*TestIdeRunner) SimulateFailedRunStart ¶
func (r *TestIdeRunner) SimulateFailedRunStart(exeName types.NamespacedName, startupError error) error
func (*TestIdeRunner) SimulateRunEnd ¶
func (r *TestIdeRunner) SimulateRunEnd(runID controllers.RunID, exitCode int32) error
func (*TestIdeRunner) SimulateRunStart ¶
func (r *TestIdeRunner) SimulateRunStart( isDesiredRun func(types.NamespacedName, *TestIdeRun) bool, changeToStarted func(*TestIdeRun, *controllers.ExecutableStartResult), ) error
func (*TestIdeRunner) SimulateSuccessfulRunStart ¶
func (r *TestIdeRunner) SimulateSuccessfulRunStart(runID controllers.RunID, pid process.Pid_t) error
func (*TestIdeRunner) StartRun ¶
func (r *TestIdeRunner) StartRun( _ context.Context, exe *apiv1.Executable, runChangeHandler controllers.RunChangeHandler, log logr.Logger, ) *controllers.ExecutableStartResult
func (*TestIdeRunner) StopRun ¶
func (r *TestIdeRunner) StopRun(_ context.Context, runID controllers.RunID, _ logr.Logger) error
type TestProcessExecutableRunner ¶ added in v0.22.2
type TestProcessExecutableRunner struct {
// contains filtered or unexported fields
}
TestProcessExecutableRunner wraps an ExecutableRunner and allows tests to simulate asynchronous executable startup by delaying the call to the underlying runner.
func NewTestProcessExecutableRunner ¶ added in v0.22.2
func NewTestProcessExecutableRunner(pe process.Executor) *TestProcessExecutableRunner
func (*TestProcessExecutableRunner) InstallAutoExecution ¶ added in v0.22.2
func (r *TestProcessExecutableRunner) InstallAutoExecution(ae testutil.AutoExecution)
InstallAsyncStartConfig adds an async start configuration. If a configuration with the same condition already exists, it will be replaced.
func (*TestProcessExecutableRunner) RemoveAutoExecution ¶ added in v0.22.2
func (e *TestProcessExecutableRunner) RemoveAutoExecution(sc testutil.ProcessSearchCriteria)
func (*TestProcessExecutableRunner) StartRun ¶ added in v0.22.2
func (r *TestProcessExecutableRunner) StartRun( ctx context.Context, exe *apiv1.Executable, runChangeHandler controllers.RunChangeHandler, log logr.Logger, ) *controllers.ExecutableStartResult
func (*TestProcessExecutableRunner) StopRun ¶ added in v0.22.2
func (r *TestProcessExecutableRunner) StopRun(ctx context.Context, runID controllers.RunID, log logr.Logger) error
StopRun implements ExecutableRunner by delegating to the underlying runner.
type TestProxy ¶
type TestProxy struct {
// contains filtered or unexported fields
}
func (*TestProxy) EffectiveAddress ¶
func (*TestProxy) EffectivePort ¶
func (*TestProxy) ListenAddress ¶
func (*TestProxy) ListenPort ¶
func (*TestProxy) State ¶
func (tp *TestProxy) State() proxy.ProxyState
type TestTunnelControlClient ¶
type TestTunnelControlClient struct {
// contains filtered or unexported fields
}
func NewTestTunnelControlClient ¶
func NewTestTunnelControlClient() *TestTunnelControlClient
func (*TestTunnelControlClient) DeleteTunnel ¶
func (t *TestTunnelControlClient) DeleteTunnel(ctx context.Context, tr *dcptunproto.TunnelRef, opts ...grpc.CallOption) (*emptypb.Empty, error)
func (*TestTunnelControlClient) DisableTunnel ¶
func (t *TestTunnelControlClient) DisableTunnel(rf dcptunproto.TunnelRequestFingerprint) bool
Disables a tunnel, making the subsequent PrepareTunnel calls for the tunnel's fingerprint fail. Returns true if the tunnel was found and disabled, false otherwise (i.e. it was not previously enabled, or known).
func (*TestTunnelControlClient) EnableTunnel ¶
func (t *TestTunnelControlClient) EnableTunnel(tunnelSpec *dcptunproto.TunnelSpec)
Enables a tunnel, making the subsequent PrepareTunnel calls return the provided tunnel spec.
func (*TestTunnelControlClient) GetTunnelSpec ¶
func (t *TestTunnelControlClient) GetTunnelSpec(rf dcptunproto.TunnelRequestFingerprint) *dcptunproto.TunnelSpec
Gets the tunnel spec for the specified fingerprint. Can be used to verify that a tunnel has been prepared by the ContainerNetworkTunnelProxy controller (by checking if the tunnel ID has been assigned to the tunnel spec).
func (*TestTunnelControlClient) NewStreamsConnection ¶
func (t *TestTunnelControlClient) NewStreamsConnection(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[dcptunproto.NewStreamResult, dcptunproto.StreamRef], error)
func (*TestTunnelControlClient) PrepareTunnel ¶
func (t *TestTunnelControlClient) PrepareTunnel(ctx context.Context, req *dcptunproto.TunnelReq, _ ...grpc.CallOption) (*dcptunproto.TunnelSpec, error)