weles

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2018 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package weles represents the base of the Weles system.

Index

Constants

View Source
const (

	// VersionStateDevel captures enum value "devel"
	VersionStateDevel string = "devel"

	// VersionStateStable captures enum value "stable"
	VersionStateStable string = "stable"

	// VersionStateDeprecated captures enum value "deprecated"
	VersionStateDeprecated string = "deprecated"
)
View Source
const SrvVersion string = "0.1.0"

SrvVersion indicates version of Weles server.

Variables

View Source
var (
	// ErrNotImplemented is returned when function is not implemented yet.
	ErrNotImplemented = errors.New("function not implemented")
	// ErrJobNotFound is returned when Job is not found.
	ErrJobNotFound = errors.New("job not found")
	// ErrJobStatusChangeNotAllowed is returned when Job status change is not
	// possible. It suggests internal Weles logic error.
	ErrJobStatusChangeNotAllowed = errors.New("job status change not allowed")
	// ErrBeforeAfterNotAllowed is returned when client places request for a list
	// with both before and after parameters.
	ErrBeforeAfterNotAllowed = errors.New(
		"setting both before and after qeury parameters is not allowed")
	// ErrArtifactNotFound is returned by API when no artifact is returned by ArtifactManager
	ErrArtifactNotFound = errors.New("artifact not found")
)

Functions

This section is empty.

Types

type Action

type Action struct {
	Deploy
	Boot
	Test
}

Action describes actions executed on the DUT. Firstly it describes how to prepare DUT for a test, and then the test procedure itself.

func (*Action) UnmarshalYAML

func (a *Action) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is an unmarshalling function for Action type.

type ActionTab

type ActionTab []LocalActionContainer

ActionTab contains all possible actions.

type ArtifactAlias

type ArtifactAlias string

ArtifactAlias is an alternative name of an artifact. swagger:model ArtifactAlias

func (ArtifactAlias) Validate

func (m ArtifactAlias) Validate(formats strfmt.Registry) error

Validate validates this artifact alias

type ArtifactDescription

type ArtifactDescription struct {

	// alias
	Alias ArtifactAlias `json:"Alias,omitempty"`

	// specifies  Job for which artifact was created.
	JobID JobID `json:"JobID,omitempty"`

	// type
	Type ArtifactType `json:"Type,omitempty"`

	// URI
	// Format: uri
	URI ArtifactURI `json:"URI,omitempty"`
}

ArtifactDescription contains information needed to create new artifact in ArtifactDB. swagger:model ArtifactDescription

func (*ArtifactDescription) MarshalBinary

func (m *ArtifactDescription) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ArtifactDescription) UnmarshalBinary

func (m *ArtifactDescription) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ArtifactDescription) Validate

func (m *ArtifactDescription) Validate(formats strfmt.Registry) error

Validate validates this artifact description

type ArtifactFilter

type ArtifactFilter struct {

	// alias
	Alias []ArtifactAlias `json:"Alias"`

	// job ID
	JobID []JobID `json:"JobID"`

	// status
	Status []ArtifactStatus `json:"Status"`

	// type
	Type []ArtifactType `json:"Type"`
}

ArtifactFilter is used to filter results from ArtifactDB. swagger:model ArtifactFilter

func (*ArtifactFilter) MarshalBinary

func (m *ArtifactFilter) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ArtifactFilter) UnmarshalBinary

func (m *ArtifactFilter) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ArtifactFilter) Validate

func (m *ArtifactFilter) Validate(formats strfmt.Registry) error

Validate validates this artifact filter

type ArtifactInfo

type ArtifactInfo struct {
	ArtifactDescription

	// unique identification of the artifact.
	ID int64 `json:"ID,omitempty" db:",primarykey, autoincrement"`

	// path
	Path ArtifactPath `json:"Path,omitempty"`

	// status
	Status ArtifactStatus `json:"Status,omitempty"`

	// is date of creating the artifact.
	// Format: date-time
	Timestamp strfmt.DateTime `json:"Timestamp,omitempty"`
}

ArtifactInfo describes single artifact stored in ArtifactDB. swagger:model ArtifactInfo

func (*ArtifactInfo) MarshalBinary

func (m *ArtifactInfo) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (ArtifactInfo) MarshalJSON

func (m ArtifactInfo) MarshalJSON() ([]byte, error)

MarshalJSON marshals this object to a JSON structure

func (*ArtifactInfo) UnmarshalBinary

func (m *ArtifactInfo) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ArtifactInfo) UnmarshalJSON

func (m *ArtifactInfo) UnmarshalJSON(raw []byte) error

UnmarshalJSON unmarshals this object from a JSON structure

func (*ArtifactInfo) Validate

func (m *ArtifactInfo) Validate(formats strfmt.Registry) error

Validate validates this artifact info

type ArtifactManager

type ArtifactManager interface {
	// List filters ArtifactDB and returns list of all matching artifacts.
	ListArtifact(filter ArtifactFilter, sorter ArtifactSorter, paginator ArtifactPagination) ([]ArtifactInfo, ListInfo, error) // nolint: lll

	// Push inserts artifact to ArtifactDB and returns its path.
	PushArtifact(artifact ArtifactDescription, ch chan ArtifactStatusChange) (ArtifactPath, error)

	// Create constructs ArtifactPath in ArtifactDB, but no file is created.
	CreateArtifact(artifact ArtifactDescription) (ArtifactPath, error)

	// GetFileInfo retrieves information about an artifact from ArtifactDB.
	GetArtifactInfo(path ArtifactPath) (ArtifactInfo, error)

	// Close gracefully closes ArtifactManager.
	Close() error
}

ArtifactManager provides access to content in ArtifactDB required for Job execution. It provides data from ArtifactDB for lookup and retrieval. It is responsible for downloading job artifacts to ArtifactDB.

type ArtifactPagination

type ArtifactPagination struct {
	ID      int64
	Forward bool
	Limit   int32
}

ArtifactPagination holds information neccessary to request for a single page of data from artifactmanager. When ID is set, and Forward is false - ArtifactManager should return a page of records before the supplied ID. When ID is set, and Forward is true - ArtifactManager should return page of records after the supplied ID. In both cases, returned page should not include supplied ID. Limit denotes the number of records to be returned on the page. When Limit is set to 0, pagination is disabled, ID and Forward fields are ignored and all records are returned.

type ArtifactPath

type ArtifactPath string

ArtifactPath describes path to artifact in ArtifactDB filesystem. swagger:model ArtifactPath

func (ArtifactPath) Validate

func (m ArtifactPath) Validate(formats strfmt.Registry) error

Validate validates this artifact path

type ArtifactSortBy

type ArtifactSortBy string

ArtifactSortBy denotes the key for sorting list of all artifacts. * ID - sorting by artifact ID.

swagger:model ArtifactSortBy

const (

	// ArtifactSortByID captures enum value "ID"
	ArtifactSortByID ArtifactSortBy = "ID"
)

func (ArtifactSortBy) Validate

func (m ArtifactSortBy) Validate(formats strfmt.Registry) error

Validate validates this artifact sort by

type ArtifactSorter

type ArtifactSorter struct {

	// sort by
	SortBy ArtifactSortBy `json:"SortBy,omitempty"`

	// sort order
	SortOrder SortOrder `json:"SortOrder,omitempty"`
}

ArtifactSorter defines the key for sorting as well as direction of sorting. When ArtifactSorter is empty, artifacts are sorted by ID, Ascending.

swagger:model ArtifactSorter

func (*ArtifactSorter) MarshalBinary

func (m *ArtifactSorter) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ArtifactSorter) UnmarshalBinary

func (m *ArtifactSorter) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ArtifactSorter) Validate

func (m *ArtifactSorter) Validate(formats strfmt.Registry) error

Validate validates this artifact sorter

type ArtifactStatus

type ArtifactStatus string

ArtifactStatus describes artifact status and availability.

* DOWNLOADING - artifact is currently being downloaded.

* READY - artifact has been downloaded and is ready to use.

* FAILED - file is not available for use (e.g. download failed).

* PENDING - artifact download has not started yet.

swagger:model ArtifactStatus

const (

	// ArtifactStatusDOWNLOADING captures enum value "DOWNLOADING"
	ArtifactStatusDOWNLOADING ArtifactStatus = "DOWNLOADING"

	// ArtifactStatusREADY captures enum value "READY"
	ArtifactStatusREADY ArtifactStatus = "READY"

	// ArtifactStatusFAILED captures enum value "FAILED"
	ArtifactStatusFAILED ArtifactStatus = "FAILED"

	// ArtifactStatusPENDING captures enum value "PENDING"
	ArtifactStatusPENDING ArtifactStatus = "PENDING"
)

func (ArtifactStatus) Validate

func (m ArtifactStatus) Validate(formats strfmt.Registry) error

Validate validates this artifact status

type ArtifactStatusChange

type ArtifactStatusChange struct {
	Path      ArtifactPath
	NewStatus ArtifactStatus
}

ArtifactStatusChange contains information about new status of an artifact. It is used to monitor status changes.

type ArtifactType

type ArtifactType string

ArtifactType denotes type and function of an artifact.

* IMAGE - image file.

* RESULT - all outputs, files built during tests, etc.

* TEST - additional files uploaded by user for conducting test.

* YAML - yaml file describing Weles Job.

swagger:model ArtifactType

const (

	// ArtifactTypeIMAGE captures enum value "IMAGE"
	ArtifactTypeIMAGE ArtifactType = "IMAGE"

	// ArtifactTypeRESULT captures enum value "RESULT"
	ArtifactTypeRESULT ArtifactType = "RESULT"

	// ArtifactTypeTEST captures enum value "TEST"
	ArtifactTypeTEST ArtifactType = "TEST"

	// ArtifactTypeYAML captures enum value "YAML"
	ArtifactTypeYAML ArtifactType = "YAML"
)

func (ArtifactType) Validate

func (m ArtifactType) Validate(formats strfmt.Registry) error

Validate validates this artifact type

type ArtifactURI

type ArtifactURI strfmt.URI

ArtifactURI is used to identify artifact's source. swagger:model ArtifactURI

func (ArtifactURI) Validate

func (m ArtifactURI) Validate(formats strfmt.Registry) error

Validate validates this artifact URI

type Boot

type Boot struct {
	Login         string      `yaml:"login"`
	Password      string      `yaml:"password"`
	Prompts       []string    `yaml:"prompts"`
	FailureRetry  int         `yaml:"failure_retry"`
	Timeout       ValidPeriod `yaml:"timeout"`
	InputSequence string      `yaml:"input_sequence"`
	WaitPattern   string      `yaml:"wait_pattern"`
	WaitTime      ValidPeriod `yaml:"wait_time"`
}

Boot describes the boot part of the test.

type Config

type Config struct {
	DeviceType string   `yaml:"device_type"`
	JobName    string   `yaml:"job_name"`
	Timeouts   Timeouts `yaml:"timeouts"`
	Priority   Priority `yaml:"priority"`
	Action     Action   `yaml:"actions"`
}

Config contains all informtion needed for the Weles to make test.

type Deploy

type Deploy struct {
	Timeout         ValidPeriod           `yaml:"timeout"`
	Images          []ImageDefinition     `yaml:"images"`
	PartitionLayout []PartitionDefinition `yaml:"partition_layout"`
}

Deploy describes "deploy" section in YAML.

type Dryad

type Dryad struct {
	// Addr is necessary information to connect to a tunnel to Dryad.
	Addr net.Addr
	// Key is private RSA key of the job session.
	Key rsa.PrivateKey
	// Username defines Dryad's account name.
	Username string
}

Dryad contains information about device allocated for Job and credentials required to use it.

type DryadJobFilter

type DryadJobFilter struct {
	References []JobID
	Statuses   []DryadJobStatus
}

DryadJobFilter is used by List to access only jobs of interest.

Job is matching DryadJobFilter if References contain value of its Job field and Statuses - Status.

type DryadJobInfo

type DryadJobInfo struct {
	Job    JobID
	Status DryadJobStatus
}

DryadJobInfo contains information about DryadJob.

type DryadJobManager

type DryadJobManager interface {
	// Create starts execution of Job definition on allocated Dryad.
	// Job's config is passed in order to avoid need to fetch it from Job Manager.
	//
	// JobID is used only to reference currently executing Jobs.
	//
	// Slow read from a channel may miss some events.
	Create(JobID, Dryad, Config, chan<- DryadJobStatusChange) error

	// Cancel stops DryadJob associated with Job.
	//
	// It has no effect if Cancel has been called before
	// or job has already terminated.
	Cancel(JobID) error

	// List returns information about DryadJobs matching DryadJobFilter
	// or all if it is not specified.
	List(*DryadJobFilter) ([]DryadJobInfo, error)
}

DryadJobManager organizes running Jobs on allocated Dryad.

type DryadJobStatus

type DryadJobStatus string

DryadJobStatus is a representation of current state of DryadJob.

const (
	// DryadJobStatusNEW - initial status of DryadJob after call to Create.
	DryadJobStatusNEW DryadJobStatus = "CREATED"
	// DryadJobStatusDEPLOY - DryadJob is executing deploy section of job definition.
	DryadJobStatusDEPLOY DryadJobStatus = "DEPLOYING"
	// DryadJobStatusBOOT - DryadJob is executing boot section of job definition.
	DryadJobStatusBOOT DryadJobStatus = "BOOTING"
	// DryadJobStatusTEST - DryadJob is executing test section of job definition.
	DryadJobStatusTEST DryadJobStatus = "EXECUTING TESTS"
	// DryadJobStatusFAIL - an irrecoverable error has been encountered
	// and execution had to be stopped early.
	DryadJobStatusFAIL DryadJobStatus = "ERROR OCCURRED"
	// DryadJobStatusOK - DryadJob has finished execution successfully.
	DryadJobStatusOK DryadJobStatus = "DONE"
)

type DryadJobStatusChange

type DryadJobStatusChange DryadJobInfo

DryadJobStatusChange is information passed on the channel to the caller of Create.

type ErrInvalidArgument

type ErrInvalidArgument string

ErrInvalidArgument is returned when argument passed to public API cannot be parsed.

func (ErrInvalidArgument) Error

func (err ErrInvalidArgument) Error() string

type ErrResponse

type ErrResponse struct {

	// message
	Message string `json:"message,omitempty"`

	// type
	Type string `json:"type,omitempty"`
}

ErrResponse is a standard error response containing information about the error. It consists of error type and message. swagger:model ErrResponse

func (*ErrResponse) MarshalBinary

func (m *ErrResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ErrResponse) UnmarshalBinary

func (m *ErrResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ErrResponse) Validate

func (m *ErrResponse) Validate(formats strfmt.Registry) error

Validate validates this err response

type ImageDefinition

type ImageDefinition struct {
	URI          string `yaml:"uri"`
	ChecksumURI  string `yaml:"checksum_uri"`
	ChecksumType string `yaml:"checksum_type"`
	Compression  string `yaml:"compression"`

	// Path defines ArtifactDB path. It's added for Controller purposes.
	Path         string `yaml:"-"`
	ChecksumPath string `yaml:"-"`
}

ImageDefinition describes images required for the tests.

type JobFilter

type JobFilter struct {

	// created after
	// Format: date-time
	CreatedAfter strfmt.DateTime `json:"CreatedAfter,omitempty"`

	// created before
	// Format: date-time
	CreatedBefore strfmt.DateTime `json:"CreatedBefore,omitempty"`

	// info
	Info []string `json:"Info"`

	// job ID
	JobID []JobID `json:"JobID"`

	// name
	Name []string `json:"Name"`

	// status
	Status []JobStatus `json:"Status"`

	// updated after
	// Format: date-time
	UpdatedAfter strfmt.DateTime `json:"UpdatedAfter,omitempty"`

	// updated before
	// Format: date-time
	UpdatedBefore strfmt.DateTime `json:"UpdatedBefore,omitempty"`
}

JobFilter is used to filter Weles Jobs. swagger:model JobFilter

func (*JobFilter) MarshalBinary

func (m *JobFilter) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*JobFilter) UnmarshalBinary

func (m *JobFilter) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*JobFilter) Validate

func (m *JobFilter) Validate(formats strfmt.Registry) error

Validate validates this job filter

type JobID

type JobID uint64

JobID is a unique identifier for Weles Job. swagger:model JobID

func (JobID) String

func (jid JobID) String() string

String is a method that satisfies fmt.Stringer interface. It returns JobID as string.

func (JobID) Validate

func (m JobID) Validate(formats strfmt.Registry) error

Validate validates this job ID

type JobInfo

type JobInfo struct {

	// is the Job creation time in UTC.
	// Format: date-time
	Created strfmt.DateTime `json:"created,omitempty"`

	// provides additional information about current state, e.g. cause of failure
	Info string `json:"info,omitempty"`

	// is a unique Job identifier
	JobID JobID `json:"jobID,omitempty"`

	// is the Job name acquired from yaml file during Job creation.
	Name string `json:"name,omitempty"`

	// specifies current state of the Job.
	Status JobStatus `json:"status,omitempty"`

	// is the time of latest Jobs' status modification.
	// Format: date-time
	Updated strfmt.DateTime `json:"updated,omitempty"`
}

JobInfo contains information about a Job available for public API. swagger:model JobInfo

func (*JobInfo) MarshalBinary

func (m *JobInfo) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*JobInfo) UnmarshalBinary

func (m *JobInfo) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*JobInfo) Validate

func (m *JobInfo) Validate(formats strfmt.Registry) error

Validate validates this job info

type JobManager

type JobManager interface {
	// CreateJob creates a new Job in Weles using recipe passed in YAML format.
	// It returns ID of created Job or error.
	CreateJob(yaml []byte) (JobID, error)
	// CancelJob stops execution of Job identified by JobID.
	CancelJob(JobID) error
	// ListJobs returns information on Jobs. It takes 3 arguments:
	// - JobFilter containing filters
	// - JobSorter containing sorting key and sorting direction
	// - JobPagination containing element after/before which a page should be returned. It also
	// contains information about direction of listing and the size of the returned page which
	// must always be set.
	ListJobs(JobFilter, JobSorter, JobPagination) ([]JobInfo, ListInfo, error)
}

JobManager interface defines API for actions that can be called on Weles' Jobs by external modules. These methods are intended to be used by HTTP server.

type JobPagination

type JobPagination struct {
	JobID   JobID
	Forward bool
	Limit   int32
}

JobPagination holds information neccessary to request for a single page of data. When JobID is set, and Forward is false - Controller should return a page of records before the supplied JobID. When JobID is set, and Forward is true - Controller should return page of record after the supplied JobID. In both cases, returned page should not include supplied JobID. Limit denotes the number of records to be returned on the page. When Limit is set to 0, pagination is disabled, JobID and Forward fields are ignored and all records are returned.

type JobSortBy

type JobSortBy string

JobSortBy denotes key for sorting Jobs list.

* ID - default sort key.

* CreatedDate - sorting by date of creation of the weles job.

* UpdatedDate - sorting by date of update of the weles job.

* JobStatus - sorting by the Job Status. Descending order will sort in the order JobStatuses are listed in the docs (from NEW at the start to CANCELED at the end). Ascending will reverse this order.

When sorting is applied, and there are many jobs with the same date/status, they will be sorted by JobID (Ascending)

swagger:model JobSortBy

const (

	// JobSortByID captures enum value "ID"
	JobSortByID JobSortBy = "ID"

	// JobSortByCreatedDate captures enum value "CreatedDate"
	JobSortByCreatedDate JobSortBy = "CreatedDate"

	// JobSortByUpdatedDate captures enum value "UpdatedDate"
	JobSortByUpdatedDate JobSortBy = "UpdatedDate"

	// JobSortByJobStatus captures enum value "JobStatus"
	JobSortByJobStatus JobSortBy = "JobStatus"
)

func (JobSortBy) Validate

func (m JobSortBy) Validate(formats strfmt.Registry) error

Validate validates this job sort by

type JobSorter

type JobSorter struct {

	// sort by
	SortBy JobSortBy `json:"SortBy,omitempty"`

	// sort order
	SortOrder SortOrder `json:"SortOrder,omitempty"`
}

JobSorter defines the key for sorting as well as direction of sorting.

swagger:model JobSorter

func (*JobSorter) MarshalBinary

func (m *JobSorter) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*JobSorter) UnmarshalBinary

func (m *JobSorter) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*JobSorter) Validate

func (m *JobSorter) Validate(formats strfmt.Registry) error

Validate validates this job sorter

type JobStatus

type JobStatus string

JobStatus specifies state of the Job.

* NEW - The new Job has been created.

* PARSING - Provided yaml file is being parsed and interpreted.

* DOWNLOADING - Images and/or files required for the test are being downloaded.

* WAITING - Job is waiting for Boruta worker.

* RUNNING - Job is being executed.

* COMPLETED - Job is completed. This is terminal state.

* FAILED - Job execution has failed. This is terminal state.

* CANCELED -Job has been canceled with API call. This is terminal state.

swagger:model JobStatus

const (

	// JobStatusNEW captures enum value "NEW"
	JobStatusNEW JobStatus = "NEW"

	// JobStatusPARSING captures enum value "PARSING"
	JobStatusPARSING JobStatus = "PARSING"

	// JobStatusDOWNLOADING captures enum value "DOWNLOADING"
	JobStatusDOWNLOADING JobStatus = "DOWNLOADING"

	// JobStatusWAITING captures enum value "WAITING"
	JobStatusWAITING JobStatus = "WAITING"

	// JobStatusRUNNING captures enum value "RUNNING"
	JobStatusRUNNING JobStatus = "RUNNING"

	// JobStatusCOMPLETED captures enum value "COMPLETED"
	JobStatusCOMPLETED JobStatus = "COMPLETED"

	// JobStatusFAILED captures enum value "FAILED"
	JobStatusFAILED JobStatus = "FAILED"

	// JobStatusCANCELED captures enum value "CANCELED"
	JobStatusCANCELED JobStatus = "CANCELED"
)

func (JobStatus) ToInt

func (status JobStatus) ToInt() int

ToInt converts JobStatus to int.

func (JobStatus) Validate

func (m JobStatus) Validate(formats strfmt.Registry) error

Validate validates this job status

type ListInfo

type ListInfo struct {
	TotalRecords     uint64
	RemainingRecords uint64
}

ListInfo is a struct holding information to be returned by JobManager and ArtifactManager with lists of data. TotalRecords is returned to the user by API. RemainingRecords is used by API internally to return correct HTTP status codes (206 partial content and 200 ok).

type LocalActionContainer

type LocalActionContainer Action

LocalActionContainer contains fields for all types of actions.

type LocalTestActionContainer

type LocalTestActionContainer struct {
	Boot
	Push
	Run
	Pull
}

LocalTestActionContainer contains fields for all types of test cases.

type Parser

type Parser interface {
	// ParseYaml converts given input to Config. YAML file format is expected.
	ParseYaml(input []byte) (*Config, error)
}

Parser defines methods of YAML parser.

type PartitionDefinition

type PartitionDefinition struct {
	ID        int    `yaml:"id"`
	ImageName string `yaml:"image_name"`
	Size      string `yaml:"size"`
	Type      string `yaml:"type"`
}

PartitionDefinition describes a relation of a partition to named image, its size, and type.

type Priority

type Priority string

Priority denotes priority level.

const (
	// LOW - low priority.
	LOW Priority = "low"
	// MEDIUM - medium priority.
	MEDIUM Priority = "medium"
	// HIGH - high priority.
	HIGH Priority = "high"
)

type Pull

type Pull struct {
	Src     string      `yaml:"src"`
	Alias   string      `yaml:"alias"`
	Timeout ValidPeriod `yaml:"timeout"`

	// Path defines ArtifactDB path. It's added for Controller purposes.
	Path string `yaml:"-"`
}

Pull describes the pull part of the test, e.g. getting the test artifacts.

type Push

type Push struct {
	URI     string      `yaml:"uri"`
	Dest    string      `yaml:"dest"`
	Alias   string      `yaml:"alias"`
	Timeout ValidPeriod `yaml:"timeout"`

	// Path defines ArtifactDB path. It's added for Controller purposes.
	Path string `yaml:"-"`
}

Push describes the push part of the test.

type Run

type Run struct {
	Name    string      `yaml:"name"`
	Timeout ValidPeriod `yaml:"timeout"`
}

Run describes the run part of the test.

type SortOrder

type SortOrder string

SortOrder denotes direction of sorting of weles jobs or artifacts.

* Ascending - from oldest to newest.

* Descending - from newest to oldest.

swagger:model SortOrder

const (

	// SortOrderAscending captures enum value "Ascending"
	SortOrderAscending SortOrder = "Ascending"

	// SortOrderDescending captures enum value "Descending"
	SortOrderDescending SortOrder = "Descending"
)

func (SortOrder) Validate

func (m SortOrder) Validate(formats strfmt.Registry) error

Validate validates this sort order

type Test

type Test struct {
	FailureRetry int         `yaml:"failure_retry"`
	Name         string      `yaml:"name"`
	Timeout      ValidPeriod `yaml:"timeout"`
	TestCases    []TestCase  `yaml:"test_cases"`
}

Test describes "test" section in YAML.

type TestAction

type TestAction interface{}

TestAction is either Boot/Push/Run/Pull. It describes test action, which can be done on already prepared DUT.

type TestActionTab

type TestActionTab []LocalTestActionContainer

TestActionTab contains all possible test cases.

type TestActions

type TestActions []TestAction

TestActions is a container for all test actions.

func (*TestActions) UnmarshalYAML

func (t *TestActions) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is an unmarshalling function for TestActions type.

type TestCase

type TestCase struct {
	CaseName    string      `yaml:"case_name"`
	TestActions TestActions `yaml:"test_actions"`
}

TestCase describes single test case.

type Timeouts

type Timeouts struct {
	// JobTimeout describes default timeouts for a job.
	JobTimeout ValidPeriod `yaml:"job"`
	// ActionTimeout describes default timeouts for boot/push/run/pull.
	ActionTimeout ValidPeriod `yaml:"action"`
}

Timeouts describes default timeouts for different actions.

type ValidPeriod

type ValidPeriod time.Duration

ValidPeriod denotes timeouts.

func (*ValidPeriod) UnmarshalYAML

func (t *ValidPeriod) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals ValidPeriod type.

type Version

type Version struct {

	// Version of Weles API.
	API string `json:"API,omitempty"`

	// Version of Weles server.
	Server string `json:"Server,omitempty"`

	// State of Weles API.
	// Enum: [devel stable deprecated]
	State string `json:"State,omitempty"`
}

Version defines version of Weles API (and its state) and server.

swagger:model Version

func (*Version) MarshalBinary

func (m *Version) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Version) UnmarshalBinary

func (m *Version) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Version) Validate

func (m *Version) Validate(formats strfmt.Registry) error

Validate validates this version

Directories

Path Synopsis
Package artifacts is responsible for Weles system's job artifact management.
Package artifacts is responsible for Weles system's job artifact management.
database
Package database is responsible for Weles system's job artifact storage.
Package database is responsible for Weles system's job artifact storage.
downloader
Package downloader is responsible for Weles system's job artifact downloading.
Package downloader is responsible for Weles system's job artifact downloading.
cmd
Package controller provides Controller implementation.
Package controller provides Controller implementation.
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
notifier
Package notifier defines structures and constants used by controller package and provides Notifier interface with implementation for communication between submodules and Controller.
Package notifier defines structures and constants used by controller package and provides Notifier interface with implementation for communication between submodules and Controller.
Package manager provides Dryad Job Manager.
Package manager provides Dryad Job Manager.
dryad
Package dryad provides Dryad Manager.
Package dryad provides Dryad Manager.
dryad/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
Package server Weles This is a Weles server.
Package server Weles This is a Weles server.

Jump to

Keyboard shortcuts

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