seedtest

package
Version: v0.0.0-...-5b0139b Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SampleSnapYaml = map[string]string{
	"core": `name: core
type: os
version: 1.0
`,
	"pc-kernel": `name: pc-kernel
type: kernel
version: 1.0
`,
	"pc": `name: pc
type: gadget
version: 1.0
`,
	"classic-gadget": `name: classic-gadget
version: 1.0
type: gadget
`,
	"required": `name: required
type: app
version: 1.0
`,
	"classic-snap": `name: classic-snap
type: app
confinement: classic
version: 1.0
`,
	"snapd": `name: snapd
type: snapd
version: 1.0
`,
	"core18": `name: core18
type: base
version: 1.0
`,
	"pc-kernel=18": `name: pc-kernel
type: kernel
version: 1.0
`,
	"pc=18": `name: pc
type: gadget
base: core18
version: 1.0
`,
	"classic-gadget18": `name: classic-gadget18
version: 1.0
base: core18
type: gadget
`,
	"required18": `name: required18
type: app
base: core18
version: 1.0
`,
	"core20": `name: core20
type: base
version: 1.0
`,
	"pc-kernel=20": `name: pc-kernel
type: kernel
version: 1.0
`,
	"pc=20": `name: pc
type: gadget
base: core20
version: 1.0
`,
	"required20": `name: required20
type: app
base: core20
version: 1.0
`,
	"optional20-a": `name: optional20-a
type: app
base: core20
version: 1.0
`,
	"optional20-b": `name: optional20-b
type: app
base: core20
version: 1.0`,
	"uboot-gadget=20": `name: uboot-gadget
type: gadget
base: core20
version: 1.0
`,
	"arm-kernel=20": `name: arm-kernel
type: kernel
version: 1.0
`,
	"test-devmode=20": `name: test-devmode
type: app
base: core20
version: 1.0
confinement: devmode
`,
}

Functions

func MergeSampleSnapYaml

func MergeSampleSnapYaml(snapYaml ...map[string]string) map[string]string

func ReadAssertions

func ReadAssertions(c *C, fn string) []asserts.Assertion

func ValidateSeed

func ValidateSeed(c *C, root, label string, usesSnapd bool, trusted []asserts.Assertion) seed.Seed

func WriteAssertions

func WriteAssertions(fn string, assertions ...asserts.Assertion)

Types

type SeedSnaps

type SeedSnaps struct {
	StoreSigning *assertstest.StoreStack
	Brands       *assertstest.SigningAccounts
	// contains filtered or unexported fields
}

SeedSnaps helps creating snaps for a seed.

func (*SeedSnaps) AssertedSnap

func (ss *SeedSnaps) AssertedSnap(snapName string) (snapFile string)

func (*SeedSnaps) AssertedSnapID

func (ss *SeedSnaps) AssertedSnapID(snapName string) string

func (*SeedSnaps) AssertedSnapInfo

func (ss *SeedSnaps) AssertedSnapInfo(snapName string) *snap.Info

func (*SeedSnaps) AssertedSnapRevision

func (ss *SeedSnaps) AssertedSnapRevision(snapName string) *asserts.SnapRevision

func (*SeedSnaps) MakeAssertedSnap

func (ss *SeedSnaps) MakeAssertedSnap(c *C, snapYaml string, files [][]string, revision snap.Revision, developerID string, dbs ...*asserts.Database) (*asserts.SnapDeclaration, *asserts.SnapRevision)

func (*SeedSnaps) SetSnapAssertionNow

func (ss *SeedSnaps) SetSnapAssertionNow(t time.Time)

func (*SeedSnaps) SetupAssertSigning

func (ss *SeedSnaps) SetupAssertSigning(storeBrandID string)

SetupAssertSigning initializes StoreSigning for storeBrandID and Brands.

type TestingSeed16

type TestingSeed16 struct {
	SeedSnaps

	SeedDir string
}

TestingSeed16 helps setting up a populated Core 16/18 testing seed.

func (*TestingSeed16) AssertsDir

func (s *TestingSeed16) AssertsDir() string

func (*TestingSeed16) MakeAssertedSnap

func (s *TestingSeed16) MakeAssertedSnap(c *C, snapYaml string, files [][]string, revision snap.Revision, developerID string) (snapFname string, snapDecl *asserts.SnapDeclaration, snapRev *asserts.SnapRevision)

func (*TestingSeed16) MakeModelAssertionChain

func (s *TestingSeed16) MakeModelAssertionChain(brandID, model string, extras ...map[string]interface{}) []asserts.Assertion

func (*TestingSeed16) SnapsDir

func (s *TestingSeed16) SnapsDir() string

func (*TestingSeed16) WriteAssertions

func (s *TestingSeed16) WriteAssertions(fn string, assertions ...asserts.Assertion)

type TestingSeed20

type TestingSeed20 struct {
	SeedSnaps

	SeedDir string
}

TestingSeed20 helps setting up a populated Core 20 testing seed directory.

func (*TestingSeed20) MakeSeed

func (s *TestingSeed20) MakeSeed(c *C, label, brandID, modelID string, modelHeaders map[string]interface{}, optSnaps []*seedwriter.OptionsSnap) *asserts.Model

MakeSeed creates the seed with given label and generates model assertions

func (*TestingSeed20) MakeSeedWithModel

func (s *TestingSeed20) MakeSeedWithModel(c *C, label string, model *asserts.Model, optSnaps []*seedwriter.OptionsSnap)

MakeSeedWithModel creates the seed with given label for a given model

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL