snapstatetest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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 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