framework

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package framework is a package helping setting up end-to-end testing across a Kubernetes cluster.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FleetReadyCount added in v0.5.0

func FleetReadyCount(amount int32) func(fleet *v1alpha1.Fleet) bool

FleetReadyCount returns the ready count in a fleet

func PingGameServer

func PingGameServer(msg, address string) (reply string, err error)

PingGameServer pings a gameserver and returns its reply

Types

type Framework

type Framework struct {
	KubeClient      kubernetes.Interface
	AgonesClient    versioned.Interface
	GameServerImage string
	PullSecret      string
}

Framework is a testing framework

func New

func New(kubeconfig, gsimage string, pullSecret string) (*Framework, error)

New setups a testing framework using a kubeconfig path and the game server image to use for testing.

func (*Framework) CleanUp

func (f *Framework) CleanUp(ns string) error

CleanUp Delete all Agones resources in a given namespace

func (*Framework) CreateGameServerAndWaitUntilReady

func (f *Framework) CreateGameServerAndWaitUntilReady(ns string, gs *v1alpha1.GameServer) (*v1alpha1.GameServer, error)

CreateGameServerAndWaitUntilReady Creates a GameServer and wait for its state to become ready.

func (*Framework) ListGameServersFromFleet added in v0.5.0

func (f *Framework) ListGameServersFromFleet(flt *v1alpha1.Fleet) ([]v1alpha1.GameServer, error)

ListGameServersFromFleet lists GameServers from a particular fleet

func (*Framework) WaitForFleetCondition added in v0.5.0

func (f *Framework) WaitForFleetCondition(flt *v1alpha1.Fleet, condition func(fleet *v1alpha1.Fleet) bool) error

WaitForFleetCondition waits for the Fleet to be in a specific condition

func (*Framework) WaitForFleetGameServersCondition added in v0.5.0

func (f *Framework) WaitForFleetGameServersCondition(flt *v1alpha1.Fleet, cond func(server v1alpha1.GameServer) bool) error

WaitForFleetGameServersCondition wait for all GameServers for a given fleet to match the spec.replicas and match a a condition

func (*Framework) WaitForGameServerState

func (f *Framework) WaitForGameServerState(gs *v1alpha1.GameServer, state v1alpha1.State,
	timeout time.Duration) (*v1alpha1.GameServer, error)

WaitForGameServerState Waits untils the gameserver reach a given state before the timeout expires

Jump to

Keyboard shortcuts

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