internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// SupportedActions should list all actions supported by Tester.
	SupportedActions = []string{
		string(TestPowerStatus),
		string(TestPowerOn),
		string(TestPowerOff),
		string(TestPowerCycle),
		string(TestPxeBoot),
		string(TestCreateUser),
		string(TestUpdateUser),
		string(TestDeleteUser),
		string(TestScreenshot),
	}
)

Functions

func NewLogger

func NewLogger(level string) logr.Logger

NewLogger returns a logr.

Types

type Config

type Config struct {
	Tests   []string `json:"tests"`
	Servers []struct {
		Name     string `json:"name"`
		Vendor   string `json:"vendor"`
		Model    string `json:"model"`
		BmcHost  string `json:"bmcHost" yaml:"bmcHost"` // yaml struct tags defined because the library requires it
		BmcUser  string `json:"bmcUser" yaml:"bmcUser"`
		BmcPass  string `json:"bmcPass" yaml:"bmcPass"`
		IpmiPort string `json:"ipmiPort" yaml:"IpmiPort"`
	} `json:"servers"`
}

type DeviceResult

type DeviceResult struct {
	Vendor  string
	Model   string
	Name    string
	BMCIP   string
	Results []Result
}

DeviceResult holds the test results for a given device

type Result

type Result struct {
	TestName  string
	Output    string
	Error     string
	Succeeded bool
	Runtime   string
}

Result is a single test result

type ResultStore

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

ResultStore stores test results

func NewTestResultStore

func NewTestResultStore() *ResultStore

func (*ResultStore) Read

func (r *ResultStore) Read() []DeviceResult

func (*ResultStore) Save

func (r *ResultStore) Save(result DeviceResult)

type TestName

type TestName string

TestName identifies a test

const (

	// power status tests
	TestPowerStatus TestName = "power-status"
	TestPowerOn     TestName = "power-on"
	TestPowerOff    TestName = "power-off"
	TestPowerCycle  TestName = "power-cycle"
	TestPxeBoot     TestName = "pxeBoot"
	// user account tests
	TestCreateUser TestName = "create-user"
	TestUpdateUser TestName = "update-user"
	TestDeleteUser TestName = "delete-user"
	TestScreenshot TestName = "screenshot"
)

type Tester

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

Tester runs tests on a host, this struct holds config attributes for tester

func NewTester

func NewTester(pbnjAddr, bmcHost, bmcUser, bmcPass, bmcPort string, logLevel string) *Tester

NewTester returns a Tester instance with the parameters configured.

func (*Tester) Results

func (t *Tester) Results() []Result

func (*Tester) Run

func (t *Tester) Run(ctx context.Context, testNames []string)

Run runs all the given tests.

Jump to

Keyboard shortcuts

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