types

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IgnitionAlignment = 2048 // 1MB in sectors
	DefaultAlignment  = 4096 // 2MB in sectors
)

Variables

This section is empty.

Functions

func Align

func Align(count int, alignment int) int

Align returns count aligned to the next multiple of alignment, or count itself if it is already aligned.

Types

type Directory

type Directory struct {
	Node
	Mode int
}

type Disk

type Disk struct {
	ImageFile    string
	Device       string
	Alignment    int
	Partitions   Partitions
	CorruptTable bool // set to true to corrupt the partition table
}

func GetBaseDisk

func GetBaseDisk() []Disk

func (Disk) CalculateImageSize

func (d Disk) CalculateImageSize() int64

CalculateImageSize determines the size of the disk, assuming the partitions are all aligned and completely fill the disk.

func (Disk) SetOffsets

func (d Disk) SetOffsets()

SetOffsets sets the starting offsets for all of the partitions on the disk, according to its alignment.

type File

type File struct {
	Node
	Contents string
	Mode     int
}
type Link struct {
	Node
	Target string
	Hard   bool
}

type MntDevice

type MntDevice struct {
	Label        string
	Substitution string
}

type Node

type Node struct {
	Name      string
	Directory string
	User      int
	Group     int
}

type Partition

type Partition struct {
	Number          int
	Label           string
	TypeCode        string
	TypeGUID        string
	GUID            string
	Device          string
	Offset          int
	Length          int
	FilesystemType  string
	FilesystemLabel string
	FilesystemUUID  string
	FilesystemImage string // base64-encoded bzip2
	MountPath       string
	Hybrid          bool
	Ambivalent      bool // allow multiple FS types on validation
	Files           []File
	Directories     []Directory
	Links           []Link
	RemovedNodes    []Node
}

type Partitions

type Partitions []*Partition

func (Partitions) AddDirectories

func (ps Partitions) AddDirectories(label string, ds []Directory)

func (Partitions) AddFiles

func (ps Partitions) AddFiles(label string, fs []File)
func (ps Partitions) AddLinks(label string, ls []Link)

func (Partitions) AddRemovedNodes

func (ps Partitions) AddRemovedNodes(label string, ns []Node)

func (Partitions) GetPartition

func (ps Partitions) GetPartition(label string) *Partition

type Test

type Test struct {
	Name              string
	In                []Disk // Disk state before running Ignition
	Out               []Disk // Expected disk state after running Ignition
	MntDevices        []MntDevice
	SystemDirFiles    []File
	Env               []string // Environment variables for Ignition
	Config            string
	ConfigMinVersion  string
	ConfigVersion     string
	ConfigShouldBeBad bool // Set to true to skip config validation step
	SkipCriticalCheck bool // Set to true to skip critical logging check
}

func DeepCopy

func DeepCopy(t Test) Test

Deep copy Test struct fields In, Out, MntDevices, SystemDirFiles so each BB test with identical Test structs have their own independent Test copies

func (*Test) ReplaceAllUUIDVars

func (test *Test) ReplaceAllUUIDVars() error

ReplaceAllUUIDVars replaces all UUID variables (format $uuid<num>) in configs and partitions with an UUID

func (*Test) ReplaceAllVersionVars

func (t *Test) ReplaceAllVersionVars(version string)

ReplaceAllVersionVars replaces Version variable (format $version) in configs with ConfigMinVersion Updates the old config version (oldVersion) with a new one (newVersion)

Jump to

Keyboard shortcuts

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