Documentation ¶
Overview ¶
Package mock provides all methods required to simulate a driver
Package mock provides all methods required to simulate a driver ¶
Package mock provides all methods required to simulate a driver ¶
Package mock provides all methods required to simulate a driver
Index ¶
- Constants
- func ManipulateMachine(machine *v1alpha1.Machine, data map[string]interface{}) *v1alpha1.Machine
- func ManipulateProviderSpec(providerSpec *apis.ProviderSpec, data map[string]interface{}) *apis.ProviderSpec
- func NewMachine(serverID string) *v1alpha1.Machine
- func NewMachineClass() *v1alpha1.MachineClass
- func NewMachineClassWithProviderSpec(providerSpec []byte) *v1alpha1.MachineClass
- func NewProviderSpec() *apis.ProviderSpec
- func SetupImagesEndpointOnMux(mux *http.ServeMux)
- func SetupServersEndpointOnMux(mux *http.ServeMux)
- func SetupTestServerEndpointOnMux(mux *http.ServeMux)
- func SetupTestVolumeEndpointOnMux(mux *http.ServeMux)
- func SetupVolumesEndpointOnMux(mux *http.ServeMux)
- type MockTestEnv
Constants ¶
const ( TestNamespace = "test" TestServerNameTemplate = "machine-%s" TestServerID = "6789abcd-ef01-4345-6789-abcdef012325" TestServerNicID = "23456789-abcd-4f01-23e5-6789abcdef01" TestServerVolumeID = "3456789a-bcde-4012-3f56-789abcdef012" )
const ( TestProviderSpec = "" /* 242-byte string literal not displayed */ TestProviderSpecCluster = "xyz" TestProviderSpecDatacenterID = "01234567-89ab-4def-0123-c56789abcdef" TestProviderSpecNetworkID = "1" TestProviderSpecSSHKey = "ssh-rsa invalid" TestProviderSpecImageID = "15f67991-0f51-4efc-a8ad-ef1fb31a480c" TestProviderSpecZone = "de-fra" TestInvalidProviderSpec = "{\"test\":\"invalid\"}" )
Variables ¶
This section is empty.
Functions ¶
func ManipulateMachine ¶
ManipulateMachine changes given machine data.
PARAMETERS machine *v1alpha1.Machine Machine data data map[string]interface{} Members to change
func ManipulateProviderSpec ¶
func ManipulateProviderSpec(providerSpec *apis.ProviderSpec, data map[string]interface{}) *apis.ProviderSpec
ManipulateProviderSpec changes given provider specification.
PARAMETERS providerSpec *apis.ProviderSpec Provider specification data map[string]interface{} Members to change
func NewMachine ¶
NewMachine generates new v1alpha1 machine data for testing purposes.
PARAMETERS ServerID string Server UUID to use for machine specification
func NewMachineClass ¶
func NewMachineClass() *v1alpha1.MachineClass
NewMachineClass generates new v1alpha1 machine class data for testing purposes.
func NewMachineClassWithProviderSpec ¶
func NewMachineClassWithProviderSpec(providerSpec []byte) *v1alpha1.MachineClass
NewMachineClassWithProviderSpec generates new v1alpha1 machine class data based on the given provider specification for testing purposes.
PARAMETERS providerSpec []byte ProviderSpec to use
func NewProviderSpec ¶
func NewProviderSpec() *apis.ProviderSpec
NewProviderSpec generates a new provider specification for testing purposes.
func SetupImagesEndpointOnMux ¶
SetupImagesEndpointOnMux configures a "/images" endpoint on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
func SetupServersEndpointOnMux ¶
SetupServersEndpointOnMux configures a "/datacenters/<id>/servers" endpoint on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
func SetupTestServerEndpointOnMux ¶
SetupTestServerEndpointOnMux configures "/datacenters/<dcid>/servers/<sid>/*" endpoints on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
func SetupTestVolumeEndpointOnMux ¶
SetupTestVolumeEndpointOnMux configures "/datacenters/<dcid>/volumes/<vid>" endpoints on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
func SetupVolumesEndpointOnMux ¶
SetupVolumesEndpointOnMux configures a "/datacenters/<id>/volumes" endpoint on the mux given.
PARAMETERS mux *http.ServeMux Mux to add handler to
Types ¶
type MockTestEnv ¶
MockTestEnv represents the test environment for testing IONOS API calls
func NewMockTestEnv ¶
func NewMockTestEnv() MockTestEnv
NewMockTestEnv generates a new, unconfigured test environment for testing purposes.
func (*MockTestEnv) Teardown ¶
func (env *MockTestEnv) Teardown()
Teardown shuts down the test environment server