apiserverk8s.io/apiserver/pkg/storage/testing Index | Files

package testing

import "k8s.io/apiserver/pkg/storage/testing"

Index

Functions

func CreateList

func CreateList(prefix string, helper storage.Interface, list runtime.Object) error

CreateList will properly create a list using the storage interface.

func CreateObj

func CreateObj(helper storage.Interface, name string, obj, out runtime.Object, ttl uint64) error

CreateObj will create a single object using the storage interface.

func CreateObjList

func CreateObjList(prefix string, helper storage.Interface, items []runtime.Object) error

CreateObjList will create a list from the array of objects.

func DeepEqualSafePodSpec

func DeepEqualSafePodSpec() example.PodSpec

DeepEqualSafePodSpec returns an example.PodSpec safe for deep-equal operations.

func EncodeContinueOrDie

func EncodeContinueOrDie(key string, resourceVersion int64) string

func ExpectNoDiff

func ExpectNoDiff(t *testing.T, msg string, expected, got interface{})

func ResourceVersionNotOlderThan

func ResourceVersionNotOlderThan(sentinel string) func(string) error

ResourceVersionNotOlderThan returns a function to validate resource versions. Resource versions referring to points in logical time before the sentinel generate an error. All logical times as new as the sentinel or newer generate no error.

func RunTestConditionalDelete

func RunTestConditionalDelete(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestCount

func RunTestCount(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestCreate

func RunTestCreate(ctx context.Context, t *testing.T, store storage.Interface, validation KeyValidation)

func RunTestCreateWithKeyExist

func RunTestCreateWithKeyExist(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestCreateWithTTL

func RunTestCreateWithTTL(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestDeleteTriggerWatch

func RunTestDeleteTriggerWatch(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestDeleteWithSuggestion

func RunTestDeleteWithSuggestion(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestDeleteWithSuggestionAndConflict

func RunTestDeleteWithSuggestionAndConflict(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestDeleteWithSuggestionOfDeletedObject

func RunTestDeleteWithSuggestionOfDeletedObject(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestGet

func RunTestGet(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestGetListNonRecursive

func RunTestGetListNonRecursive(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestGuaranteedUpdateWithConflict

func RunTestGuaranteedUpdateWithConflict(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestGuaranteedUpdateWithSuggestionAndConflict

func RunTestGuaranteedUpdateWithSuggestionAndConflict(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestGuaranteedUpdateWithTTL

func RunTestGuaranteedUpdateWithTTL(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestList

func RunTestList(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestListWithoutPaging

func RunTestListWithoutPaging(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestPreconditionalDeleteWithSuggestion

func RunTestPreconditionalDeleteWithSuggestion(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestUnconditionalDelete

func RunTestUnconditionalDelete(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestValidateDeletionWithSuggestion

func RunTestValidateDeletionWithSuggestion(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestWatch

func RunTestWatch(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestWatchContextCancel

func RunTestWatchContextCancel(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestWatchFromNoneZero

func RunTestWatchFromNoneZero(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestWatchInitializationSignal

func RunTestWatchInitializationSignal(ctx context.Context, t *testing.T, store storage.Interface)

func TestCheckEventType

func TestCheckEventType(t *testing.T, expectEventType watch.EventType, w watch.Interface)

func TestCheckResult

func TestCheckResult(t *testing.T, expectEventType watch.EventType, w watch.Interface, expectObj *example.Pod)

func TestCheckResultFunc

func TestCheckResultFunc(t *testing.T, expectEventType watch.EventType, w watch.Interface, check func(object runtime.Object) error)

func TestCheckStop

func TestCheckStop(t *testing.T, w watch.Interface)

func TestPropogateStore

func TestPropogateStore(ctx context.Context, t *testing.T, store storage.Interface, obj *example.Pod) (string, *example.Pod)

TestPropogateStore helps propagates store with objects, automates key generation, and returns keys and stored objects.

func TestPropogateStoreWithKey

func TestPropogateStoreWithKey(ctx context.Context, t *testing.T, store storage.Interface, key string, obj *example.Pod) *example.Pod

TestPropogateStoreWithKey helps propagate store with objects, the given object will be stored at the specified key.

Types

type KeyValidation

type KeyValidation func(ctx context.Context, t *testing.T, key string)

Source Files

store_tests.go utils.go watcher_tests.go

Version
v0.25.14
Published
Sep 13, 2023
Platform
js/wasm
Imports
26 packages
Last checked
30 minutes ago

Tools for package owners.