testing

package
Version: v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BasicListOutput = `
{
    "resource_types": [
		"OS::Nova::Server",
		"OS::Heat::Stack"
    ]
}
`
View Source
const FilteredListOutput = `` /* 136-byte string literal not displayed */
View Source
const FullListOutput = `` /* 240-byte string literal not displayed */
View Source
const GenerateTemplateOutput = `` /* 517-byte string literal not displayed */
View Source
const GetSchemaOutput = `` /* 3058-byte string literal not displayed */

Variables

View Source
var BasicListExpected = []resourcetypes.ResourceTypeSummary{
	resourcetypes.ResourceTypeSummary{
		ResourceType: "OS::Nova::Server",
	},
	resourcetypes.ResourceTypeSummary{
		ResourceType: "OS::Heat::Stack",
	},
}
View Source
var FilteredListExpected = []resourcetypes.ResourceTypeSummary{
	resourcetypes.ResourceTypeSummary{
		ResourceType: "OS::Heat::Stack",
		Description:  "A Heat Stack",
	},
}
View Source
var FullListExpected = []resourcetypes.ResourceTypeSummary{
	resourcetypes.ResourceTypeSummary{
		ResourceType: "OS::Nova::Server",
		Description:  "A Nova Server",
	},
	resourcetypes.ResourceTypeSummary{
		ResourceType: "OS::Heat::Stack",
		Description:  "A Heat Stack",
	},
}
View Source
var GetSchemaExpected = resourcetypes.ResourceSchema{
	ResourceType: "OS::Test::TestServer",
	SupportStatus: resourcetypes.SupportStatusDetails{
		Status:  resourcetypes.SupportStatusDeprecated,
		Message: "Bye bye.",
		Version: "10.0.0",
		PreviousStatus: &resourcetypes.SupportStatusDetails{
			Status: resourcetypes.SupportStatusSupported,
		},
	},
	Attributes: map[string]resourcetypes.AttributeSchema{
		"show": resourcetypes.AttributeSchema{
			Description: "Detailed information about resource.",
			Type:        resourcetypes.MapProperty,
		},
		"tags": resourcetypes.AttributeSchema{
			Description: "Tags from the server.",
			Type:        resourcetypes.ListProperty,
		},
		"name": resourcetypes.AttributeSchema{
			Description: "Name of the server.",
			Type:        resourcetypes.StringProperty,
		},
	},
	Properties: map[string]resourcetypes.PropertySchema{
		"name": resourcetypes.PropertySchema{
			Type:          resourcetypes.StringProperty,
			Description:   "Server name.",
			UpdateAllowed: true,
		},
		"image": resourcetypes.PropertySchema{
			Type:        resourcetypes.StringProperty,
			Description: "The ID or name of the image to boot with.",
			Required:    true,
			Constraints: []resourcetypes.ConstraintSchema{
				resourcetypes.ConstraintSchema{
					CustomConstraint: &glanceImageConstraint,
				},
			},
		},
		"block_device_mapping": resourcetypes.PropertySchema{
			Type:        resourcetypes.ListProperty,
			Description: "Block device mappings for this server.",
			Schema: map[string]resourcetypes.PropertySchema{
				"*": resourcetypes.PropertySchema{
					Type: resourcetypes.MapProperty,
					Schema: map[string]resourcetypes.PropertySchema{
						"ephemeral_format": resourcetypes.PropertySchema{
							Type:        resourcetypes.StringProperty,
							Description: "The format of the local ephemeral block device.",
							Constraints: []resourcetypes.ConstraintSchema{
								resourcetypes.ConstraintSchema{
									AllowedValues: &[]interface{}{
										"ext3", "ext4", "xfs",
									},
								},
							},
						},
						"ephemeral_size": resourcetypes.PropertySchema{
							Type:        resourcetypes.IntegerProperty,
							Description: "The size of the local ephemeral block device, in GB.",
							Constraints: []resourcetypes.ConstraintSchema{
								resourcetypes.ConstraintSchema{
									Range: &resourcetypes.MinMaxConstraint{
										Min: 1,
									},
								},
							},
						},
						"delete_on_termination": resourcetypes.PropertySchema{
							Type:        resourcetypes.BooleanProperty,
							Description: "Delete volume on server termination.",
							Default:     true,
							Immutable:   true,
						},
					},
				},
			},
		},
		"image_update_policy": resourcetypes.PropertySchema{
			Type:        resourcetypes.StringProperty,
			Description: "Policy on how to apply an image-id update.",
			Default:     "REBUILD",
			Constraints: []resourcetypes.ConstraintSchema{
				resourcetypes.ConstraintSchema{
					AllowedValues: &[]interface{}{
						"REBUILD", "REPLACE",
					},
				},
			},
			UpdateAllowed: true,
		},
	},
}

Functions

func HandleGenerateTemplateSuccessfully

func HandleGenerateTemplateSuccessfully(t *testing.T)

HandleGenerateTemplateSuccessfully creates an HTTP handler at `/resource_types/OS::Heat::None/template` on the test handler mux that responds with a template.

func HandleGetSchemaSuccessfully

func HandleGetSchemaSuccessfully(t *testing.T)

HandleGetSchemaSuccessfully creates an HTTP handler at `/resource_types/OS::Test::TestServer` on the test handler mux that responds with a `GetSchema` response.

func HandleListSuccessfully

func HandleListSuccessfully(t *testing.T)

HandleListSuccessfully creates an HTTP handler at `/resource_types` on the test handler mux that responds with a `List` response.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL