testing

package
v0.0.0-...-56e5f01 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

placement resource providers

Index

Constants

View Source
const AllocationsBody = `` /* 558-byte string literal not displayed */
View Source
const InventoriesBody = `` /* 683-byte string literal not displayed */
View Source
const ResourceProviderCreateBody = `` /* 344-byte string literal not displayed */
View Source
const ResourceProviderTestID = "99c09379-6e52-4ef8-9a95-b9ce6f68452e"
View Source
const ResourceProviderUpdateRequest = `
{
  "name": "new_name",
  "parent_provider_uuid": "b99b3ab4-3aa6-4fba-b827-69b88b9c544a"
}
`
View Source
const ResourceProviderUpdateResponse = `` /* 337-byte string literal not displayed */
View Source
const ResourceProvidersBody = `` /* 806-byte string literal not displayed */
View Source
const TraitsBody = `` /* 131-byte string literal not displayed */
View Source
const UsagesBody = `` /* 132-byte string literal not displayed */

Variables

View Source
var ExpectedAllocations = resourceproviders.ResourceProviderAllocations{
	ResourceProviderGeneration: 12,
	Allocations: map[string]resourceproviders.Allocation{
		"56785a3f-6f1c-4fec-af0b-0faf075b1fcb": {
			Resources: map[string]int{
				"MEMORY_MB": 256,
				"VCPU":      1,
			},
		},
		"9afd5aeb-d6b9-4dea-a588-1e6327a91834": {
			Resources: map[string]int{
				"MEMORY_MB": 512,
				"VCPU":      2,
			},
		},
		"9d16a611-e7f9-4ef3-be26-c61ed01ecefb": {
			Resources: map[string]int{
				"MEMORY_MB": 1024,
				"VCPU":      1,
			},
		},
	},
}
View Source
var ExpectedInventories = resourceproviders.ResourceProviderInventories{
	ResourceProviderGeneration: 7,
	Inventories: map[string]resourceproviders.Inventory{
		"DISK_GB": {
			AllocationRatio: 1.0,
			MaxUnit:         35,
			MinUnit:         1,
			Reserved:        0,
			StepSize:        1,
			Total:           35,
		},
		"MEMORY_MB": {
			AllocationRatio: 1.5,
			MaxUnit:         5825,
			MinUnit:         1,
			Reserved:        512,
			StepSize:        1,
			Total:           5825,
		},
		"VCPU": {
			AllocationRatio: 16.0,
			MaxUnit:         4,
			MinUnit:         1,
			Reserved:        0,
			StepSize:        1,
			Total:           4,
		},
	},
}
View Source
var ExpectedResourceProvider1 = resourceproviders.ResourceProvider{
	Generation: 1,
	UUID:       "99c09379-6e52-4ef8-9a95-b9ce6f68452e",
	Links: []resourceproviders.ResourceProviderLinks{
		{
			Href: "/resource_providers/99c09379-6e52-4ef8-9a95-b9ce6f68452e",
			Rel:  "self",
		},
	},
	Name:               "vgr.localdomain",
	ParentProviderUUID: "542df8ed-9be2-49b9-b4db-6d3183ff8ec8",
	RootProviderUUID:   "542df8ed-9be2-49b9-b4db-6d3183ff8ec8",
}
View Source
var ExpectedResourceProvider2 = resourceproviders.ResourceProvider{
	Generation: 2,
	UUID:       "d0b381e9-8761-42de-8e6c-bba99a96d5f5",
	Links: []resourceproviders.ResourceProviderLinks{
		{
			Href: "/resource_providers/d0b381e9-8761-42de-8e6c-bba99a96d5f5",
			Rel:  "self",
		},
	},
	Name:               "pony1",
	ParentProviderUUID: "",
	RootProviderUUID:   "d0b381e9-8761-42de-8e6c-bba99a96d5f5",
}
View Source
var ExpectedTraits = resourceproviders.ResourceProviderTraits{
	ResourceProviderGeneration: 1,
	Traits: []string{
		"CUSTOM_HW_FPGA_CLASS1",
		"CUSTOM_HW_FPGA_CLASS3",
	},
}
View Source
var ExpectedUsages = resourceproviders.ResourceProviderUsage{
	ResourceProviderGeneration: 1,
	Usages: map[string]int{
		"DISK_GB":   1,
		"MEMORY_MB": 512,
		"VCPU":      1,
	},
}

Functions

func HandleResourceProviderCreate

func HandleResourceProviderCreate(t *testing.T)

func HandleResourceProviderDelete

func HandleResourceProviderDelete(t *testing.T)

func HandleResourceProviderGet

func HandleResourceProviderGet(t *testing.T)

func HandleResourceProviderGetAllocations

func HandleResourceProviderGetAllocations(t *testing.T)

func HandleResourceProviderGetInventories

func HandleResourceProviderGetInventories(t *testing.T)

func HandleResourceProviderGetTraits

func HandleResourceProviderGetTraits(t *testing.T)

func HandleResourceProviderGetUsages

func HandleResourceProviderGetUsages(t *testing.T)

func HandleResourceProviderList

func HandleResourceProviderList(t *testing.T)

func HandleResourceProviderUpdate

func HandleResourceProviderUpdate(t *testing.T)

Types

This section is empty.

Jump to

Keyboard shortcuts

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