snapstatetest

package
v0.0.0-...-20647f5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: GPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallEssentialSnaps

func InstallEssentialSnaps(c *check.C, st *state.State, base string, gadgetFiles [][]string, bloader bootloader.Bootloader)

func InstallSnap

func InstallSnap(c *check.C, st *state.State, yaml string, files [][]string, si *snap.SideInfo, opts InstallSnapOptions) *snap.Info

func MockDeviceContext

func MockDeviceContext(deviceCtx snapstate.DeviceContext) (restore func())

func MockDeviceModel

func MockDeviceModel(model *asserts.Model) (restore func())

func MockDeviceModelAndMode

func MockDeviceModelAndMode(model *asserts.Model, systemMode string) (restore func())

func NewSequenceFromRevisionSideInfos

func NewSequenceFromRevisionSideInfos(revsSideInfo []*sequence.RevisionSideState) sequence.SnapSequence

func NewSequenceFromSnapSideInfos

func NewSequenceFromSnapSideInfos(snapSideInfo []*snap.SideInfo) sequence.SnapSequence

func ReplaceDeviceCtxHook

func ReplaceDeviceCtxHook(deviceCtxHook func(st *state.State, task *state.Task, providedDeviceCtx snapstate.DeviceContext) (snapstate.DeviceContext, error)) (restore func())

func ReplaceRemodelingHook

func ReplaceRemodelingHook(remodelingHook func(st *state.State) *state.Change) (restore func())

func UseFallbackDeviceModel

func UseFallbackDeviceModel() (restore func())

Types

type InstallSnapOptions

type InstallSnapOptions struct {
	Required         bool
	PreserveSequence bool
}

type MockRestartHandler

type MockRestartHandler func(restart.RestartType)

MockRestartHandler mocks a restart.Handler based on a function to witness the restart requests.

func (MockRestartHandler) HandleRestart

func (h MockRestartHandler) HandleRestart(t restart.RestartType, rebootInfo *boot.RebootInfo)

func (MockRestartHandler) RebootAsExpected

func (h MockRestartHandler) RebootAsExpected(*state.State) error

func (MockRestartHandler) RebootDidNotHappen

func (h MockRestartHandler) RebootDidNotHappen(*state.State) error

type TrivialDeviceContext

type TrivialDeviceContext struct {
	DeviceModel    *asserts.Model
	OldDeviceModel *asserts.Model
	Remodeling     bool
	CtxStore       snapstate.StoreService
	SysMode        string
	Ground         bool
}

func (*TrivialDeviceContext) Base

func (dc *TrivialDeviceContext) Base() string

func (*TrivialDeviceContext) Classic

func (dc *TrivialDeviceContext) Classic() bool

func (*TrivialDeviceContext) ForRemodeling

func (dc *TrivialDeviceContext) ForRemodeling() bool

func (*TrivialDeviceContext) Gadget

func (dc *TrivialDeviceContext) Gadget() string

func (*TrivialDeviceContext) GroundContext

func (dc *TrivialDeviceContext) GroundContext() snapstate.DeviceContext

func (*TrivialDeviceContext) HasModeenv

func (dc *TrivialDeviceContext) HasModeenv() bool

func (*TrivialDeviceContext) IsClassicBoot

func (d *TrivialDeviceContext) IsClassicBoot() bool

func (*TrivialDeviceContext) IsCoreBoot

func (d *TrivialDeviceContext) IsCoreBoot() bool

func (*TrivialDeviceContext) Kernel

func (dc *TrivialDeviceContext) Kernel() string

func (*TrivialDeviceContext) Model

func (dc *TrivialDeviceContext) Model() *asserts.Model

func (*TrivialDeviceContext) RunMode

func (dc *TrivialDeviceContext) RunMode() bool

func (*TrivialDeviceContext) Store

func (*TrivialDeviceContext) SystemMode

func (dc *TrivialDeviceContext) SystemMode() string

Jump to

Keyboard shortcuts

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