Documentation ¶
Overview ¶
Package ccrmdummy is for unit-tests that need to call ccrm APIs
Index ¶
- Variables
- type CCRMDummy
- func (d *CCRMDummy) ApplyCloudlet(in *edgeproto.Cloudlet, ...) error
- func (d *CCRMDummy) GRPCClient() (*grpc.ClientConn, error)
- func (d *CCRMDummy) GetFakePlatform(key *edgeproto.CloudletKey) (*fake.Platform, bool)
- func (d *CCRMDummy) GetFakePlatformResources(key *edgeproto.CloudletKey) (*fakecommon.Resources, bool)
- func (d *CCRMDummy) NewPlatform() platform.Platform
- func (d *CCRMDummy) RefreshCerts(ctx context.Context, in *edgeproto.Cloudlet) (*edgeproto.Result, error)
- func (d *CCRMDummy) SetFakePlatformFlavors(key *edgeproto.CloudletKey, flavors []*edgeproto.FlavorInfo) error
- func (d *CCRMDummy) SetPause(enable bool)
- func (d *CCRMDummy) SetSimulateAppCreateFailure(state bool)
- func (d *CCRMDummy) SetSimulateAppDeleteFailure(state bool)
- func (d *CCRMDummy) SetSimulateClusterCreateFailure(state bool)
- func (d *CCRMDummy) SetSimulateClusterDeleteFailure(state bool)
- func (d *CCRMDummy) Stop()
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 (*CCRMDummy) GetFakePlatformResources ¶
func (d *CCRMDummy) GetFakePlatformResources(key *edgeproto.CloudletKey) (*fakecommon.Resources, bool)
func (*CCRMDummy) NewPlatform ¶
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 ¶
SetPause blocks responder until unpaused. Warning: don't double-pause or double-unpause.
func (*CCRMDummy) SetSimulateAppCreateFailure ¶
func (*CCRMDummy) SetSimulateAppDeleteFailure ¶
func (*CCRMDummy) SetSimulateClusterCreateFailure ¶
func (*CCRMDummy) SetSimulateClusterDeleteFailure ¶
Click to show internal directories.
Click to hide internal directories.