Documentation
¶
Index ¶
- type MockClient
- func (m *MockClient) EjectVirtualMedia(ctx context.Context) error
- func (m *MockClient) NodeID() string
- func (m *MockClient) NodeName() string
- func (m *MockClient) RebootSystem(ctx context.Context) error
- func (m *MockClient) RemoteDirect(ctx context.Context, isoURL string) error
- func (m *MockClient) SetBootSourceByType(ctx context.Context) error
- func (m *MockClient) SetVirtualMedia(ctx context.Context, isoPath string) error
- func (m *MockClient) SystemPowerOff(ctx context.Context) error
- func (m *MockClient) SystemPowerOn(ctx context.Context) error
- func (m *MockClient) SystemPowerStatus(ctx context.Context) (power.Status, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockClient ¶
MockClient is a fake Redfish client for unit testing.
func NewClient ¶
func NewClient(nodeName string, redfishURL string, insecure bool, useProxy bool, username string, password string) (*MockClient, error)
NewClient returns a mocked Redfish client in order to test functions that use the Redfish client without making any Redfish API calls.
func (*MockClient) EjectVirtualMedia ¶
func (m *MockClient) EjectVirtualMedia(ctx context.Context) error
EjectVirtualMedia provides a stubbed method that can be mocked to test functions that use the Redfish client without making any Redfish API calls or requiring the appropriate Redfish client settings.
Example usage: client := redfishutils.NewClient() client.On("EjectVirtualMedia").Return(<return values>) err := client.EjectEphemeralVirtualMedia(<args>)
func (*MockClient) NodeID ¶
func (m *MockClient) NodeID() string
NodeID provides a stubbed method that can be mocked to test functions that use the Redfish client without making any Redfish API calls or requiring the appropriate Redfish client settings.
Example usage: client := redfishutils.NewClient() client.On("NodeID").Return(<return values>) err := client.NodeID()
func (*MockClient) NodeName ¶
func (m *MockClient) NodeName() string
NodeName provides a stubbed method that can be mocked to test functions that use the Redfish client without making any Redfish API calls or requiring the appropriate Redfish client settings.
Example usage: client := redfishutils.NewClient() client.On("NodeName").Return(<return values>) err := client.NodeName()
func (*MockClient) RebootSystem ¶
func (m *MockClient) RebootSystem(ctx context.Context) error
RebootSystem provides a stubbed method that can be mocked to test functions that use the Redfish client without making any Redfish API calls or requiring the appropriate Redfish client settings.
Example usage: client := redfishutils.NewClient() client.On("RebootSystem").Return(<return values>) err := client.RebootSystem(<args>)
func (*MockClient) RemoteDirect ¶
func (m *MockClient) RemoteDirect(ctx context.Context, isoURL string) error
RemoteDirect mocks remote client interface
func (*MockClient) SetBootSourceByType ¶
func (m *MockClient) SetBootSourceByType(ctx context.Context) error
SetBootSourceByType provides a stubbed method that can be mocked to test functions that use the Redfish client without making any Redfish API calls or requiring the appropriate Redfish client settings.
Example usage: client := redfishutils.NewClient() client.On("SetBootSourceByType").Return(<return values>) err := client.SetBootSourceByType(<args>)
func (*MockClient) SetVirtualMedia ¶
func (m *MockClient) SetVirtualMedia(ctx context.Context, isoPath string) error
SetVirtualMedia provides a stubbed method that can be mocked to test functions that use the Redfish client without making any Redfish API calls or requiring the appropriate Redfish client settings.
Example usage: client := redfishutils.NewClient() client.On("SetVirtualMedia").Return(<return values>) err := client.SetVirtualMedia(<args>)
func (*MockClient) SystemPowerOff ¶
func (m *MockClient) SystemPowerOff(ctx context.Context) error
SystemPowerOff provides a stubbed method that can be mocked to test functions that use the Redfish client without making any Redfish API calls or requiring the appropriate Redfish client settings.
Example usage: client := redfishutils.NewClient() client.On("SystemPowerOff").Return(<return values>) err := client.SystemPowerOff(<args>)
func (*MockClient) SystemPowerOn ¶
func (m *MockClient) SystemPowerOn(ctx context.Context) error
SystemPowerOn provides a stubbed method that can be mocked to test functions that use the Redfish client without making any Redfish API calls or requiring the appropriate Redfish client settings.
Example usage: client := redfishutils.NewClient() client.On("SystemPowerOn").Return(<return values>) err := client.SystemPowerOn(<args>)
func (*MockClient) SystemPowerStatus ¶
SystemPowerStatus provides a stubbed method that can be mocked to test functions that use the Redfish client without making any Redfish API calls or requiring the appropriate Redfish client settings.
Example usage: client := redfishutils.NewClient() client.On("SystemPowerStatus").Return(<return values>) err := client.SystemPowerStatus(<args>)