Documentation
¶
Overview ¶
Package testutil provides helpers for starting the kcd daemon in tests.
Package testutil provides a mock KDE Connect peer for integration tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartTestDaemon ¶
StartTestDaemon starts a kcd daemon in a goroutine with a cancellable context and waits up to 3 seconds for its IPC socket to be ready. It returns a cancel function (to stop the daemon) and a pre-connected client.
Types ¶
type MockPeer ¶
type MockPeer struct {
// contains filtered or unexported fields
}
MockPeer simulates a remote KDE Connect device.
func NewMockPeer ¶
NewMockPeer creates a new MockPeer.
func (*MockPeer) Dial ¶
Dial connects to the given TCP address, completes the plaintext identity exchange, then upgrades to TLS as the TLS server (KDE Connect rule: the TCP initiator acts as TLS server).
func (*MockPeer) DialPipe ¶
DialPipe creates an in-process net.Pipe pair, performs the identity exchange on the given server-side connection (serverConn), and returns the peer-side conn ready for SendPacket/ReadPacket. The caller is responsible for handling serverConn in a goroutine.
func (*MockPeer) ReadPacket ¶
ReadPacket reads one newline-delimited JSON packet from conn.