configparser

package
v0.0.0-...-7220889 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package configparser implements logic to handle SuiteScheduler configuration files.

Package configparser implements logic to handle SuiteScheduler configuration files.

Package configparser implements logic to handle SuiteScheduler configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToLabProto

func BytesToLabProto(configsBuffer []byte) (*suschpb.LabConfig, error)

BytesToLabProto takes a JSON formatted string and transforms it into an infrapb.LabConfig object.

func BytesToSchedulerProto

func BytesToSchedulerProto(configsBuffer []byte) (*suschpb.SchedulerCfg, error)

BytesToSchedulerProto takes a JSON formatted string and transforms it into an infrapb.SchedulerCfg object.

func GetMultiDutTargets

func GetMultiDutTargets(config *suschpb.SchedulerConfig, lab *LabConfigs) (map[string][]*MultiDutTargetOptions, error)

GetMultiDutTargets transforms the configs target specifications into a usable target pairing for image fetching and request building.

func IsFirmware

func IsFirmware(config *suschpb.SchedulerConfig) bool

IsFirmware returns if the given config is a firmware config.

func IsMultiDut

func IsMultiDut(config *suschpb.SchedulerConfig) bool

IsMultiDut returns if the given config is a multi-dut config.

func ValidateHoursAheadArgs

func ValidateHoursAheadArgs(startTime common.KronTime, hoursAhead int64) error

ValidateHoursAheadArgs will check that all of the arguments are within the specified bounds that can be worked with.

Types

type Board

type Board string

type BoardEntry

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

BoardEntry is a wrapper on the infrapb Board type.

func (*BoardEntry) GetBoard

func (b *BoardEntry) GetBoard() *suschpb.Board

func (*BoardEntry) GetName

func (b *BoardEntry) GetName() string

type BuildTarget

type BuildTarget string

BuildTarget is in the form board(-<variant>) with the variant being optional.

func GetBuildTargets

func GetBuildTargets(target *TargetOption, variantsOnly bool) []BuildTarget

GetBuildTargets generates the BuildTarget for the given target options. A build target is in the syntax of <board>(-<variant>). If there are no variants then this will return a single value. If there are variants in the target option then this will return a list of all combinations using the above syntax. Models are not considered when generating the BuildTarget

func GetBuildTargetsForAllTargets

func GetBuildTargetsForAllTargets(targetOptions TargetOptions) []BuildTarget

GetBuildTargetsForAllTargets creates a list of build targets that the configuration is tracking. A build target refers to the build image that should be used by the CTP run. A build target is in the form of board(-<variant>).

type ConfigList

type ConfigList []*suschpb.SchedulerConfig

type HourMap

type HourMap map[int]ConfigList

type LabConfigs

type LabConfigs struct {
	Models        map[Model]*BoardEntry
	Boards        map[Board]*BoardEntry
	AndroidBoards map[Board]*BoardEntry
	AndroidModels map[Model]*BoardEntry
}

LabConfigs is a wrapper to provide quick access to boards and models in the lab.

func FetchLabConfigs

func FetchLabConfigs(path string, authOpts *auth.Options) (*LabConfigs, error)

FetchLabConfigs fetches and ingests the lab configs. It will determine where to read the configs from based on the user provided flags.

func IngestLabConfigs

func IngestLabConfigs(labConfig *suschpb.LabConfig) *LabConfigs

IngestLabConfigs takes in all of the raw Lab configs and ingests them into a more usage structure.

type Model

type Model string

type MultiDUTTarget

type MultiDUTTarget struct {
	BuildTarget string
	Board       string
	Model       string

	// NOTE: The following fields are exclusive to Android devices.
	IsAndroid           bool
	AndroidImageVersion string
	GMSCorePackage      string
}

MultiDUTTarget contains the target definitions required by MULTI_DUT targets.

type MultiDutTargetOptions

type MultiDutTargetOptions struct {
	Primary *MultiDUTTarget

	Secondaries []*MultiDUTTarget
}

MultiDutTargetOptions defines a 1-to-N pairing set defined in a MULTI_DUT config.

type SuiteSchedulerConfigs

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

SuiteSchedulerConfigs represents the ADS which will be used for accessing SuiteScheduler configurations.

func FetchSchedulerConfigs

func FetchSchedulerConfigs(path string, labConfigs *LabConfigs, authOpts *auth.Options) (*SuiteSchedulerConfigs, error)

FetchSchedulerConfigs fetches and ingests the SuiteScheduler configs. It will determine where to read the configs from based on the user provided flags.

func IngestSuSchConfigs

func IngestSuSchConfigs(configs ConfigList, lab *LabConfigs) (*SuiteSchedulerConfigs, error)

IngestSuSchConfigs takes in all of the raw Suite Scheduler and Lab configs and ingests them into a more usage structure.

func (*SuiteSchedulerConfigs) FetchAllConfigs

func (s *SuiteSchedulerConfigs) FetchAllConfigs() ConfigList

FetchAllConfigs returns all configs.

func (*SuiteSchedulerConfigs) FetchAllDailyConfigs

func (s *SuiteSchedulerConfigs) FetchAllDailyConfigs() ConfigList

FetchAllDailyConfigs returns all DAILY type configs.

func (*SuiteSchedulerConfigs) FetchAllFortnightlyConfigs

func (s *SuiteSchedulerConfigs) FetchAllFortnightlyConfigs() ConfigList

FetchAllFortnightlyConfigs returns all FORTNIGHTLY type configs.

func (*SuiteSchedulerConfigs) FetchAllMultiDUTConfigs

func (s *SuiteSchedulerConfigs) FetchAllMultiDUTConfigs() ConfigList

FetchAllMultiDUTConfigs returns all MULTI_DUT type configs.

func (*SuiteSchedulerConfigs) FetchAllNDayConfigs

func (s *SuiteSchedulerConfigs) FetchAllNDayConfigs() ConfigList

FetchAllNDayConfigs returns all N_DAYS type configs.

func (*SuiteSchedulerConfigs) FetchAllNewBuild3dConfigs

func (s *SuiteSchedulerConfigs) FetchAllNewBuild3dConfigs() ConfigList

FetchAllNewBuild3dConfigs returns all NEW_BUILD_3D type configs.

func (*SuiteSchedulerConfigs) FetchAllNewBuildConfigs

func (s *SuiteSchedulerConfigs) FetchAllNewBuildConfigs() ConfigList

FetchAllNewBuildConfigs returns all NEW_BUILD type configs.

func (*SuiteSchedulerConfigs) FetchAllTargetOptions

func (s *SuiteSchedulerConfigs) FetchAllTargetOptions() map[string]TargetOptions

func (*SuiteSchedulerConfigs) FetchAllWeeklyConfigs

func (s *SuiteSchedulerConfigs) FetchAllWeeklyConfigs() ConfigList

FetchAllWeeklyConfigs returns all WEEKLY type configs.

func (*SuiteSchedulerConfigs) FetchConfigByName

func (s *SuiteSchedulerConfigs) FetchConfigByName(name string) *suschpb.SchedulerConfig

FetchConfigByName returns the config with the name provided. If it does not exist then an error is returned.

func (*SuiteSchedulerConfigs) FetchConfigTargetOptions

func (s *SuiteSchedulerConfigs) FetchConfigTargetOptions(configName string) (TargetOptions, error)

FetchConfigTargetOptions returns all target options.

func (*SuiteSchedulerConfigs) FetchConfigTargetOptionsForBoard

func (s *SuiteSchedulerConfigs) FetchConfigTargetOptionsForBoard(configName string, board Board) (*TargetOption, error)

FetchConfigTargetOptionsForBoard returns the target options for the specified board for the specified config.

func (*SuiteSchedulerConfigs) FetchDailyByHour

func (s *SuiteSchedulerConfigs) FetchDailyByHour(hour int) (ConfigList, error)

FetchDailyByHour returns all DAILY configs that are to be scheduled at the specified hour.

func (*SuiteSchedulerConfigs) FetchFortnightlyByDay

func (s *SuiteSchedulerConfigs) FetchFortnightlyByDay(day int) (ConfigList, error)

FetchFortnightlyByDay returns all FORTNIGHTLY configs that are to be scheduled on the specified DAY.

func (*SuiteSchedulerConfigs) FetchFortnightlyByDayHour

func (s *SuiteSchedulerConfigs) FetchFortnightlyByDayHour(day, hour int) (ConfigList, error)

FetchFortnightlyByDayHour returns all FORTNIGHTLY configs that are to be scheduled on the specified DAY at the given HOUR.

func (*SuiteSchedulerConfigs) FetchMultiDUTConfigTargetOptions

func (s *SuiteSchedulerConfigs) FetchMultiDUTConfigTargetOptions(configName string) (map[string][]*MultiDutTargetOptions, error)

FetchMultiDUTConfigTargetOptions returns all target options for the given MULTI_DUT config.

func (*SuiteSchedulerConfigs) FetchMultiDUTConfigTargetOptionsForBoard

func (s *SuiteSchedulerConfigs) FetchMultiDUTConfigTargetOptionsForBoard(configName string, primaryBoard string) ([]*MultiDutTargetOptions, error)

FetchMultiDUTConfigTargetOptionsForBoard returns the target options for the specified board for the specified MULTI_DUT config.

func (*SuiteSchedulerConfigs) FetchMultiDUTConfigsByBuildTarget

func (s *SuiteSchedulerConfigs) FetchMultiDUTConfigsByBuildTarget(target BuildTarget) ConfigList

FetchMultiDUTConfigsByBuildTarget returns all MULTI_DUT configs that are to be triggered by a new image of the given build target.

func (*SuiteSchedulerConfigs) FetchNDayByDays

func (s *SuiteSchedulerConfigs) FetchNDayByDays(interval, hour int) (ConfigList, error)

FetchNDayByDays returns all N_DAYS configs that are to be scheduled on the specified interval.

func (*SuiteSchedulerConfigs) FetchNDayByDaysHour

func (s *SuiteSchedulerConfigs) FetchNDayByDaysHour(interval, hour int) (ConfigList, error)

FetchNDayByDaysHour returns all N_DAYS configs that are to be scheduled on the specified interval at the given HOUR.

func (*SuiteSchedulerConfigs) FetchNewBuild3dMap

func (s *SuiteSchedulerConfigs) FetchNewBuild3dMap() map[*suschpb.SchedulerConfig]map[BuildTarget]bool

FetchNewBuild3dMap returns newBuild3dMap.

func (*SuiteSchedulerConfigs) FetchNewBuildConfigsByBuildTarget

func (s *SuiteSchedulerConfigs) FetchNewBuildConfigsByBuildTarget(target BuildTarget) ConfigList

FetchNewBuildConfigsByBuildTarget returns all NEW_BUILD configs that are to be triggered by a new image of the given build target.

func (*SuiteSchedulerConfigs) FetchWeeklyByDay

func (s *SuiteSchedulerConfigs) FetchWeeklyByDay(day int) (ConfigList, error)

FetchWeeklyByDay returns all WEEKLY configs that are to be scheduled on the specified DAY.

func (*SuiteSchedulerConfigs) FetchWeeklyByDayHour

func (s *SuiteSchedulerConfigs) FetchWeeklyByDayHour(day, hour int) (ConfigList, error)

FetchWeeklyByDayHour returns all WEEKLY configs that are to be scheduled on the specified DAY at the given HOUR.

type TargetOption

type TargetOption struct {
	Board        string
	Models       []string
	Variants     []string
	VariantsOnly bool
}

TargetOption is a struct which contains all information for a targeted piece of hardware to be tested.

type TargetOptions

type TargetOptions map[Board]*TargetOption

TargetOptions is a map of board->TargetOption to easily retrieve information.

func GetTargetOptions

func GetTargetOptions(config *suschpb.SchedulerConfig, lab *LabConfigs) (TargetOptions, error)

GetTargetOptions adds all board(-variant)/models combinations specified by the config.

type TestPlanName

type TestPlanName string

type Variant

type Variant string

Jump to

Keyboard shortcuts

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