Documentation
¶
Index ¶
- func CaptureOutput(fn func()) string
- func WaitForCondition(t testing.TB, timeout time.Duration, cond func() bool, description string)
- func WaitForEvent(t testing.TB, ch <-chan *clientpb.Event, description string) *clientpb.Event
- type ClientHarness
- type ControlPlaneHarness
- func (h *ControlPlaneHarness) Connect(ctx context.Context) (*grpc.ClientConn, error)
- func (h *ControlPlaneHarness) ConnectWithConfig(ctx context.Context, config *mtls.ClientConfig) (*grpc.ClientConn, error)
- func (h *ControlPlaneHarness) ControlHistory() []*clientpb.JobCtrl
- func (h *ControlPlaneHarness) FailNextCtrl(ctrl, name string, err error)
- func (h *ControlPlaneHarness) GetContext(id string) (*clientpb.Context, error)
- func (h *ControlPlaneHarness) GetPipeline(name, listenerID string) (*clientpb.Pipeline, error)
- func (h *ControlPlaneHarness) GetRuntimeSession(sessionID string) (*clientpb.Session, error)
- func (h *ControlPlaneHarness) GetRuntimeTask(sessionID string, taskID uint32) (*clientpb.Task, error)
- func (h *ControlPlaneHarness) GetSession(sessionID string) (*clientpb.Session, error)
- func (h *ControlPlaneHarness) GetWebContent(id string) (*clientpb.WebContent, error)
- func (h *ControlPlaneHarness) GetWebContents(name string) ([]*clientpb.WebContent, error)
- func (h *ControlPlaneHarness) GetWebsite(name string) (*clientpb.Pipeline, error)
- func (h *ControlPlaneHarness) JobExists(name, listenerID string) bool
- func (h *ControlPlaneHarness) ListenerID() string
- func (h *ControlPlaneHarness) NewBindPipeline(t testing.TB, name string) *clientpb.Pipeline
- func (h *ControlPlaneHarness) NewHTTPPipeline(t testing.TB, name string) *clientpb.Pipeline
- func (h *ControlPlaneHarness) NewListenerClientConfig(t testing.TB, name string) *mtls.ClientConfig
- func (h *ControlPlaneHarness) NewREMPipeline(name, console string) *clientpb.Pipeline
- func (h *ControlPlaneHarness) NewTCPPipeline(t testing.TB, name string) *clientpb.Pipeline
- func (h *ControlPlaneHarness) NewWebsitePipeline(name string, port uint32, root string) *clientpb.Pipeline
- func (h *ControlPlaneHarness) ReadWebsiteContent(websiteName, contentID string) ([]byte, error)
- func (h *ControlPlaneHarness) RuntimeKeepaliveEnabled(sessionID string) (bool, error)
- func (h *ControlPlaneHarness) SeedCredentialContext(t testing.TB, task *core.Task, target string, params map[string]string) *clientpb.Context
- func (h *ControlPlaneHarness) SeedDownloadContext(t testing.TB, task *core.Task, fileName string, content []byte) *clientpb.Context
- func (h *ControlPlaneHarness) SeedPipeline(t testing.TB, pipeline *clientpb.Pipeline, started bool) *clientpb.Pipeline
- func (h *ControlPlaneHarness) SeedSession(t testing.TB, sessionID, pipelineName string, active bool) *core.Session
- func (h *ControlPlaneHarness) SeedTask(t testing.TB, sess *core.Session, typ string) *core.Task
- func (h *ControlPlaneHarness) SeedWebsite(t testing.TB, pipeline *clientpb.Pipeline, started bool) *clientpb.Pipeline
- func (h *ControlPlaneHarness) StartRealWebsite(t testing.TB, name string) string
- func (h *ControlPlaneHarness) WriteTempFile(name string, content []byte) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureOutput ¶
func CaptureOutput(fn func()) string
func WaitForCondition ¶
Types ¶
type ClientHarness ¶
type ClientHarness struct {
Server *clientcore.Server
Console *clientcore.Console
Conn io.Closer
}
func NewClientHarness ¶
func NewClientHarness(t testing.TB, h *ControlPlaneHarness) *ClientHarness
type ControlPlaneHarness ¶
type ControlPlaneHarness struct {
Address string
Admin *mtls.ClientConfig
Server *grpc.Server
Listener net.Listener
// contains filtered or unexported fields
}
func NewControlPlaneHarness ¶
func NewControlPlaneHarness(t testing.TB) *ControlPlaneHarness
func (*ControlPlaneHarness) Connect ¶
func (h *ControlPlaneHarness) Connect(ctx context.Context) (*grpc.ClientConn, error)
func (*ControlPlaneHarness) ConnectWithConfig ¶
func (h *ControlPlaneHarness) ConnectWithConfig(ctx context.Context, config *mtls.ClientConfig) (*grpc.ClientConn, error)
func (*ControlPlaneHarness) ControlHistory ¶
func (h *ControlPlaneHarness) ControlHistory() []*clientpb.JobCtrl
func (*ControlPlaneHarness) FailNextCtrl ¶
func (h *ControlPlaneHarness) FailNextCtrl(ctrl, name string, err error)
func (*ControlPlaneHarness) GetContext ¶
func (h *ControlPlaneHarness) GetContext(id string) (*clientpb.Context, error)
func (*ControlPlaneHarness) GetPipeline ¶
func (h *ControlPlaneHarness) GetPipeline(name, listenerID string) (*clientpb.Pipeline, error)
func (*ControlPlaneHarness) GetRuntimeSession ¶
func (h *ControlPlaneHarness) GetRuntimeSession(sessionID string) (*clientpb.Session, error)
func (*ControlPlaneHarness) GetRuntimeTask ¶
func (*ControlPlaneHarness) GetSession ¶
func (h *ControlPlaneHarness) GetSession(sessionID string) (*clientpb.Session, error)
func (*ControlPlaneHarness) GetWebContent ¶
func (h *ControlPlaneHarness) GetWebContent(id string) (*clientpb.WebContent, error)
func (*ControlPlaneHarness) GetWebContents ¶
func (h *ControlPlaneHarness) GetWebContents(name string) ([]*clientpb.WebContent, error)
func (*ControlPlaneHarness) GetWebsite ¶
func (h *ControlPlaneHarness) GetWebsite(name string) (*clientpb.Pipeline, error)
func (*ControlPlaneHarness) JobExists ¶
func (h *ControlPlaneHarness) JobExists(name, listenerID string) bool
func (*ControlPlaneHarness) ListenerID ¶
func (h *ControlPlaneHarness) ListenerID() string
func (*ControlPlaneHarness) NewBindPipeline ¶
func (*ControlPlaneHarness) NewHTTPPipeline ¶
func (*ControlPlaneHarness) NewListenerClientConfig ¶
func (h *ControlPlaneHarness) NewListenerClientConfig(t testing.TB, name string) *mtls.ClientConfig
func (*ControlPlaneHarness) NewREMPipeline ¶
func (h *ControlPlaneHarness) NewREMPipeline(name, console string) *clientpb.Pipeline
func (*ControlPlaneHarness) NewTCPPipeline ¶
func (*ControlPlaneHarness) NewWebsitePipeline ¶
func (*ControlPlaneHarness) ReadWebsiteContent ¶
func (h *ControlPlaneHarness) ReadWebsiteContent(websiteName, contentID string) ([]byte, error)
func (*ControlPlaneHarness) RuntimeKeepaliveEnabled ¶
func (h *ControlPlaneHarness) RuntimeKeepaliveEnabled(sessionID string) (bool, error)
func (*ControlPlaneHarness) SeedCredentialContext ¶
func (*ControlPlaneHarness) SeedDownloadContext ¶
func (*ControlPlaneHarness) SeedPipeline ¶
func (*ControlPlaneHarness) SeedSession ¶
func (*ControlPlaneHarness) SeedWebsite ¶
func (*ControlPlaneHarness) StartRealWebsite ¶
func (h *ControlPlaneHarness) StartRealWebsite(t testing.TB, name string) string
StartRealWebsite reads a website's pipeline and content from DB, starts a real HTTP server on a random port, and returns the base URL. The server is stopped on test cleanup. This bridges the gap between the mock control plane and actual HTTP serving for full E2E verification.
func (*ControlPlaneHarness) WriteTempFile ¶
func (h *ControlPlaneHarness) WriteTempFile(name string, content []byte) (string, error)
Click to show internal directories.
Click to hide internal directories.