ccrmdummy

package
v1.2.5 Latest Latest
Warning

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

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

Documentation

Overview

Package ccrmdummy is for unit-tests that need to call ccrm APIs

Index

Constants

This section is empty.

Variables

View Source
var UnitTestFlavors = []*edgeproto.FlavorInfo{{
	Name:  "flavor.tiny1",
	Vcpus: uint64(1),
	Ram:   uint64(512),
	Disk:  uint64(10),
}, {
	Name:  "flavor.tiny2",
	Vcpus: uint64(1),
	Ram:   uint64(1024),
	Disk:  uint64(10),
}, {
	Name:  "flavor.small",
	Vcpus: uint64(2),
	Ram:   uint64(1024),
	Disk:  uint64(20),
}, {
	Name:  "flavor.medium",
	Vcpus: uint64(4),
	Ram:   uint64(4096),
	Disk:  uint64(40),
}, {
	Name:  "flavor.lg-master",
	Vcpus: uint64(4),
	Ram:   uint64(8192),
	Disk:  uint64(60),
}, {

	Name:    "flavor.large",
	Vcpus:   uint64(10),
	Ram:     uint64(8192),
	Disk:    uint64(40),
	PropMap: map[string]string{"pci_passthrough": "alias=t4:1"},
}, {
	Name:    "flavor.large2",
	Vcpus:   uint64(10),
	Ram:     uint64(8192),
	Disk:    uint64(40),
	PropMap: map[string]string{"pci_passthrough": "alias=t4:1", "nas": "ceph-20:1"},
}, {
	Name:    "flavor.large-pci",
	Vcpus:   uint64(10),
	Ram:     uint64(8192),
	Disk:    uint64(40),
	PropMap: map[string]string{"pci": "NP4:1"},
}, {
	Name:    "flavor.large-nvidia",
	Vcpus:   uint64(10),
	Ram:     uint64(8192),
	Disk:    uint64(40),
	PropMap: map[string]string{"vgpu": "nvidia-63:1"},
}, {
	Name:    "flavor.large-generic-gpu",
	Vcpus:   uint64(10),
	Ram:     uint64(8192),
	Disk:    uint64(80),
	PropMap: map[string]string{"vmware": "vgpu=1"},
}, {

	Name:    "flavor.m4.large-gpu",
	Vcpus:   uint64(12),
	Ram:     uint64(4096),
	Disk:    uint64(20),
	PropMap: map[string]string{"pci_passthrough": "alias=t4gpu:1"},
}, {
	Name:    "flavor.m4.large-vgpu",
	Vcpus:   uint64(12),
	Ram:     uint64(4096),
	Disk:    uint64(20),
	PropMap: map[string]string{"resources": "VGPU=1"},
}}

Functions

This section is empty.

Types

type CCRMDummy

type CCRMDummy struct {
	ccrm.CCRMHandler
	// contains filtered or unexported fields
}

func StartDummyCCRM

func StartDummyCCRM(ctx context.Context, vaultConfig *vault.Config, kvstore objstore.KVStore) *CCRMDummy

StartDummyCCRM starts an in-memory CCRM using grpc.bufconn. It uses the real CCRM handler code with a fake platform. Make sure to call Stop() when done to clean up the server. A client can be created via GRPCClient().

func (*CCRMDummy) ApplyCloudlet

func (*CCRMDummy) GRPCClient

func (d *CCRMDummy) GRPCClient() (*grpc.ClientConn, error)

func (*CCRMDummy) GetFakePlatform

func (d *CCRMDummy) GetFakePlatform(key *edgeproto.CloudletKey) (*fake.Platform, bool)

func (*CCRMDummy) GetFakePlatformResources

func (d *CCRMDummy) GetFakePlatformResources(key *edgeproto.CloudletKey) (*fakecommon.Resources, bool)

func (*CCRMDummy) NewPlatform

func (d *CCRMDummy) NewPlatform() platform.Platform

func (*CCRMDummy) RefreshCerts

func (d *CCRMDummy) RefreshCerts(ctx context.Context, in *edgeproto.Cloudlet) (*edgeproto.Result, error)

RefreshCerts override real CCRM handler because it doesn't feed into a fake platform call, it goes a real certs function.

func (*CCRMDummy) SetFakePlatformFlavors

func (d *CCRMDummy) SetFakePlatformFlavors(key *edgeproto.CloudletKey, flavors []*edgeproto.FlavorInfo) error

func (*CCRMDummy) SetPause

func (d *CCRMDummy) SetPause(enable bool)

SetPause blocks responder until unpaused. Warning: don't double-pause or double-unpause.

func (*CCRMDummy) SetSimulateAppCreateFailure

func (d *CCRMDummy) SetSimulateAppCreateFailure(state bool)

func (*CCRMDummy) SetSimulateAppDeleteFailure

func (d *CCRMDummy) SetSimulateAppDeleteFailure(state bool)

func (*CCRMDummy) SetSimulateClusterCreateFailure

func (d *CCRMDummy) SetSimulateClusterCreateFailure(state bool)

func (*CCRMDummy) SetSimulateClusterDeleteFailure

func (d *CCRMDummy) SetSimulateClusterDeleteFailure(state bool)

func (*CCRMDummy) Stop

func (d *CCRMDummy) Stop()

Jump to

Keyboard shortcuts

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