featuretest

package
v0.0.0-...-b5178b8 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delegator

type Delegator struct {
	sync.RWMutex
	ExecInformation
	Runner []Runner
}

Delegator is used to start multiple feature tests

func New

func New(ts []kubeutils.Target, vtDIR string, policyPath string, address connection.OSPDSender) (result *Delegator, err error)

New initializes the needed caches, get targets and creates a Delegator

func (*Delegator) RegisterTest

func (d *Delegator) RegisterTest(t Runner)

func (*Delegator) Run

func (d *Delegator) Run() ([]Result, error)

type ExecInformation

type ExecInformation struct {
	OSPDAddr    connection.OSPDSender // The address to the OSPD Socket
	Protocoll   string
	Targets     []kubeutils.Target // All available targets found via kubernetes
	NASLCache   *nasl.Cache        // All known NASL plugins; is mainly used to lookup OIDs when selecting a policy
	PolicyCache *policies.Cache    // All available Policies
}

ExecInformation contains all information a FeatureTest may need to run

type ProgressHandler

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

func (*ProgressHandler) Each

func (r *ProgressHandler) Each(resp scan.GetScansResponse)

func (*ProgressHandler) Last

func (r *ProgressHandler) Last(resp scan.GetScansResponse)

type Result

type Result struct {
	Name               string                 // Name of the test
	FailureDescription string                 // Description if there was a failure; if there was None then it is empty
	Duration           time.Duration          // How long did it take?
	TargetIDX          []int                  // which targts are used? To reduce memory just the index, empty for all
	Resp               *scan.GetScansResponse // Responses of a scan or nil when none available

}

Result is used to return some information about a test run

type Runner

type Runner interface {
	Name() string                                   // The name of the test
	Start() scan.Start                              // Uses ExecInformation to create a scan.Start command
	Verify(*usecases.GetScanResponseFailure) Result // Uses response of a run to return a Result
}

Runner is used to create the start command and a verifier.

The actual start of a test is done in Delegator run. This is to control the output and runtime behaviour.

Directories

Path Synopsis
findservice contains tests cases around finding services
findservice contains tests cases around finding services

Jump to

Keyboard shortcuts

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