e2e

package
v0.0.0-...-9e48b22 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const ExecutionTimeout = 5 * time.Minute
View Source
const Poll = 2 * time.Second
View Source
const TestPath = "/kubegene"
View Source
const VolumeTimeout = 2 * time.Minute

Variables

View Source
var GOPATH = os.Getenv("GOPATH")
View Source
var ToolRepo = filepath.Join(GOPATH, "src/kubegene.io/kubegene/example/tools")

Functions

func CreateClusterRole

func CreateClusterRole(kubeClient kubernetes.Interface, relativePath string) error

func CreateClusterRoleBinding

func CreateClusterRoleBinding(kubeClient kubernetes.Interface, ns, relativePath string) error

func CreateDeployment

func CreateDeployment(kubeClient kubernetes.Interface, ns, image, relativePath string) error

func CreateServiceAccount

func CreateServiceAccount(kubeClient kubernetes.Interface, namespace string, relativePath string) error

func DeleteClusterRole

func DeleteClusterRole(kubeClient kubernetes.Interface, relativePath string) error

func DeleteClusterRoleBinding

func DeleteClusterRoleBinding(kubeClient kubernetes.Interface, relativePath string) error

func DeleteDeployment

func DeleteDeployment(kubeClient kubernetes.Interface, ns, relativePath string) error

func DeleteServiceAccount

func DeleteServiceAccount(kubeClient kubernetes.Interface, namespace string, relativePath string) error

func DeploymentComplete

func DeploymentComplete(deployment *apps.Deployment, newStatus *apps.DeploymentStatus) bool

func DescribeGene

func DescribeGene(text string, body func(*GeneTestContext)) bool

DescribeGene must be used instead of the usual Ginkgo Describe to register a test block. The difference is that the body function will be called multiple times with the right context (when setting up a Ginkgo suite or a testing.T test, with the right configuration).

func GenectlCmd

func GenectlCmd(args ...string) *exec.Cmd

GenectlCmd runs the genectl executable through the wrapper script.

func NewGenectlCommand

func NewGenectlCommand(args ...string) *genectlWrapper

func ReadResult

func ReadResult(fileName string) (string, error)

func ReadResultFrom

func ReadResultFrom(fullpath string) (string, error)

func Test

func Test(t *testing.T, config *Config)

func WaitForExecutionSuccess

func WaitForExecutionSuccess(client execclientset.Interface, name, ns string) error

func WaitForPersistentVolumeBound

func WaitForPersistentVolumeBound(c kubernetes.Interface, pvName string) error

func WaitForPersistentVolumeClaimBound

func WaitForPersistentVolumeClaimBound(c kubernetes.Interface, ns string, pvcName string) error

Types

type Config

type Config struct {
	KubeConfig   string
	KubeDagImage string
	Namespace    string
	GenectlPath  string
}

Config provides the configuration for the e2e tests.

type GeneTestContext

type GeneTestContext struct {
	Config     *Config
	KubeClient kubernetes.Interface
	GeneClient execclientset.Interface
}

GeneTestContext holds the variables that each test can depend on. It gets initialized before each test block runs.

Jump to

Keyboard shortcuts

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