testing

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestServerConfig

func TestServerConfig(t *testing.T) *config.CLI

Types

type Device

type Device struct {
	Path       string
	BusID      string
	BusNum     uint32
	DeviceNum  uint32
	Speed      uint32
	IDVendor   uint16
	IDProduct  uint16
	BcdDevice  uint16
	Class      uint8
	SubClass   uint8
	Protocol   uint8
	ConfigVal  uint8
	NumConfigs uint8
	NumIfaces  uint8
	Interfaces []usbip.InterfaceDesc
}

type ImportResult

type ImportResult struct {
	Conn          net.Conn
	Exported      Device
	RawDescriptor []byte
}

type MockServer

type MockServer struct {
	ApiServer *api.Server
	UsbServer *usb.Server
}

func NewTestServer

func NewTestServer(t *testing.T) *MockServer

type TestUsbIpClient

type TestUsbIpClient struct {
	// contains filtered or unexported fields
}

func NewUsbIpClient

func NewUsbIpClient(t *testing.T, addr string) *TestUsbIpClient

func (*TestUsbIpClient) AttachDevice

func (c *TestUsbIpClient) AttachDevice(busID string) (*ImportResult, error)

func (*TestUsbIpClient) ListDevices

func (c *TestUsbIpClient) ListDevices() ([]Device, error)

func (*TestUsbIpClient) PollInputReport

func (c *TestUsbIpClient) PollInputReport(conn net.Conn, want []byte, timeout time.Duration) ([]byte, error)

func (*TestUsbIpClient) ReadInputReport

func (c *TestUsbIpClient) ReadInputReport(conn net.Conn) ([]byte, error)

func (*TestUsbIpClient) ReadInputReportWithTimeout

func (c *TestUsbIpClient) ReadInputReportWithTimeout(conn net.Conn, timeout time.Duration) ([]byte, error)

func (*TestUsbIpClient) Submit

func (c *TestUsbIpClient) Submit(conn net.Conn, dir uint32, ep uint32, outPayload []byte, setup *[8]byte) error

func (*TestUsbIpClient) SubmitWithTimeout

func (c *TestUsbIpClient) SubmitWithTimeout(conn net.Conn, dir uint32, ep uint32, outPayload []byte, setup *[8]byte, timeout time.Duration) error

Directories

Path Synopsis
e2e
scripts command

Jump to

Keyboard shortcuts

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