logindtest

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package logindtest is a fake systemd-logind on a private bus, seen from a caller outside any login session: a shell the systemd user manager started.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logind

type Logind struct {
	// Bus is the private bus logind owns its name on.
	Bus *dbustest.Bus
	// Terminated lists the session paths Terminate was called on.
	Terminated dbustest.Var[[]dbus.ObjectPath]
	// Locked lists the session paths Lock was called on, aliases
	// resolved.
	Locked dbustest.Var[[]dbus.ObjectPath]
	// LockedHint is what the sessions report for LockedHint.
	LockedHint dbustest.Var[bool]
	// Asked counts the GetSession calls, so a test can tell nobody came.
	Asked dbustest.Var[int]
	// contains filtered or unexported fields
}

Logind is the fake. Its manager resolves "auto" to the user's display session, and "self" to nothing, since the caller is in no session. Likewise the /session/auto object alias is the display session, and /session/self does not exist.

func Start

func Start(t *testing.T, display dbus.ObjectPath) *Logind

Start runs the fake on a private bus. display is the user's display session; "" is a user without one.

func StartUnit

func StartUnit(t *testing.T, display dbus.ObjectPath) *Logind

StartUnit runs the fake as the system bus of a process the systemd user manager started: XDG_SESSION_ID unset for the test, and every D-Bus client the test runs dialling the fake for the system bus.

Jump to

Keyboard shortcuts

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