Skip to content

Commit

Permalink
chore: e2e_config: rationalisations and fixes
Browse files Browse the repository at this point in the history
- remove unused configuration items
- remove caching of configuration values this breaks
  recording of configuration used for testing.

Signed-off-by: Blaise Dias <[email protected]>
  • Loading branch information
blaisedias committed Oct 29, 2024
1 parent d44d33f commit 3953853
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 262 deletions.
247 changes: 2 additions & 245 deletions common/e2e_config/e2e_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,239 +232,6 @@ type E2EConfig struct {
IOEngineNvmeTimeout int `yaml:"ioEngineNvmeTimeout" env-default:"0"`

// Individual Test parameters
PVCStress struct {
Replicas int `yaml:"replicas" env-default:"2"`
CdCycles int `yaml:"cdCycles" env-default:"100"`
CrudCycles int `yaml:"crudCycles" env-default:"10"`
} `yaml:"pvcStress"`
IOSoakTest struct {
Replicas int `yaml:"replicas" env-default:"2"`
Duration string `yaml:"duration" env-default:"60m"`
// Number of volumes for each mayastor instance
// volumes for disruptor pods are allocated from within this "pool"
LoadFactor int `yaml:"loadFactor" env-default:"10"`
Protocols []string `yaml:"protocols" env-default:"nvmf"`
// FioStartDelay units are seconds
FioStartDelay int `yaml:"fioStartDelay" env-default:"90"`
ReadyTimeout string `yaml:"readyTimeout" env-default:"600s"`
Disrupt struct {
// Number of disruptor pods.
PodCount int `yaml:"podCount" env-default:"3"`
// FaultAfter units are seconds
FaultAfter int `yaml:"faultAfter" env-default:"51"`
ReadyTimeout string `yaml:"readyTimeout" env-default:"180s"`
} `yaml:"disrupt"`
FioDutyCycles []struct {
// ThinkTime units are microseconds
ThinkTime int `yaml:"thinkTime"`
ThinkTimeBlocks int `yaml:"thinkTimeBlocks"`
} `yaml:"fioDutyCycles"`
} `yaml:"ioSoakTest"`
CSI struct {
Replicas int `yaml:"replicas" env-default:"2"`
SmallClaimSize string `yaml:"smallClaimSize" env-default:"312Mi"`
LargeClaimSize string `yaml:"largeClaimSize" env-default:"1Gi"`
} `yaml:"csi"`
Uninstall struct {
Cleanup int `yaml:"cleanup" env:"e2e_uninstall_cleanup" env-default:"1"`
} `yaml:"uninstall"`
BasicVolumeIO struct {
// FioTimeout is in seconds
FioLoopTimeout int `yaml:"fioLoopTimeout" env-default:"100"`
// VolSizeMb Units are MiB
VolSizeMb int `yaml:"volSizeMb" env-default:"1350"`
} `yaml:"basicVolumeIO"`
CISmokeTest struct {
// FioTimeout is in seconds
FioTimeout int `yaml:"fioTimeout" env-default:"300"`
// FsVolSizeMb Units are MiB
FsVolSizeMb int `yaml:"fsVolSizeMb" env-default:"1350"`
// Replicas to use
ReplicaCount int `yaml:"replicas" env-default:"2"`
// VolSizeMb Units are MiB
VolSizeMb int `yaml:"volSizeMb" env-default:"1500"`
} `yaml:"ciSmokeTest"`
MultipleVolumesPodIO struct {
VolumeSizeMb int `yaml:"volumeSizeMb" env-default:"500"`
VolumeCount int `yaml:"volumeCount" env-default:"6"`
MultipleReplicaCount int `yaml:"replicas" env-default:"2"`
FioLoops int `yaml:"fioLoops" env-default:"0"`
Timeout string `yaml:"timeout" env-default:"1800s"`
} `yaml:"multiVolumesPodIO"`
MsPodDisruption struct {
VolMb int `yaml:"volMb" env-default:"1000"`
RemoveThinkTime int `yaml:"removeThinkTime" env-default:"10"`
RepairThinkTime int `yaml:"repairThinkTime" env-default:"30"`
ThinkTimeBlocks int `yaml:"thinkTimeBlocks" env-default:"10"`
UnscheduleDelay int `yaml:"unscheduleDelay" env-default:"10"`
RescheduleDelay int `yaml:"rescheduleDelay" env-default:"10"`
PodUnscheduleTimeoutSecs int `yaml:"podUnscheduleTimeoutSecs" env-default:"100"`
PodRescheduleTimeoutSecs int `yaml:"podRnscheduleTimeoutSecs" env-default:"180"`
PodRemovalTest int `yaml:"podRemovalTest" env-default:"0"`
DeviceRemovalTest int `yaml:"deviceRemovalTest" env-default:"1"`
} `yaml:"msPodDisruption"`
MaximumVolsIO struct {
// exception to 300Mb min size limit large numbers of volumes
// and ext4 filesystem
VolMb int `yaml:"volMb" env-default:"64"`
VolumeCountPerPod int `yaml:"volumeCountPerPod" env-default:"10"`
PodCount int `yaml:"podCount" env-default:"11"`
Duration string `yaml:"duration" env-default:"240s"`
Timeout string `yaml:"timeout" env-default:"900s"`
ThinkTime string `yaml:"thinkTime" env-default:"10ms"`
LoopCount uint `yaml:"loopCount" env-default:"7"`
} `yaml:"maximumVolsIO"`
ControlPlaneRescheduling struct {
// Count of mayastor volume
MayastorVolumeCount int `yaml:"mayastorVolumeCount" env-default:"3"`
} `yaml:"controlPlaneRescheduling"`
ExpandMspDisk struct {
// PartitionStartSize is the start size of partitioned disk
PartitionStartSize string `yaml:"partitionStartSize" env-default:"1GiB"`
// PartitionEndSize is the end size of partitioned disk
PartitionEndSize string `yaml:"partitionEndSize" env-default:"3GiB"`
// ResizePartitionDisk is the end size of partiioned disk to resize the disk
ResizePartitionDisk string `yaml:"resizePartitionDisk" env-default:"5GiB"`
// Duration is in seconds
Duration int `yaml:"duration" env-default:"60"`
// VolSizeMb Units are MiB
VolSizeMb int `yaml:"volSizeMb" env-default:"312"`
}
ValidateIntegrityTest struct {
Replicas int `yaml:"replicas" env-default:"3"`
FioTimeout int `yaml:"fioTimeout" env-default:"2000"`
VolMb int `yaml:"volMb" env-default:"500"`
} `yaml:"validateIntegrityTest"`
PvcReadWriteOnce struct {
// FioTimeout is in seconds
FioTimeout int `yaml:"fioTimeout" env-default:"120"`
} `yaml:"pvcReadWriteOnce"`
PvcDelete struct {
// VolSizeMb Units are MiB
VolSizeMb int `yaml:"volSizeMb" env-default:"1024"`
// FsVolSizeMb Units are MiB
FsVolSizeMb int `yaml:"fsVolSizeMb" env-default:"900"`
PodUnscheduleTimeoutSecs int `yaml:"podUnscheduleTimeoutSecs" env-default:"100"`
PodRescheduleTimeoutSecs int `yaml:"podRnscheduleTimeoutSecs" env-default:"180"`
} `yaml:"pvcDelete"`
PrimitiveMaxVolsInPool struct {
// exception to 300Mb min size limit large numbers of volumes
// and ext4 FS volumes filesystem
VolMb int `yaml:"volMb" env-default:"32"`
VolumeCountPerPool int `yaml:"volumeCountPerPool" env-default:"110"`
Replicas int `yaml:"replicas" env-default:"2"`
} `yaml:"primitiveMaxVolsInPool"`
PrimitiveMspState struct {
ReplicaSize int `yaml:"replicaSize" env-default:"1073741824"`
PoolDeleteTimeoutSecs string `yaml:"poolDeleteTimeoutSecs" env-default:"30s"`
PoolCreateTimeoutSecs string `yaml:"poolCreateTimeoutSecs" env-default:"20s"`
PoolUsageTimeoutSecs string `yaml:"poolUsageTimeoutSecs" env-default:"90s"`
PoolUsageSleepTimeSecs string `yaml:"poolUsageSleepTimeSecs" env-default:"2s"`
IterationCount int `yaml:"iterationCount" env-default:"100"`
} `yaml:"primitiveMspState"`
PrimitiveReplicas struct {
Iterations int `yaml:"iterations" env-default:"100"`
StartSizeMb int `yaml:"startSizeMb" env-default:"128"`
EndSizeMb int `yaml:"endSizeMb" env-default:"4096"`
SizeStepMb int `yaml:"sizeStepMb" env-default:"310"`
} `yaml:"primitiveReplicas"`
PrimitiveMspDelete struct {
ReplicaSize int `yaml:"replicaSize" env-default:"10000000"`
ReplicasTimeoutSecs string `yaml:"replicasTimeoutSecs" env-default:"30s"`
PoolUsageTimeoutSecs string `yaml:"poolUsageTimeoutSecs" env-default:"30s"`
PoolDeleteTimeoutSecs string `yaml:"poolDeleteTimeoutSecs" env-default:"40s"`
PoolCreateTimeoutSecs string `yaml:"poolCreateTimeoutSecs" env-default:"20s"`
MayastorRestartTimeout int `yaml:"mayastorRestartTimeout" env-default:"240"`
Iterations int `yaml:"iterations" env-default:"30"`
} `yaml:"primitiveMspDelete"`

PrimitiveMspStressTest struct {
PartitionSizeInGiB int `yaml:"partitionSizeInGiB" env-default:"1"`
PartitionCount int `yaml:"partitionCount" env-default:"5"`
Iterations int `yaml:"iterations" env-default:"10"`
} `yaml:"PrimitiveMspStressTest"`
ConcurrentPvcCreate struct {
Replicas int `yaml:"replicas" env-default:"1"`
// exception to 300Mb min size limit large numbers of volumes
// and raw block volumes filesystem
VolSize int `yaml:"volMb" env-default:"64"`
Iterations int `yaml:"iterations" env-default:"10"`
VolumeMultipler int `yaml:"volumeMultipler" env-default:"10"`
} `yaml:"concurrentPvcCreate"`
PrimitiveFaultInjection struct {
VolMb int `yaml:"volMb" env-default:"512"`
Replicas int `yaml:"replicas" env-default:"3"`
Duration string `yaml:"duration" env-default:"240s"`
Timeout string `yaml:"timeout" env-default:"420s"`
ThinkTime string `yaml:"thinkTime" env-default:"10ms"`
} `yaml:"primitiveFaultInjection"`
PrimitiveDataIntegrity struct {
VolMb int `yaml:"volMb" env-default:"1024"`
Timeout string `yaml:"timeout" env-default:"420s"`
} `yaml:"primitiveDataIntegrity"`
MsvRebuild struct {
Replicas int `yaml:"replicas" env-default:"1"`
UpdatedReplica int `yaml:"updatedreplica" env-default:"2"`
VolSize int `yaml:"volSize" env-default:"312"`
Timeout string `yaml:"timeout" env-default:"120s"`
PollPeriod string `yaml:"pollPeriod" env-default:"1s"`
DurationSecs int `yaml:"durationSecs" env-default:"180"`
SleepSecs int `yaml:"sleepSecs" env-default:"3"`
} `yaml:"msvRebuild"`
PrimitiveMsvFuzz struct {
VolMb int `yaml:"volMb" env-default:"312"`
VolumeCountPerPool int `yaml:"volumeCountPerPool" env-default:"2"`
Iterations int `yaml:"iterations" env-default:"2"`
Replicas int `yaml:"replicas" env-default:"1"`
InvalidReplicaCount int `yaml:"invalidReplicaCount" env-default:"-1"`
UnsupportedProtocol string `yaml:"unsupportedProtocol" env-default:"xyz"`
UnsupportedFsType string `yaml:"unsupportedFsType" env-default:"xyz"`
IncorrectScName string `yaml:"incorrectScName" env-default:"xyz"`
LargePvcSize int `yaml:"largePvcSize" env-default:"11000000000000"`
VolCount int `yaml:"volCount" env-default:"115"`
} `yaml:"primitiveMsvFuzz"`
FsxExt4Stress struct {
VolMb int `yaml:"volMb" env-default:"1024"`
Replicas int `yaml:"replicas" env-default:"3"`
FileSystemType string `yaml:"fileSystemType" env-default:"ext4"`
NumberOfOperation int `yaml:"numberOfOperation" env-default:"9977777"`
} `yaml:"fsxExt4Stress"`
PvcCreateDelete struct {
Replicas int `yaml:"replicas" env-default:"3"`
VolSize int `yaml:"volMb" env-default:"20"`
Iterations int `yaml:"iterations" env-default:"1"`
VolumeMultiplier int `yaml:"volumeMultiplier" env-default:"110"`
DelayTime int `yaml:"delayTime" env-default:"10"`
} `yaml:"pvcCreateDelete"`
ScIscsiValidation struct {
VolMb int `yaml:"volMb" env-default:"1024"`
Replicas int `yaml:"replicas" env-default:"1"`
UnsupportedProtocol string `yaml:"unsupportedProtocol" env-default:"iscsi"`
} `yaml:"scIscsiValidation"`
CommunicationDisruption struct {
SleepTimeInSec int `yaml:"sleepTimeInSec" env-default:"120"`
} `yaml:"communicationDisruption"`
XFSTests struct {
VolMb int `yaml:"volMb" env-default:"4608"`
Replicas int `yaml:"replicas" env-default:"3"`
FileSystemType string `yaml:"fileSystemType" env-default:"xfs"`
NumberOfOperation int `yaml:"numberOfOperation" env-default:"9977777"`
} `yaml:"xfsTests"`
CsiMetricsWriteData struct {
VolMb int `yaml:"volMb" env-default:"7168"`
FioSizeMb int `yaml:"fioSizeMb" env-default:"1024"`
} `yaml:"csiMetricsWriteData"`
DiskTestMaximumVolsIO struct {
VolMb int `yaml:"volMb" env-default:"312"`
VolumeCountPerPod int `yaml:"volumeCountPerPod" env-default:"1"`
PodCount int `yaml:"podCount" env-default:"110"`
Duration string `yaml:"duration" env-default:"240s"`
Timeout string `yaml:"timeout" env-default:"900s"`
} `yaml:"DiskTestMaximumVolsIO"`
Event struct {
PoolStateChangeEventEnabled int `yaml:"poolStateChangeEventEnabled" env-default:"0"`
VolStateChangeEventEnabled int `yaml:"volStateChangeEventEnabled" env-default:"0"`
} `yaml:"event"`
}

var once sync.Once
Expand Down Expand Up @@ -493,18 +260,6 @@ func GetConfig() E2EConfig {

// Initialise the configuration
_ = cleanenv.ReadEnv(&e2eConfig)
e2eConfig.IOSoakTest.FioDutyCycles = []struct {
ThinkTime int `yaml:"thinkTime"`
ThinkTimeBlocks int `yaml:"thinkTimeBlocks"`
}{
{500000, 1000},
{750000, 1000},
{1250000, 2000},
{1500000, 3000},
{1750000, 3000},
{2000000, 4000},
}

// We absorb the complexity of locating the configuration file here
// so that scripts invoking the tests can be simpler
// - if OS envvar e2e_config is defined
Expand Down Expand Up @@ -626,6 +381,8 @@ func GetConfig() E2EConfig {
_, _ = fmt.Fprintf(os.Stderr, "reports directory is %s\n", e2eConfig.ReportsDir)
}
saveConfig()
} else {
fmt.Fprintln(os.Stdout, "WARNING: not recording configuration in use!")
}
if e2eConfig.SessionDir == "" {
e2eConfig.SessionDir = "/tmp"
Expand Down
18 changes: 7 additions & 11 deletions common/k8stest/util_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,33 +744,29 @@ func XfsCheck(nodeName string, deployName string, containerName string) (string,
return output, nil
}

var (
EngineLabel = e2e_config.GetConfig().Product.EngineLabel
EngineLabelValue = e2e_config.GetConfig().Product.EngineLabelValue
IoEnginePodRegexp = fmt.Sprintf("^%s-.....$", e2e_config.GetConfig().Product.IOEnginePodName)
)

// Prevent mayastor pod from running on the given node.
// SuppressMayastorPodOnNode Prevent mayastor pod from running on the given node.
func SuppressMayastorPodOnNode(nodeName string, timeout int) error {
logf.Log.Info("suppressing mayastor pod", "node", nodeName)
err := UnlabelNode(nodeName, EngineLabel)
err := UnlabelNode(nodeName, e2e_config.GetConfig().Product.EngineLabel)
if err != nil {
return fmt.Errorf("failed to remove label %s from node %s, error: %v", EngineLabel, nodeName, err)
return fmt.Errorf("failed to remove label %s from node %s, error: %v", e2e_config.GetConfig().Product.EngineLabel, nodeName, err)
}
IoEnginePodRegexp := fmt.Sprintf("^%s-.....$", e2e_config.GetConfig().Product.IOEnginePodName)
err = WaitForPodNotRunningOnNode(IoEnginePodRegexp, common.NSMayastor(), nodeName, timeout)
return err
}

// Allow mayastor pod to run on the given node.
// UnsuppressMayastorPodOnNode Allow mayastor pod to run on the given node.
func UnsuppressMayastorPodOnNode(nodeName string, timeout int) error {
// add the mayastor label to the node
logf.Log.Info("restoring mayastor pod", "node", nodeName)
err := LabelNode(nodeName,
e2e_config.GetConfig().Product.EngineLabel,
e2e_config.GetConfig().Product.EngineLabelValue)
if err != nil {
return fmt.Errorf("failed to add label %s to node %s, error: %v", EngineLabel, nodeName, err)
return fmt.Errorf("failed to add label %s to node %s, error: %v", e2e_config.GetConfig().Product.EngineLabelValue, nodeName, err)
}
IoEnginePodRegexp := fmt.Sprintf("^%s-.....$", e2e_config.GetConfig().Product.IOEnginePodName)
err = WaitForPodRunningOnNode(IoEnginePodRegexp, common.NSMayastor(), nodeName, timeout)
return err
}
9 changes: 3 additions & 6 deletions common/k8stest/util_replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
)

// var productName = e2e_config.GetConfig().Product.ProductName
var nvmeControllerModel = e2e_config.GetConfig().Product.NvmeControllerModel

// use the e2e-agent running on each non-nexus node:
//
// for each non-nexus replica node
Expand Down Expand Up @@ -226,7 +223,7 @@ func getNvmeDevice(initiatorIP string, maxRetries int, targetNqn string) (bool,
devicePath = deviceData.DevicePath
// For mayastor the ModelNumber would be Mayastor NVMe controller
// check if the device listed is mayastor nvme controlled device
if deviceData.ModelNumber != nvmeControllerModel {
if deviceData.ModelNumber != e2e_config.GetConfig().Product.NvmeControllerModel {
continue
}
if len(devicePath) > 5 {
Expand Down Expand Up @@ -520,7 +517,7 @@ func FsFreezeReplica(nodeName string) (string, error) {
for _, deviceData := range list["Devices"] {
// For mayastor the ModelNumber would be Mayastor NVMe controller
// check if the device listed is mayastor nvme controlled device
if deviceData.ModelNumber != nvmeControllerModel {
if deviceData.ModelNumber != e2e_config.GetConfig().Product.NvmeControllerModel {
continue
}
nvmeDevice = deviceData.DevicePath
Expand Down Expand Up @@ -565,7 +562,7 @@ func FsUnfreezeReplica(nodeName string) (string, error) {
for _, deviceData := range list["Devices"] {
// For mayastor the ModelNumber would be Mayastor NVMe controller
// check if the device listed is mayastor nvme controlled device
if deviceData.ModelNumber != nvmeControllerModel {
if deviceData.ModelNumber != e2e_config.GetConfig().Product.NvmeControllerModel {
continue
}
nvmeDevice = deviceData.DevicePath
Expand Down

0 comments on commit 3953853

Please sign in to comment.