package test

import "gvisor.dev/gvisor/pkg/sentry/seccheck/sinks/remote/test"

Package test provides functionality used to test the remote sink.

Index

Types

type Message

type Message struct {
	// MsgType indicates what is the type of Msg.
	MsgType pb.MessageType
	// Msg is the payload to the message that can be decoded using MsgType.
	Msg []byte
}

Message corresponds to a single message sent from sinks.Remote.

type Server

type Server struct {
	server.CommonServer
	// contains filtered or unexported fields
}

Server is the counterpart to the sinks.Remote. It receives connections remote sink and stores all points that it receives.

func NewServer

func NewServer() (*Server, error)

NewServer creates a new server that listens to a UDS that it creates under os.TempDir.

func (*Server) Count

func (s *Server) Count() int

Count return the number of points it has received.

func (*Server) GetPoints

func (s *Server) GetPoints() []Message

GetPoints returns all points that it has received.

func (*Server) NewClient

func (s *Server) NewClient() (server.MessageHandler, error)

NewClient returns a new MessageHandler to process messages.

func (*Server) Reset

func (s *Server) Reset() int

Reset throws away all points received so far and returns the number of points discarded.

func (*Server) SetVersion

func (s *Server) SetVersion(newVersion uint32)

SetVersion sets the version to be used in handshake.

func (*Server) WaitForCount

func (s *Server) WaitForCount(count int)

WaitForCount waits for the number of points to reach the desired number.

Source Files

server.go

Version
v0.0.0-20250605235530-a6711d1e1dc6 (latest)
Published
Jun 5, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
4 hours ago

Tools for package owners.