testing

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const HypervisorGetBody = `` /* 1085-byte string literal not displayed */

HypervisorGetBody represents a raw hypervisor GET result with Pike+ release.

View Source
const HypervisorGetEmptyCPUInfoBody = `` /* 775-byte string literal not displayed */

HypervisorGetEmptyCPUInfoBody represents a raw hypervisor GET result with no cpu_info

View Source
const HypervisorListBody = `` /* 2340-byte string literal not displayed */

HypervisorListBody represents a raw hypervisor list result with Pike+ release.

View Source
const HypervisorListBodyPre253 = `` /* 2192-byte string literal not displayed */

HypervisorListBodyPre253 represents a raw hypervisor list from the Compute API with microversion older than 2.53. The first hypervisor represents what the specification says (~Newton) The second is exactly the same, but what you can get off a real system (~Kilo)

View Source
const HypervisorListWithParametersBody = `` /* 3030-byte string literal not displayed */

HypervisorListWithParametersBody represents a raw hypervisor list result with Pike+ release.

View Source
const HypervisorUptimeBody = `` /* 272-byte string literal not displayed */

HypervisorUptimeBody represents a raw hypervisor uptime request result with Pike+ release.

View Source
const HypervisorsStatisticsBody = `` /* 369-byte string literal not displayed */

Variables

View Source
var (
	HypervisorFakePre253 = hypervisors.Hypervisor{
		CPUInfo: hypervisors.CPUInfo{
			Arch:   "x86_64",
			Model:  "Nehalem",
			Vendor: "Intel",
			Features: []string{
				"pge",
				"clflush",
			},
			Topology: hypervisors.Topology{
				Cores:   1,
				Threads: 1,
				Sockets: 4,
			},
		},
		CurrentWorkload:    0,
		Status:             "enabled",
		State:              "up",
		DiskAvailableLeast: 0,
		HostIP:             "1.1.1.1",
		FreeDiskGB:         1028,
		FreeRamMB:          7680,
		HypervisorHostname: "fake-mini",
		HypervisorType:     "fake",
		HypervisorVersion:  2002000,
		ID:                 "1",
		LocalGB:            1028,
		LocalGBUsed:        0,
		MemoryMB:           8192,
		MemoryMBUsed:       512,
		RunningVMs:         0,
		Service: hypervisors.Service{
			Host:           "e6a37ee802d74863ab8b91ade8f12a67",
			ID:             "2",
			DisabledReason: "",
		},
		VCPUs:     1,
		VCPUsUsed: 0,
	}

	HypervisorFake = hypervisors.Hypervisor{
		CPUInfo: hypervisors.CPUInfo{
			Arch:   "x86_64",
			Model:  "Nehalem",
			Vendor: "Intel",
			Features: []string{
				"pge",
				"clflush",
			},
			Topology: hypervisors.Topology{
				Cores:   1,
				Threads: 1,
				Sockets: 4,
			},
		},
		CurrentWorkload:    0,
		Status:             "enabled",
		State:              "up",
		DiskAvailableLeast: 0,
		HostIP:             "1.1.1.1",
		FreeDiskGB:         1028,
		FreeRamMB:          7680,
		HypervisorHostname: "fake-mini",
		HypervisorType:     "fake",
		HypervisorVersion:  2002000,
		ID:                 "c48f6247-abe4-4a24-824e-ea39e108874f",
		LocalGB:            1028,
		LocalGBUsed:        0,
		MemoryMB:           8192,
		MemoryMBUsed:       512,
		RunningVMs:         0,
		Service: hypervisors.Service{
			Host:           "e6a37ee802d74863ab8b91ade8f12a67",
			ID:             "9c2566e7-7a54-4777-a1ae-c2662f0c407c",
			DisabledReason: "",
		},
		VCPUs:     1,
		VCPUsUsed: 0,
	}

	HypervisorFakeWithParameters = hypervisors.Hypervisor{
		CPUInfo: hypervisors.CPUInfo{
			Arch:   "x86_64",
			Model:  "Nehalem",
			Vendor: "Intel",
			Features: []string{
				"pge",
				"clflush",
			},
			Topology: hypervisors.Topology{
				Cores:   1,
				Threads: 1,
				Sockets: 4,
			},
		},
		CurrentWorkload:    0,
		Status:             "enabled",
		State:              "up",
		DiskAvailableLeast: 0,
		HostIP:             "1.1.1.1",
		FreeDiskGB:         1028,
		FreeRamMB:          7680,
		HypervisorHostname: "fake-mini",
		HypervisorType:     "fake",
		HypervisorVersion:  2002000,
		ID:                 "c48f6247-abe4-4a24-824e-ea39e108874f",
		LocalGB:            1028,
		LocalGBUsed:        0,
		MemoryMB:           8192,
		MemoryMBUsed:       512,
		RunningVMs:         0,
		Service: hypervisors.Service{
			Host:           "e6a37ee802d74863ab8b91ade8f12a67",
			ID:             "9c2566e7-7a54-4777-a1ae-c2662f0c407c",
			DisabledReason: "",
		},
		Servers: &[]hypervisors.Server{
			{
				Name: "instance-00000001",
				UUID: "c42acc8d-eab3-4e4d-9d90-01b0791328f4",
			},
			{
				Name: "instance-00000002",
				UUID: "8aaf2941-b774-41fc-921b-20c4757cc359",
			},
		},
		VCPUs:     1,
		VCPUsUsed: 0,
	}

	HypervisorEmptyCPUInfo = hypervisors.Hypervisor{
		CurrentWorkload:    0,
		Status:             "enabled",
		State:              "up",
		DiskAvailableLeast: 0,
		HostIP:             "1.1.1.1",
		FreeDiskGB:         1028,
		FreeRamMB:          7680,
		HypervisorHostname: "fake-mini",
		HypervisorType:     "fake",
		HypervisorVersion:  2002000,
		ID:                 "c48f6247-abe4-4a24-824e-ea39e108874f",
		LocalGB:            1028,
		LocalGBUsed:        0,
		MemoryMB:           8192,
		MemoryMBUsed:       512,
		RunningVMs:         0,
		Service: hypervisors.Service{
			Host:           "e6a37ee802d74863ab8b91ade8f12a67",
			ID:             "9c2566e7-7a54-4777-a1ae-c2662f0c407c",
			DisabledReason: "",
		},
		VCPUs:     1,
		VCPUsUsed: 0,
	}

	HypervisorsStatisticsExpected = hypervisors.Statistics{
		Count:              1,
		CurrentWorkload:    0,
		DiskAvailableLeast: 0,
		FreeDiskGB:         1028,
		FreeRamMB:          7680,
		LocalGB:            1028,
		LocalGBUsed:        0,
		MemoryMB:           8192,
		MemoryMBUsed:       512,
		RunningVMs:         0,
		VCPUs:              2,
		VCPUsUsed:          0,
	}

	HypervisorUptimeExpected = hypervisors.Uptime{
		HypervisorHostname: "fake-mini",
		ID:                 "c48f6247-abe4-4a24-824e-ea39e108874f",
		State:              "up",
		Status:             "enabled",
		Uptime:             " 08:32:11 up 93 days, 18:25, 12 users,  load average: 0.20, 0.12, 0.14",
	}
)

Functions

func HandleHypervisorGetEmptyCPUInfoSuccessfully

func HandleHypervisorGetEmptyCPUInfoSuccessfully(t *testing.T)

func HandleHypervisorGetSuccessfully

func HandleHypervisorGetSuccessfully(t *testing.T)

func HandleHypervisorListPre253Successfully

func HandleHypervisorListPre253Successfully(t *testing.T)

func HandleHypervisorListSuccessfully

func HandleHypervisorListSuccessfully(t *testing.T)

func HandleHypervisorListWithParametersSuccessfully

func HandleHypervisorListWithParametersSuccessfully(t *testing.T)

func HandleHypervisorUptimeSuccessfully

func HandleHypervisorUptimeSuccessfully(t *testing.T)

func HandleHypervisorsStatisticsSuccessfully

func HandleHypervisorsStatisticsSuccessfully(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