Documentation
¶
Overview ¶
nodes unit tests
Index ¶
- Constants
- Variables
- func HandleChangePowerStateSuccessfully(t *testing.T)
- func HandleChangePowerStateWithConflict(t *testing.T)
- func HandleGetBootDeviceSuccessfully(t *testing.T)
- func HandleGetSupportedBootDeviceSuccessfully(t *testing.T)
- func HandleInjectNMISuccessfully(t *testing.T)
- func HandleNodeChangeProvisionStateActive(t *testing.T)
- func HandleNodeChangeProvisionStateActiveWithSteps(t *testing.T)
- func HandleNodeChangeProvisionStateClean(t *testing.T)
- func HandleNodeChangeProvisionStateCleanWithConflict(t *testing.T)
- func HandleNodeChangeProvisionStateConfigDrive(t *testing.T)
- func HandleNodeCreationSuccessfully(t *testing.T, response string)
- func HandleNodeDeletionSuccessfully(t *testing.T)
- func HandleNodeGetSuccessfully(t *testing.T)
- func HandleNodeListDetailSuccessfully(t *testing.T)
- func HandleNodeListSuccessfully(t *testing.T)
- func HandleNodeUpdateSuccessfully(t *testing.T, response string)
- func HandleNodeValidateSuccessfully(t *testing.T)
- func HandleSetBootDeviceSuccessfully(t *testing.T)
- func HandleSetRAIDConfig(t *testing.T)
- func HandleSetRAIDConfigMaxSize(t *testing.T)
Constants ¶
const NodeBootDeviceBody = `
{
"boot_device":"pxe",
"persistent":false
}
`
const NodeListBody = `` /* 1414-byte string literal not displayed */
NodeListBody contains the canned body of a nodes.List response, without detail.
const NodeListDetailBody = `` /* 9549-byte string literal not displayed */
NodeListDetailBody contains the canned body of a nodes.ListDetail response.
const NodeProvisionStateActiveBody = `
{
"target": "active",
"configdrive": "http://127.0.0.1/images/test-node-config-drive.iso.gz"
}
`
const NodeProvisionStateActiveBodyWithSteps = `` /* 177-byte string literal not displayed */
const NodeProvisionStateCleanBody = `` /* 218-byte string literal not displayed */
const NodeProvisionStateConfigDriveBody = `` /* 224-byte string literal not displayed */
const NodeSupportedBootDeviceBody = `
{
"supported_boot_devices": [
"pxe",
"disk"
]
}
`
const NodeValidationBody = `` /* 1414-byte string literal not displayed */
const SingleNodeBody = `` /* 2962-byte string literal not displayed */
SingleNodeBody is the canned body of a Get request on an existing node.
Variables ¶
var ( NodeFoo = nodes.Node{ UUID: "d2630783-6ec8-4836-b556-ab427c4b581e", Name: "foo", PowerState: "", TargetPowerState: "", ProvisionState: "enroll", TargetProvisionState: "", Maintenance: false, MaintenanceReason: "", Fault: "", LastError: "", Reservation: "", Driver: "ipmi", DriverInfo: map[string]interface{}{ "ipmi_port": "6230", "ipmi_username": "admin", "deploy_kernel": "http://172.22.0.1/images/tinyipa-stable-rocky.vmlinuz", "ipmi_address": "192.168.122.1", "deploy_ramdisk": "http://172.22.0.1/images/tinyipa-stable-rocky.gz", "ipmi_password": "admin", }, DriverInternalInfo: map[string]interface{}{}, Properties: map[string]interface{}{}, InstanceInfo: map[string]interface{}{}, InstanceUUID: "", ChassisUUID: "", Extra: map[string]interface{}{}, ConsoleEnabled: false, RAIDConfig: map[string]interface{}{}, TargetRAIDConfig: map[string]interface{}{}, CleanStep: map[string]interface{}{}, DeployStep: map[string]interface{}{}, ResourceClass: "", BootInterface: "pxe", ConsoleInterface: "no-console", DeployInterface: "iscsi", InspectInterface: "no-inspect", ManagementInterface: "ipmitool", NetworkInterface: "flat", PowerInterface: "ipmitool", RAIDInterface: "no-raid", RescueInterface: "no-rescue", StorageInterface: "noop", Traits: []string{}, VendorInterface: "ipmitool", ConductorGroup: "", Protected: false, ProtectedReason: "", } NodeFooValidation = nodes.NodeValidation{ Boot: nodes.DriverValidation{ Result: false, Reason: "Cannot validate image information for node a62b8495-52e2-407b-b3cb-62775d04c2b8 because one or more parameters are missing from its instance_info and insufficent information is present to boot from a remote volume. Missing are: ['ramdisk', 'kernel', 'image_source']", }, Console: nodes.DriverValidation{ Result: false, Reason: "Driver ipmi does not support console (disabled or not implemented).", }, Deploy: nodes.DriverValidation{ Result: false, Reason: "Cannot validate image information for node a62b8495-52e2-407b-b3cb-62775d04c2b8 because one or more parameters are missing from its instance_info and insufficent information is present to boot from a remote volume. Missing are: ['ramdisk', 'kernel', 'image_source']", }, Inspect: nodes.DriverValidation{ Result: false, Reason: "Driver ipmi does not support inspect (disabled or not implemented).", }, Management: nodes.DriverValidation{ Result: true, }, Network: nodes.DriverValidation{ Result: true, }, Power: nodes.DriverValidation{ Result: true, }, RAID: nodes.DriverValidation{ Result: false, Reason: "Driver ipmi does not support raid (disabled or not implemented).", }, Rescue: nodes.DriverValidation{ Result: false, Reason: "Driver ipmi does not support rescue (disabled or not implemented).", }, Storage: nodes.DriverValidation{ Result: true, }, } NodeBootDevice = nodes.BootDeviceOpts{ BootDevice: "pxe", Persistent: false, } NodeSupportedBootDevice = []string{ "pxe", "disk", } NodeBar = nodes.Node{ UUID: "08c84581-58f5-4ea2-a0c6-dd2e5d2b3662", Name: "bar", PowerState: "", TargetPowerState: "", ProvisionState: "enroll", TargetProvisionState: "", Maintenance: false, MaintenanceReason: "", Fault: "", LastError: "", Reservation: "", Driver: "ipmi", DriverInfo: map[string]interface{}{}, DriverInternalInfo: map[string]interface{}{}, Properties: map[string]interface{}{}, InstanceInfo: map[string]interface{}{}, InstanceUUID: "", ChassisUUID: "", Extra: map[string]interface{}{}, ConsoleEnabled: false, RAIDConfig: map[string]interface{}{}, TargetRAIDConfig: map[string]interface{}{}, CleanStep: map[string]interface{}{}, DeployStep: map[string]interface{}{}, ResourceClass: "", BootInterface: "pxe", ConsoleInterface: "no-console", DeployInterface: "iscsi", InspectInterface: "no-inspect", ManagementInterface: "ipmitool", NetworkInterface: "flat", PowerInterface: "ipmitool", RAIDInterface: "no-raid", RescueInterface: "no-rescue", StorageInterface: "noop", Traits: []string{}, VendorInterface: "ipmitool", ConductorGroup: "", Protected: false, ProtectedReason: "", } NodeBaz = nodes.Node{ UUID: "c9afd385-5d89-4ecb-9e1c-68194da6b474", Name: "baz", PowerState: "", TargetPowerState: "", ProvisionState: "enroll", TargetProvisionState: "", Maintenance: false, MaintenanceReason: "", Fault: "", LastError: "", Reservation: "", Driver: "ipmi", DriverInfo: map[string]interface{}{}, DriverInternalInfo: map[string]interface{}{}, Properties: map[string]interface{}{}, InstanceInfo: map[string]interface{}{}, InstanceUUID: "", ChassisUUID: "", Extra: map[string]interface{}{}, ConsoleEnabled: false, RAIDConfig: map[string]interface{}{}, TargetRAIDConfig: map[string]interface{}{}, CleanStep: map[string]interface{}{}, DeployStep: map[string]interface{}{}, ResourceClass: "", BootInterface: "pxe", ConsoleInterface: "no-console", DeployInterface: "iscsi", InspectInterface: "no-inspect", ManagementInterface: "ipmitool", NetworkInterface: "flat", PowerInterface: "ipmitool", RAIDInterface: "no-raid", RescueInterface: "no-rescue", StorageInterface: "noop", Traits: []string{}, VendorInterface: "ipmitool", ConductorGroup: "", Protected: false, ProtectedReason: "", } ConfigDriveMap = nodes.ConfigDrive{ UserData: map[string]interface{}{ "ignition": map[string]string{ "version": "2.2.0", }, "systemd": map[string]interface{}{ "units": []map[string]interface{}{{ "name": "example.service", "enabled": true, }, }, }, }, } )
Functions ¶
func HandleChangePowerStateSuccessfully ¶
HandleChangePowerStateSuccessfully sets up the test server to respond to a change power state request for a node
func HandleChangePowerStateWithConflict ¶
HandleChangePowerStateWithConflict sets up the test server to respond to a change power state request for a node with a 409 error
func HandleGetBootDeviceSuccessfully ¶
HandleGetBootDeviceSuccessfully sets up the test server to respond to a get boot device request for a node
func HandleGetSupportedBootDeviceSuccessfully ¶
HandleGetBootDeviceSuccessfully sets up the test server to respond to a get boot device request for a node
func HandleInjectNMISuccessfully ¶
HandleInjectNMISuccessfully sets up the test server to respond to a node InjectNMI request
func HandleNodeChangeProvisionStateActiveWithSteps ¶ added in v0.16.0
func HandleNodeCreationSuccessfully ¶
HandleServerCreationSuccessfully sets up the test server to respond to a server creation request with a given response.
func HandleNodeDeletionSuccessfully ¶
HandleNodeDeletionSuccessfully sets up the test server to respond to a server deletion request.
func HandleNodeListDetailSuccessfully ¶
HandleNodeListSuccessfully sets up the test server to respond to a server List request.
func HandleNodeListSuccessfully ¶
HandleNodeListSuccessfully sets up the test server to respond to a server List request.
func HandleSetBootDeviceSuccessfully ¶
HandleSetBootDeviceSuccessfully sets up the test server to respond to a set boot device request for a node
func HandleSetRAIDConfig ¶
Types ¶
This section is empty.