Documentation
¶
Index ¶
- Constants
- func FilterCheckIDs() ([]string, error)
- func GetReconciledResults() map[string]claim.Result
- func GetResults() map[string]claim.Result
- func GetTestSuites() []string
- func GetTestsCountByState(state string) int
- func GetTotalTests() int
- func InitLabelsExprEvaluator(labelsFilter string) error
- func RunChecks(timeout time.Duration) (failedCtr int, err error)
- type AbortPanicMsg
- type Check
- func (check *Check) Abort(reason string)
- func (check *Check) GetLogger() *log.Logger
- func (check *Check) GetLogs() string
- func (check *Check) LogDebug(msg string, args ...any)
- func (check *Check) LogError(msg string, args ...any)
- func (check *Check) LogFatal(msg string, args ...any)
- func (check *Check) LogInfo(msg string, args ...any)
- func (check *Check) LogWarn(msg string, args ...any)
- func (check *Check) Run() error
- func (check *Check) SetAbortChan(abortChan chan string)
- func (check *Check) SetResult(compliantObjects, nonCompliantObjects []*testhelper.ReportObject)
- func (check *Check) SetResultAborted(reason string)
- func (check *Check) SetResultError(reason string)
- func (check *Check) SetResultSkipped(reason string)
- func (check *Check) WithAfterCheckFn(afterCheckFn func(check *Check) error) *Check
- func (check *Check) WithBeforeCheckFn(beforeCheckFn func(check *Check) error) *Check
- func (check *Check) WithCheckFn(checkFn func(check *Check) error) *Check
- func (check *Check) WithSkipCheckFn(skipCheckFn ...func() (skip bool, reason string)) *Check
- func (check *Check) WithSkipModeAll() *Check
- func (check *Check) WithSkipModeAny() *Check
- func (check *Check) WithTimeout(duration time.Duration) *Check
- type CheckResult
- type ChecksGroup
- func (group *ChecksGroup) Add(check *Check)
- func (group *ChecksGroup) OnAbort(abortReason string) error
- func (group *ChecksGroup) RecordChecksResults()
- func (group *ChecksGroup) RunChecks(stopChan <-chan bool, abortChan chan string) (errs []error, failedChecks int)
- func (group *ChecksGroup) WithAfterAllFn(afterAllFn func(checks []*Check) error) *ChecksGroup
- func (group *ChecksGroup) WithAfterEachFn(afterEachFn func(check *Check) error) *ChecksGroup
- func (group *ChecksGroup) WithBeforeAllFn(beforeAllFn func(checks []*Check) error) *ChecksGroup
- func (group *ChecksGroup) WithBeforeEachFn(beforeEachFn func(check *Check) error) *ChecksGroup
Constants ¶
View Source
const ( CheckResultPassed = "passed" CheckResultSkipped = "skipped" CheckResultFailed = "failed" CheckResultError = "error" CheckResultAborted = "aborted" )
View Source
const ( SkipModeAny skipMode = iota SkipModeAll )
View Source
const ( PASSED = 0 FAILED = 1 SKIPPED = 2 )
Variables ¶
This section is empty.
Functions ¶
func FilterCheckIDs ¶
func GetReconciledResults ¶
GetReconciledResults is a function added to aggregate a Claim's results. Due to the limitations of certsuite-claim's Go Client, results are generalized to map[string]interface{}.
func GetResults ¶
func GetTestSuites ¶
func GetTestSuites() []string
func GetTestsCountByState ¶
func GetTotalTests ¶
func GetTotalTests() int
func InitLabelsExprEvaluator ¶
Types ¶
type AbortPanicMsg ¶
type AbortPanicMsg string
type Check ¶
type Check struct { ID string Labels []string BeforeCheckFn, AfterCheckFn func(check *Check) error CheckFn func(check *Check) error SkipCheckFns []func() (skip bool, reason string) SkipMode skipMode Result CheckResult CapturedOutput string StartTime, EndTime time.Time Timeout time.Duration Error error // contains filtered or unexported fields }
func (*Check) SetAbortChan ¶
func (*Check) SetResult ¶
func (check *Check) SetResult(compliantObjects, nonCompliantObjects []*testhelper.ReportObject)
func (*Check) SetResultAborted ¶
func (*Check) SetResultError ¶
func (*Check) SetResultSkipped ¶
func (*Check) WithAfterCheckFn ¶
func (*Check) WithBeforeCheckFn ¶
func (*Check) WithCheckFn ¶
func (*Check) WithSkipCheckFn ¶
func (*Check) WithSkipModeAll ¶
func (*Check) WithSkipModeAny ¶
This modifier is provided for the sake of completeness, but it's not necessary to use it, as the SkipModeAny is the default skip mode.
type CheckResult ¶
type CheckResult string
func (CheckResult) String ¶
func (cr CheckResult) String() string
type ChecksGroup ¶
type ChecksGroup struct {
// contains filtered or unexported fields
}
func NewChecksGroup ¶
func NewChecksGroup(groupName string) *ChecksGroup
func (*ChecksGroup) Add ¶
func (group *ChecksGroup) Add(check *Check)
func (*ChecksGroup) OnAbort ¶
func (group *ChecksGroup) OnAbort(abortReason string) error
func (*ChecksGroup) RecordChecksResults ¶
func (group *ChecksGroup) RecordChecksResults()
func (*ChecksGroup) RunChecks ¶
func (group *ChecksGroup) RunChecks(stopChan <-chan bool, abortChan chan string) (errs []error, failedChecks int)
Runs all the checks in the group whose labels match the label expression filter.
- Calls group.BeforeAll(). Then, for each Check in the group:
- Calls group.BeforeEach() -> normally used to get/refresh the test environment variable.
- Calls check.SkipCheckFn() -> if true, skip the check.Run() (step 4)
- Calls check.Run() -> Will call the actual CNF Cert requirement check function.
- Calls group.AfterEach()
- Calls group.AfterAll()
Issues/errors/panics:
- BeforeAll panic/error: Set first check as error. Run AfterAll()
- BeforeEach panic/error: Set check as error and skip remaining. Skip check.Run(), run AfterEach + AfterAll.
- Check.Run() panic/error: Set check as panicked. Run AfterEach + AfterAll
- AfterEach panic: Set check as error.
func (*ChecksGroup) WithAfterAllFn ¶
func (group *ChecksGroup) WithAfterAllFn(afterAllFn func(checks []*Check) error) *ChecksGroup
func (*ChecksGroup) WithAfterEachFn ¶
func (group *ChecksGroup) WithAfterEachFn(afterEachFn func(check *Check) error) *ChecksGroup
func (*ChecksGroup) WithBeforeAllFn ¶
func (group *ChecksGroup) WithBeforeAllFn(beforeAllFn func(checks []*Check) error) *ChecksGroup
func (*ChecksGroup) WithBeforeEachFn ¶
func (group *ChecksGroup) WithBeforeEachFn(beforeEachFn func(check *Check) error) *ChecksGroup
Click to show internal directories.
Click to hide internal directories.