claim

package
v1.0.54 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: GPL-2.0 Imports: 5 Imported by: 11

Documentation

Overview

Package claim provides a test-network-definition claim schema.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTestCaseDescription

func BuildTestCaseDescription(testID, suiteName, description, remediation, exception, reference string, qe bool, categoryclassification map[string]string, tags ...string) (TestCaseDescription, Identifier)

Types

type CatalogInfo

type CatalogInfo struct {

	// Link to the best practice document supporting this test case
	BestPracticeReference string `json:"bestPracticeReference"`

	// The test description.
	Description string `json:"description"`

	// Indicates the exception process if defined
	ExceptionProcess string `json:"exceptionProcess"`

	// steps required to fix a failing test case
	Remediation string `json:"remediation"`
}

CatalogInfo test specific information from the catalog

func (*CatalogInfo) MarshalJSON

func (strct *CatalogInfo) MarshalJSON() ([]byte, error)

func (*CatalogInfo) UnmarshalJSON

func (strct *CatalogInfo) UnmarshalJSON(b []byte) error

type CategoryClassification

type CategoryClassification struct {

	// indicates whether this test case is mandatory or optional in the Extended scenario
	Extended string `json:"Extended,omitempty"`

	// indicates whether this test case is mandatory or optional in the FarEdge scenario
	FarEdge string `json:"FarEdge,omitempty"`

	// indicates whether this test case is mandatory or optional in the NonTelco scenario
	NonTelco string `json:"NonTelco,omitempty"`

	// indicates whether this test case is mandatory or optional in the Telco scenario
	Telco string `json:"Telco,omitempty"`
}

CategoryClassification categoryClassification is the classification for a single test case.

func (*CategoryClassification) MarshalJSON

func (strct *CategoryClassification) MarshalJSON() ([]byte, error)

func (*CategoryClassification) UnmarshalJSON

func (strct *CategoryClassification) UnmarshalJSON(b []byte) error

type Claim

type Claim struct {

	// Tests within redhat-best-practices-for-k8s often require configuration.  For example, the generic test suite requires listing all CNF containers.  This information is used to derive per-container IP address information, which is then used as input to the connectivity test suite.  Test suites within redhat-best-practices-for-k8s may use multiple configurations, but each with a unique name.
	Configurations map[string]interface{} `json:"configurations"`
	Metadata       *Metadata              `json:"metadata"`

	// An OpenShift cluster is composed of an arbitrary number of Nodes used for platform and application services.  Since a claim must be reproducible, a variety of per-Node information must be collected and stored in the claim.  Node names are unique within a given OpenShift cluster.
	Nodes map[string]interface{} `json:"nodes"`

	// The results for each unique test case.
	Results  map[string]Result `json:"results,omitempty"`
	Versions *Versions         `json:"versions"`
}

Claim

func (*Claim) MarshalJSON

func (strct *Claim) MarshalJSON() ([]byte, error)

func (*Claim) UnmarshalJSON

func (strct *Claim) UnmarshalJSON(b []byte) error

type Identifier

type Identifier struct {

	// id stores a unique id for the testcase.
	Id string `json:"id"`

	// suite stores the test suite name for the testcase.
	Suite string `json:"suite"`

	// tags stores the different tags applied to a test.
	Tags string `json:"tags,omitempty"`
}

Identifier identifier is a per testcase unique identifier.

func (*Identifier) MarshalJSON

func (strct *Identifier) MarshalJSON() ([]byte, error)

func (*Identifier) UnmarshalJSON

func (strct *Identifier) UnmarshalJSON(b []byte) error

type Metadata

type Metadata struct {

	// The UTC end time of a claim evaluation.  This is recorded when the redhat-best-practices-for-k8s test suite completes.
	EndTime string `json:"endTime"`

	// The UTC start time of a claim evaluation.  This is recorded when the redhat-best-practices-for-k8s test suite is invoked.
	StartTime string `json:"startTime"`
}

Metadata

func (*Metadata) MarshalJSON

func (strct *Metadata) MarshalJSON() ([]byte, error)

func (*Metadata) UnmarshalJSON

func (strct *Metadata) UnmarshalJSON(b []byte) error

type Result

type Result struct {

	// Ginkgo writer output during the test run.
	CapturedTestOutput string `json:"capturedTestOutput"`

	// Test detailed information from catalog
	CatalogInfo *CatalogInfo `json:"catalogInfo"`

	// Category classification for the test
	CategoryClassification *CategoryClassification `json:"categoryClassification"`

	// Described the reasons for passing or failing a test
	CheckDetails string `json:"checkDetails"`

	// The duration of the test in nanoseconds.
	Duration int `json:"duration"`

	// The end time of the test.
	EndTime string `json:"endTime,omitempty"`

	// The content of the line where the failure happened
	FailureLineContent string `json:"failureLineContent"`

	// The Filename and line number where the failure happened
	FailureLocation string `json:"failureLocation"`

	// Describes the reasons for not running a test (skipped, aborted, panicked, interrupted)
	SkipReason string `json:"skipReason"`

	// The start time of the test.
	StartTime string `json:"startTime"`

	// The test result state: INVALID SPEC STATE, pending,skipped,passed,failed,aborted,panicked,interrupted
	State string `json:"state"`

	// The test identifier
	TestID *Identifier `json:"testID"`
}

Result result is the result of running a testcase.

func (*Result) MarshalJSON

func (strct *Result) MarshalJSON() ([]byte, error)

func (*Result) UnmarshalJSON

func (strct *Result) UnmarshalJSON(b []byte) error

type Root

type Root struct {
	Claim *Claim `json:"claim"`
}

Root A redhat-best-practices-for-k8s claim is an attestation of the tests performed, the results and the various configurations. Since a claim must be reproducible, it also includes an overview of the systems under test and their physical configurations.

func (*Root) MarshalJSON

func (strct *Root) MarshalJSON() ([]byte, error)

func (*Root) UnmarshalJSON

func (strct *Root) UnmarshalJSON(b []byte) error

type TestCaseDescription

type TestCaseDescription struct {
	// Identifier is the unique test identifier.
	Identifier Identifier `json:"identifier" yaml:"identifier"`

	// Description is a helpful description of the purpose of the test case.
	Description string `json:"description" yaml:"description"`

	// Remediation is an optional suggested remediation for passing the test.
	Remediation string `json:"remediation,omitempty" yaml:"remediation,omitempty"`

	// BestPracticeReference is a helpful best practice references of the test case.
	BestPracticeReference string `json:"BestPracticeReference" yaml:"BestPracticeReference"`

	// ExceptionProcess will show any possible exception processes documented for partners to follow.
	ExceptionProcess string `json:"exceptionProcess,omitempty" yaml:"exceptionProcess,omitempty"`

	// Tags will show all of the ginkgo tags that the test case applies to
	Tags string `json:"tags,omitempty" yaml:"tags,omitempty"`

	// Whether or not automated tests exist for the test case. Not to be rendered.
	Qe bool `json:"qe" yaml:"qe"`

	// classification for each test case
	CategoryClassification map[string]string `json:"categoryclassification" yaml:"categoryclassification"`
}

TestCaseDescription describes a JUnit test case.

type Versions

type Versions struct {

	// The redhat-best-practices-for-k8s (certSuite) release version.
	CertSuite string `json:"certSuite"`

	// The redhat-best-practices-for-k8s (certSuite) Git Commit.
	CertSuiteGitCommit string `json:"certSuiteGitCommit,omitempty"`

	// The claim file format version.
	ClaimFormat string `json:"claimFormat"`

	// The Kubernetes release version.
	K8s string `json:"k8s,omitempty"`

	// The oc client release version.
	OcClient string `json:"ocClient,omitempty"`

	// OCP cluster release version.
	Ocp string `json:"ocp,omitempty"`
}

Versions

func (*Versions) MarshalJSON

func (strct *Versions) MarshalJSON() ([]byte, error)

func (*Versions) UnmarshalJSON

func (strct *Versions) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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