dra

package
v1.26.15 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

README

Overview

The tests in this directory cover dynamic resource allocation support in Kubernetes. They do not test the correct behavior of arbitrary dynamic resource allocation drivers.

If such a driver is needed, then the in-tree test/e2e/dra/test-driver is used, with a slight twist: instead of deploying that driver directly in the cluster, the necessary sockets for interaction with kubelet (registration and dynamic resource allocation) get proxied into the e2e.test binary. This reuses the work done for CSI mock testing. The advantage is that no separate images are needed for the test driver and that the e2e test has full control over all gRPC calls, in case that it needs that for operations like error injection or checking calls.

Cluster setup

The container runtime must support CDI. The latest cri-o releases contain support, containerd 1.6.x does not. To bring up a kind cluster with containerd built from their main branch, use:

test/e2e/dra/kind-build-image.sh dra/node:latest && \
kind create cluster --config test/e2e/dra/kind.yaml --image dra/node:latest

Documentation

Index

Constants

View Source
const (
	NodePrepareResourceMethod   = "/v1alpha1.Node/NodePrepareResource"
	NodeUnprepareResourceMethod = "/v1alpha1.Node/NodeUnprepareResource"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	NameSuffix string
	Controller *app.ExampleController
	Name       string
	Nodes      map[string]*app.ExamplePlugin
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(f *framework.Framework, nodes *Nodes, configureResources func() app.Resources) *Driver

NewDriver sets up controller (as client of the cluster) and kubelet plugin (via proxy) before the test runs. It cleans up after the test.

func (*Driver) CallCount

func (d *Driver) CallCount(m MethodInstance) int64

func (*Driver) Fail

func (d *Driver) Fail(m MethodInstance, injectError bool)

func (*Driver) Nodenames

func (d *Driver) Nodenames() (nodenames []string)

func (*Driver) SetUp

func (d *Driver) SetUp(nodes *Nodes, resources app.Resources)

func (*Driver) TearDown

func (d *Driver) TearDown()

type MethodInstance

type MethodInstance struct {
	Nodename   string
	FullMethod string
}

type Nodes

type Nodes struct {
	NodeNames []string
}

func NewNodes

func NewNodes(f *framework.Framework, minNodes, maxNodes int) *Nodes

NewNodes selects nodes to run the test on.

Directories

Path Synopsis
app
Package app does all of the work necessary to configure and run a Kubernetes app process.
Package app does all of the work necessary to configure and run a Kubernetes app process.

Jump to

Keyboard shortcuts

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