Documentation
¶
Index ¶
- Constants
- Variables
- func StartShim(config ShimMockConfig) error
- type CCProxyMock
- func (proxy *CCProxyMock) GetLastStdinStream() []byte
- func (proxy *CCProxyMock) GetProxyToken() string
- func (proxy *CCProxyMock) SendExitNotification(payload []byte)
- func (proxy *CCProxyMock) SendStderrStream(payload []byte)
- func (proxy *CCProxyMock) SendStdoutStream(payload []byte)
- func (proxy *CCProxyMock) Start()
- func (proxy *CCProxyMock) Stop()
- type ConnectShim
- type FrameKey
- type ProxyGRPCMock
- type ProxyMock
- type ProxyUnixMock
- type ShimMockConfig
- type ShimSignal
Constants ¶
const ShimStderrOutput = "Some output on stderr"
ShimStderrOutput is the expected output sent by the mock shim on stderr.
const ShimStdoutOutput = "Some output on stdout"
ShimStdoutOutput is the expected output sent by the mock shim on stdout.
Variables ¶
var DefaultMockCCShimBinPath string
DefaultMockCCShimBinPath is populated at link time.
var DefaultMockHookBinPath string
DefaultMockHookBinPath is populated at link time.
var DefaultMockKataShimBinPath string
DefaultMockKataShimBinPath is populated at link time.
Functions ¶
func StartShim ¶
func StartShim(config ShimMockConfig) error
StartShim is a common routine for starting a shim mock.
Types ¶
type CCProxyMock ¶
type CCProxyMock struct {
sync.Mutex
ShimConnected chan bool
Signal chan ShimSignal
ShimDisconnected chan bool
StdinReceived chan bool
// contains filtered or unexported fields
}
CCProxyMock is an object mocking clearcontainers Proxy
func NewCCProxyMock ¶
func NewCCProxyMock(t *testing.T, path string) *CCProxyMock
NewCCProxyMock creates a hyperstart instance
func (*CCProxyMock) GetLastStdinStream ¶
func (proxy *CCProxyMock) GetLastStdinStream() []byte
GetLastStdinStream returns the last received stdin stream
func (*CCProxyMock) GetProxyToken ¶
func (proxy *CCProxyMock) GetProxyToken() string
GetProxyToken returns the token that mock proxy uses to verify its client connection
func (*CCProxyMock) SendExitNotification ¶
func (proxy *CCProxyMock) SendExitNotification(payload []byte)
SendExitNotification sends an Exit Notification Frame to connected client
func (*CCProxyMock) SendStderrStream ¶
func (proxy *CCProxyMock) SendStderrStream(payload []byte)
SendStderrStream sends a Stderr Stream Frame to connected client
func (*CCProxyMock) SendStdoutStream ¶
func (proxy *CCProxyMock) SendStdoutStream(payload []byte)
SendStdoutStream sends a Stdout Stream Frame to connected client
func (*CCProxyMock) Start ¶
func (proxy *CCProxyMock) Start()
Start invokes mock proxy instance to start listening.
func (*CCProxyMock) Stop ¶
func (proxy *CCProxyMock) Stop()
Stop causes mock proxy instance to stop listening, close connection to client and close all channels
type ConnectShim ¶
type ConnectShim struct {
Token string `json:"token"`
}
ConnectShim payload defined here, as it has not been defined in proxy api package yet
type FrameKey ¶
type FrameKey struct {
// contains filtered or unexported fields
}
FrameKey is a struct composed of the the frame type and opcode, used as a key for retrieving the handler for handling the frame.
type ProxyGRPCMock ¶
type ProxyGRPCMock struct {
// GRPCImplementer is the structure implementing
// the GRPC interface we want the proxy to serve.
GRPCImplementer interface{}
// GRPCRegister is the registration routine for
// the GRPC service.
GRPCRegister func(s *grpc.Server, srv interface{})
// contains filtered or unexported fields
}
ProxyGRPCMock is the gRPC proxy mock
func (*ProxyGRPCMock) Start ¶
func (p *ProxyGRPCMock) Start(URL string) error
Start starts the gRPC proxy mock
type ProxyMock ¶
ProxyMock is the proxy mock interface. It allows for implementing different kind of containers proxies front end.
type ProxyUnixMock ¶
type ProxyUnixMock struct {
ClientHandler func(c net.Conn)
// contains filtered or unexported fields
}
ProxyUnixMock is the UNIX proxy mock
func (*ProxyUnixMock) Start ¶
func (p *ProxyUnixMock) Start(URL string) error
Start starts the UNIX proxy mock
type ShimMockConfig ¶
type ShimMockConfig struct {
Name string
URLParamName string
ContainerParamName string
TokenParamName string
}
ShimMockConfig is the configuration structure for all virtcontainers shim mock implementations.
type ShimSignal ¶
type ShimSignal struct {
Signal int `json:"signalNumber"`
Row int `json:"rows,omitempty"`
Column int `json:"columns,omitempty"`
}
ShimSignal is the struct used to represent the signal received from the shim