common

package module
v0.0.0-...-fc172d5 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const DefaultFioSizeMb = 250
View Source
const DefaultIOTimeout = 60
View Source
const DefaultVolumeSizeMb = 312
View Source
const FioBlockFilename = "/dev/sdm"
View Source
const FioFsBlocksLessBy = "availblockslessby"
View Source
const FioFsBlocksPercent = "availblockspercent"
View Source
const FioFsFile = "fiotestfile"
View Source
const FioFsFilename = FioFsMountPoint + "/" + FioFsFile
View Source
const FioFsMountPoint = "/volume"
View Source
const FsxBlockFileName = "/dev/sdm"
View Source
const LargeClaimSizeMb = 1024
View Source
const MsvStatusStateOnline = "Online"
View Source
const NSDefault = "default"
View Source
const NSE2EAgent = "e2e-agent"
View Source
const NSE2EPrefix = "e2e-maya"
View Source
const ScCloneFsIdAsVolumeId = "cloneFsIdAsVolumeId"
View Source
const ScFsType = "fsType"
View Source
const ScIOTimeout = "ioTimeout"
View Source
const ScLvmShared = "shared"

LVM

View Source
const ScLvmStorage = "storage"
View Source
const ScLvmThinProvision = "thinProvision"
View Source
const ScLvmVgPattern = "vgpattern"
View Source
const ScLvmVgVolGroup = "volgroup"
View Source
const ScMaxSnapshots = "maxSnapshots"
View Source
const ScNodeAffinityTopologyLabel = "nodeAffinityTopologyLabel"
View Source
const ScNodeHasTopologyKey = "nodeHasTopologyKey"
View Source
const ScNodeSpreadTopologyKey = "nodeSpreadTopologyKey"
View Source
const ScNvmeCtrlLossTmo = "nvmeCtrlLossTmo"
View Source
const ScPoolAffinityTopologyLabel = "poolAffinityTopologyLabel"
View Source
const ScPoolHasTopologyKey = "poolHasTopologyKey"
View Source
const ScProtocol = "protocol"

Storageclass parameter keys

View Source
const ScReplicas = "repl"
View Source
const ScStsAffinityGroup = "stsAffinityGroup"
View Source
const ScThinProvisioning = "thin"
View Source
const ScZfsCompression = "compression"
View Source
const ScZfsDeDup = "dedup"
View Source
const ScZfsPoolName = "poolname"
View Source
const ScZfsRecordSize = "recordsize"
View Source
const ScZfsShared = "shared"

ZFS

View Source
const ScZfsThinProvision = "thinProvision"
View Source
const ScZfsVolBlockSize = "volblocksize"
View Source
const SmallClaimSizeMb = 312
View Source
const StrFioCriticalFailure = "fio Critical Failure"

Variables

View Source
var XFSTestsBlockFilenames = []string{"/dev/test", "/dev/scratch"}

Functions

func DefaultReplicaCount

func DefaultReplicaCount() int

func GetDefaultFioArguments

func GetDefaultFioArguments() []string

GetDefaultFioArguments return the default settings (arguments) for fio - for use with Mayastor

func GetFioArgs

func GetFioArgs() []string

GetFioArgs return the default command line for fio - for use with Mayastor, for single volume

func GetFioImage

func GetFioImage() string

func GetTestCaseLogsPath

func GetTestCaseLogsPath() (string, error)

GetTestCaseLogsPath get the path to the logs directory for the current test case instance

func NSMayastor

func NSMayastor() string

NSMayastor return the name of the namespace in which Mayastor is installed

func NSOpenEBS

func NSOpenEBS() string

NSMayastor return the name of the namespace in which Mayastor is installed

func ResetTestCaseLogsPath

func ResetTestCaseLogsPath()

ResetTestCaseLogsPath call when the test case has completed to clear state

func SanitizePathname

func SanitizePathname(r rune) rune

SanitizePathname map helper function for runes used to create directories only allow A-Z, a-z, 0-9 and replace ' ' with '_'

func SetTestCaseLogsPath

func SetTestCaseLogsPath(testcase string)

SetTestCaseLogsPath call at the start of test case

Types

type AllowVolumeExpansion

type AllowVolumeExpansion int
const (
	AllowVolumeExpansionNone    AllowVolumeExpansion = iota
	AllowVolumeExpansionEnable  AllowVolumeExpansion = iota
	AllowVolumeExpansionDisable AllowVolumeExpansion = iota
)

func (AllowVolumeExpansion) String

func (CloneFsId AllowVolumeExpansion) String() string

type CloneFsIdAsVolumeIdType

type CloneFsIdAsVolumeIdType int
const (
	CloneFsIdAsVolumeIdNone    CloneFsIdAsVolumeIdType = iota
	CloneFsIdAsVolumeIdEnable  CloneFsIdAsVolumeIdType = iota
	CloneFsIdAsVolumeIdDisable CloneFsIdAsVolumeIdType = iota
)

func (CloneFsIdAsVolumeIdType) String

func (CloneFsId CloneFsIdAsVolumeIdType) String() string

type CmpReplicas

type CmpReplicas int
const (
	CmpReplicasMatch    CmpReplicas = iota
	CmpReplicasMismatch CmpReplicas = iota
	CmpReplicasFailed   CmpReplicas = iota
)

type ContentSource

type ContentSource struct {
	Snapshot Snapshot `json:"snapshot"`
}

type E2eFioArgsBuilder

type E2eFioArgsBuilder struct {
	// contains filtered or unexported fields
}

func NewE2eFioArgsBuilder

func NewE2eFioArgsBuilder() *E2eFioArgsBuilder

NewE2eFioArgsBuilder returns an instance of e2e fio args builder

func (*E2eFioArgsBuilder) Build

func (e *E2eFioArgsBuilder) Build() ([]string, error)

func (*E2eFioArgsBuilder) GetTargets

func (e *E2eFioArgsBuilder) GetTargets() []string

func (*E2eFioArgsBuilder) WithAdditionalArg

func (e *E2eFioArgsBuilder) WithAdditionalArg(arg string) *E2eFioArgsBuilder

WithAdditionalArg use an additional fio arguments

func (*E2eFioArgsBuilder) WithAdditionalArgs

func (e *E2eFioArgsBuilder) WithAdditionalArgs(args []string) *E2eFioArgsBuilder

WithAdditionalArgs use additional fio arguments

func (*E2eFioArgsBuilder) WithArgumentSet

func (e *E2eFioArgsBuilder) WithArgumentSet(set FioAppArgsSet) *E2eFioArgsBuilder

func (*E2eFioArgsBuilder) WithBlockSize

func (e *E2eFioArgsBuilder) WithBlockSize(val uint) *E2eFioArgsBuilder

WithBlockSize set fio block size

func (*E2eFioArgsBuilder) WithCustomArgs

func (e *E2eFioArgsBuilder) WithCustomArgs(customArgs []string) *E2eFioArgsBuilder

WithCustomArgs use custom fio arguments

func (*E2eFioArgsBuilder) WithDefaultArgs

func (e *E2eFioArgsBuilder) WithDefaultArgs() *E2eFioArgsBuilder

WithDefaultArgs use "standard" fio arguments

func (*E2eFioArgsBuilder) WithDefaultFile

func (e *E2eFioArgsBuilder) WithDefaultFile() *E2eFioArgsBuilder

WithDefaultFile add the "standard" fio target on a filesystem the target file is created explicitly by e2e-fio before fio is launched

func (*E2eFioArgsBuilder) WithDefaultFileExt

func (e *E2eFioArgsBuilder) WithDefaultFileExt(fsAllocStrategy FioFsAllocation, units uint) *E2eFioArgsBuilder

WithDefaultFileExt add the "standard" fio target on a filesystem the target file is created explicitly by e2e-fio before fio is launched

func (*E2eFioArgsBuilder) WithDefaultRawBlock

func (e *E2eFioArgsBuilder) WithDefaultRawBlock() *E2eFioArgsBuilder

WithDefaultRawBlock add the "standard" fio target device

func (*E2eFioArgsBuilder) WithDirectIO

func (e *E2eFioArgsBuilder) WithDirectIO(direct bool)

WithDirectIO set args for direct IO

func (*E2eFioArgsBuilder) WithExitValue

func (e *E2eFioArgsBuilder) WithExitValue(exitValue int) *E2eFioArgsBuilder

WithExitValue add exit value override

func (*E2eFioArgsBuilder) WithFsFile

func (e *E2eFioArgsBuilder) WithFsFile(fsMount string, fileRelPath string) *E2eFioArgsBuilder

WithFsFile add a fio target on a filesystem the target file is created explicitly by e2e-fio before fio is launched

func (*E2eFioArgsBuilder) WithFsFileExt

func (e *E2eFioArgsBuilder) WithFsFileExt(fsMount string, fileRelPath string, fsAllocStrategy FioFsAllocation, units uint) *E2eFioArgsBuilder

WithFsFileExt add a fio target on a filesystem the target file is created explicitly by e2e-fio before fio is launched

func (*E2eFioArgsBuilder) WithLiveness

func (e *E2eFioArgsBuilder) WithLiveness() *E2eFioArgsBuilder

WithLiveness add liveness checks for fio targets

func (*E2eFioArgsBuilder) WithLivenessParameters

func (e *E2eFioArgsBuilder) WithLivenessParameters(readInterval uint, timeout uint) *E2eFioArgsBuilder

WithLivenessParameters add liveness checks for fio targets

func (*E2eFioArgsBuilder) WithLoops

func (e *E2eFioArgsBuilder) WithLoops(val uint) *E2eFioArgsBuilder

WithLoops number of fio iterations over disk

func (*E2eFioArgsBuilder) WithRandRead

func (e *E2eFioArgsBuilder) WithRandRead() *E2eFioArgsBuilder

WithRandRead verifies data written with previous RandWrite

func (*E2eFioArgsBuilder) WithRandReadWrite

func (e *E2eFioArgsBuilder) WithRandReadWrite() *E2eFioArgsBuilder

WithRandReadWrite random reads and writes of target volume

func (*E2eFioArgsBuilder) WithRandWrite

func (e *E2eFioArgsBuilder) WithRandWrite() *E2eFioArgsBuilder

WithRandWrite only writes to all blocks of target volume

func (*E2eFioArgsBuilder) WithRawBlock

func (e *E2eFioArgsBuilder) WithRawBlock(devicePath string) *E2eFioArgsBuilder

WithRawBlock add a fio target device

func (*E2eFioArgsBuilder) WithRuntime

func (e *E2eFioArgsBuilder) WithRuntime(duration int) *E2eFioArgsBuilder

WithRuntime set duration for time based run duration of 0 => no runtime limit

func (*E2eFioArgsBuilder) WithTargets

func (e *E2eFioArgsBuilder) WithTargets(targets []string) *E2eFioArgsBuilder

WithTargets add an existing file as fio target used when a fio instance is launched to verify writes of a previous fio instance

func (*E2eFioArgsBuilder) WithZeroFill

func (e *E2eFioArgsBuilder) WithZeroFill(val bool) *E2eFioArgsBuilder

WithZeroFill add commands to zerofill the targets

type E2eFioPodLogSynopsis

type E2eFioPodLogSynopsis struct {
	Err             error
	CriticalFailure bool
	Text            []string
	JsonRecords     FioJsonRecords
}

func (*E2eFioPodLogSynopsis) String

func (s *E2eFioPodLogSynopsis) String() string

type E2eFioPodOutputMonitor

type E2eFioPodOutputMonitor struct {
	Completed bool
	Synopsis  E2eFioPodLogSynopsis
	PodName   string
}

type ErrorAccumulator

type ErrorAccumulator struct {
	// contains filtered or unexported fields
}

func (*ErrorAccumulator) Accumulate

func (acc *ErrorAccumulator) Accumulate(err error)

func (*ErrorAccumulator) GetError

func (acc *ErrorAccumulator) GetError() error

type Explicit

type Explicit struct {
	AllowedNodes   []string `json:"allowed_nodes"`
	PreferredNodes []string `json:"preferred_nodes"`
}

type FileSystemType

type FileSystemType string
const (
	NoneFsType  FileSystemType = ""
	Ext4FsType  FileSystemType = "ext4"
	XfsFsType   FileSystemType = "xfs"
	BtrfsFsType FileSystemType = "btrfs"
	ZfsFsType   FileSystemType = "zfs"
)

type FioAppArgsSet

type FioAppArgsSet int
const (
	DefaultFioArgs FioAppArgsSet = iota
	RandWriteFioArgs
	RandReadFioArgs
	CustomFioArgs
	NoFioArgs
	PerfSeqReadFioArgs
	PerfSeqWriteFioArgs
	PerfSeqMixedFioArgs
	PerfRandReadFioArgs
	PerfRandWriteFioArgs
	PerfRandMixedFioArgs
	RandReadWriteFioArgs
)

func (FioAppArgsSet) String

func (f FioAppArgsSet) String() string

type FioExitRecord

type FioExitRecord struct {
	ExitValue   *int    `json:"exit_value"`
	ElapsedSecs *uint64 `json:"elapsed_seconds"`
}

type FioFsAllocation

type FioFsAllocation int
const (
	FioFsAllocDefault      FioFsAllocation = iota
	FioFsAllocLessByBlocks FioFsAllocation = iota
	FioFsAllocPercentage   FioFsAllocation = iota
)

type FioJsonRecords

type FioJsonRecords struct {
	ExitValues  []FioExitRecord
	TargetSizes []FioTargetSizeRecord
}

type FioTargetSizeRecord

type FioTargetSizeRecord struct {
	Path *string `json:"path"`
	Size *uint64 `json:"fio_target_size"`
}

type Labelled

type Labelled struct {
	Inclusion map[string]interface{} `json:"inclusion"`
	Exclusion map[string]interface{} `json:"exclusion"`
}

type MayastorNode

type MayastorNode struct {
	Name  string            `json:"name"`
	Spec  MayastorNodeSpec  `json:"spec"`
	State MayastorNodeState `json:"state"`
}

type MayastorNodeInterface

type MayastorNodeInterface interface {
	GetMSN(node string) (*MayastorNode, error)
	ListMsns() ([]MayastorNode, error)
}

type MayastorNodeSpec

type MayastorNodeSpec struct {
	GrpcEndpoint string `json:"grpcEndpoint"`
	ID           string `json:"id"`
	Node_nqn     string `json:"node_nqn"`
}

type MayastorNodeState

type MayastorNodeState struct {
	GrpcEndpoint string `json:"grpcEndpoint"`
	ID           string `json:"id"`
	Status       string `json:"status"`
	Node_nqn     string `json:"node_nqn"`
}

type MayastorPool

type MayastorPool struct {
	Name   string             `json:"name"`
	Spec   MayastorPoolSpec   `json:"spec"`
	Status MayastorPoolStatus `json:"status"`
}

type MayastorPoolInterface

type MayastorPoolInterface interface {
	GetMsPool(poolName string) (*MayastorPool, error)
	ListMsPools() ([]MayastorPool, error)
}

type MayastorPoolSpec

type MayastorPoolSpec struct {
	Disks []string `json:"disks"`
	Node  string   `json:"node"`
}

type MayastorPoolStatus

type MayastorPoolStatus struct {
	Avail     uint64           `json:"avail"`
	Capacity  uint64           `json:"capacity"`
	Disks     []string         `json:"disks"`
	Reason    string           `json:"reason"`
	Spec      MayastorPoolSpec `json:"spec"`
	State     string           `json:"state"`
	Used      uint64           `json:"used"`
	Committed uint64           `json:"committed"`
}

type MayastorVolume

type MayastorVolume struct {
	Spec  MsvSpec  `json:"spec"`
	State MsvState `json:"state"`
}

type MayastorVolumeInterface

type MayastorVolumeInterface interface {
	GetMSV(uuid string) (*MayastorVolume, error)
	GetMsvNodes(uuid string) (string, []string)
	DeleteMsv(volName string) error
	ListMsvs() ([]MayastorVolume, error)
	SetMsvReplicaCount(uuid string, replicaCount int) error
	GetMsvState(uuid string) (string, error)
	GetMsvReplicas(volName string) ([]Replica, error)
	GetMsvReplicaTopology(volUuid, replicaUuid string) (Replica, error)
	GetMsvReplicaTopologies(volUuid string) (ReplicaTopology, error)
	GetMsvNexusChildren(volName string) ([]TargetChild, error)
	GetMsvNexusState(uuid string) (string, error)
	IsMsvPublished(uuid string) bool
	IsMsvDeleted(uuid string) bool
	CheckForMsvs() (bool, error)
	CheckAllMsvsAreHealthy() error
}

type MsvReplica

type MsvReplica struct {
	Uuid    string
	Uri     string
	Replica Replica
}

MsvReplica contains replica Uri along with uuid and replica details. In older mayastor volume schema, replica Uri was present which is not the case in current version

type MsvSpec

type MsvSpec struct {
	Num_replicas  int           `json:"num_replicas"`
	Size          int64         `json:"size"`
	Status        string        `json:"status"`
	Target        SpecTarget    `json:"target"`
	Uuid          string        `json:"uuid"`
	Topology      Topology      `json:"topology"`
	Policy        Policy        `json:"policy"`
	Thin          bool          `json:"thin"`
	AsThin        bool          `json:"as_thin"`
	NumSnapshots  int32         `json:"num_snapshots"`
	ContentSource ContentSource `json:"content_source"`
	MaxSnapshots  int32         `json:"max_snapshots"`
}

type MsvState

type MsvState struct {
	Target          StateTarget     `json:"target"`
	Size            int64           `json:"size"`
	Status          string          `json:"status"`
	Uuid            string          `json:"uuid"`
	ReplicaTopology ReplicaTopology `json:"replica_topology"`
	Usage           Usage           `json:"usage"`
}

type Node_topology

type Node_topology struct {
	Explicit Explicit `json:"explicit"`
}

type OfflineSnapshot

type OfflineSnapshot struct {
	UUID     string `json:"uuid"`
	SourceID string `json:"source_id"`
	PoolID   string `json:"pool_id"`
	PoolUUID string `json:"pool_uuid"`
}

type OnOffVal

type OnOffVal int
const (
	On  OnOffVal = iota
	Off OnOffVal = iota
)

func (OnOffVal) String

func (val OnOffVal) String() string

type OnlineSnapshot

type OnlineSnapshot struct {
	UUID                 string `json:"uuid"`
	SourceID             string `json:"source_id"`
	PoolID               string `json:"pool_id"`
	PoolUUID             string `json:"pool_uuid"`
	Timestamp            string `json:"timestamp"`
	Size                 int64  `json:"size"`
	AllocatedSize        int64  `json:"allocated_size"`
	PredecessorAllocSize int64  `json:"predecessor_alloc_size"`
}

type OpenEbsEngine

type OpenEbsEngine int
const (
	Lvm      OpenEbsEngine = iota
	Hostpath OpenEbsEngine = iota
	Zfs      OpenEbsEngine = iota
	Mayastor OpenEbsEngine = iota
)

func (OpenEbsEngine) String

func (Engine OpenEbsEngine) String() string

type Policy

type Policy struct {
	Self_heal bool `json:"self_heal"`
}

type Pool_topology

type Pool_topology struct {
	Labelled Labelled `json:"labelled"`
}

type ProvisioningType

type ProvisioningType int
const (
	ThinProvisioning  ProvisioningType = iota
	ThickProvisioning ProvisioningType = iota
)

func (ProvisioningType) String

func (provisioningType ProvisioningType) String() string

type Replica

type Replica struct {
	Node        string       `json:"node"`
	Pool        string       `json:"pool"`
	State       string       `json:"state"`
	ChildStatus string       `json:"child-status"`
	Usage       ReplicaUsage `json:"usage"`
}

type ReplicaSnapshot

type ReplicaSnapshot struct {
	Online  OnlineSnapshot  `json:"online"`
	Offline OfflineSnapshot `json:"offline"`
}

type ReplicaTopology

type ReplicaTopology map[string]Replica

type ReplicaTopologyChildState

type ReplicaTopologyChildState int
const (
	ChildStateOnline   ReplicaTopologyChildState = iota
	ChildStateUnknown  ReplicaTopologyChildState = iota
	ChildStateDegraded ReplicaTopologyChildState = iota
	ChildStateFaulted  ReplicaTopologyChildState = iota
)

func (ReplicaTopologyChildState) String

func (replicaTopologyChildState ReplicaTopologyChildState) String() string

type ReplicaUsage

type ReplicaUsage struct {
	Capacity              int64 `json:"capacity"`
	Allocated             int64 `json:"allocated"`
	AllocatedSnapshots    int64 `json:"allocated_snapshots"`
	AllocatedAllSnapshots int64 `json:"allocated_all_snapshots"`
}

type ReplicasComparison

type ReplicasComparison struct {
	Result      CmpReplicas
	Description string
	Err         error
}

type ShareProto

type ShareProto string
const (
	ShareProtoNvmf  ShareProto = "nvmf"
	ShareProtoIscsi ShareProto = "iscsi"
)

type Snapshot

type Snapshot struct {
	Snapshot string `json:"snapshot"`
	Volume   string `json:"volume"`
}

type SnapshotDefinition

type SnapshotDefinition struct {
	Metadata SnapshotMetadata `json:"metadata"`
	Spec     SnapshotSpec     `json:"spec"`
}

type SnapshotMetadata

type SnapshotMetadata struct {
	Status              string                           `json:"status"`
	Timestamp           string                           `json:"timestamp"`
	TxnID               string                           `json:"txn_id"`
	Transactions        map[string][]SnapshotTransaction `json:"transactions"`
	NumSnapshotReplicas int                              `json:"num_snapshot_replicas"`
	NumRestores         int                              `json:"num_restores"`
}

type SnapshotSchema

type SnapshotSchema struct {
	Definition SnapshotDefinition `json:"definition"`
	State      SnapshotState      `json:"state"`
}

type SnapshotSpec

type SnapshotSpec struct {
	UUID         string `json:"uuid"`
	SourceVolume string `json:"source_volume"`
}

type SnapshotState

type SnapshotState struct {
	UUID             string            `json:"uuid"`
	AllocatedSize    int64             `json:"allocated_size"`
	SourceVolume     string            `json:"source_volume"`
	Timestamp        string            `json:"timestamp"`
	ReadyAsSource    bool              `json:"ready_as_source"`
	ReplicaSnapshots []ReplicaSnapshot `json:"replica_snapshots"`
}

type SnapshotTransaction

type SnapshotTransaction struct {
	UUID     string `json:"uuid"`
	SourceID string `json:"source_id"`
	Status   string `json:"status"`
}

type SpecTarget

type SpecTarget struct {
	Protocol string `json:"protocol"`
	Node     string `json:"node"`
}

type StateTarget

type StateTarget struct {
	Children  []TargetChild `json:"children"`
	DeviceUri string        `json:"deviceUri"`
	Node      string        `json:"node"`
	Rebuilds  int32         `json:"rebuilds"`
	Protocol  string        `json:"protocol"`
	Size      int64         `json:"size"`
	State     string        `json:"state"`
	Uuid      string        `json:"uuid"`
}

type StsAffinityGroup

type StsAffinityGroup string
const (
	StsAffinityGroupDisable StsAffinityGroup = "false"
	StsAffinityGroupEnable  StsAffinityGroup = "true"
)

type TargetChild

type TargetChild struct {
	State           string `json:"state"`
	Uri             string `json:"uri"`
	RebuildProgress *int32 `json:"rebuildProgress"`
}

type Topology

type Topology struct {
	NodeTopology Node_topology `json:"node_topology"`
	PoolTopology Pool_topology `json:"pool_topology"`
}

type Usage

type Usage struct {
	Capacity                int64 `json:"capacity"`
	Allocated               int64 `json:"allocated"`
	AllocatedReplica        int64 `json:"allocated_replica"`
	AllocatedSnapshots      int64 `json:"allocated_snapshots"`
	AllocatedAllSnapshots   int64 `json:"allocated_all_snapshots"`
	TotalAllocated          int64 `json:"total_allocated"`
	TotalAllocatedReplicas  int64 `json:"total_allocated_replicas"`
	TotalAllocatedSnapshots int64 `json:"total_allocated_snapshots"`
}

type VolumeType

type VolumeType int
const (
	VolFileSystem VolumeType = iota
	VolRawBlock   VolumeType = iota
	VolTypeNone   VolumeType = iota
)

func (VolumeType) String

func (volType VolumeType) String() string

type YesNoVal

type YesNoVal int
const (
	Yes YesNoVal = iota
	No  YesNoVal = iota
)

func (YesNoVal) String

func (Val YesNoVal) String() string

Jump to

Keyboard shortcuts

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