istio: istio.io/istio/tests/e2e/framework Index | Files

package framework

import "istio.io/istio/tests/e2e/framework"

Index

Package Files

app_manager.go framework.go istioctl.go kubernetes.go mason.go multicluster.go raw_vm.go testInfo.go test_flags.go

Constants

const (

    // PrimaryCluster identifies the primary cluster
    PrimaryCluster = "primary"
    // RemoteCluster identifies the remote cluster
    RemoteCluster = "remote"
)

Variables

var (

    // TestVM is true if in this test run user wants to test VM on istio
    TestVM = flag.Bool("test_vm", false, "whether to test VM on istio")
)

func InitLogging Uses

func InitLogging() error

InitLogging sets the logging directory. Should be called right after flag.Parse().

type App Uses

type App struct {
    AppYamlTemplate string
    AppYaml         string
    KubeInject      bool
    Template        interface{}
    // contains filtered or unexported fields
}

App gathers information for Hop app

type AppManager Uses

type AppManager struct {
    Apps []*App

    Kubeconfig string
    // contains filtered or unexported fields
}

AppManager organize and deploy apps

func NewAppManager Uses

func NewAppManager(tmpDir, namespace string, istioctl *Istioctl, kubeconfig string, checkDeployments bool) *AppManager

NewAppManager create a new AppManager

func (*AppManager) AddApp Uses

func (am *AppManager) AddApp(a *App)

AddApp for automated deployment. Must be done before Setup call.

func (*AppManager) CheckDeployments Uses

func (am *AppManager) CheckDeployments() error

CheckDeployments waits for a period for the deployments to be started.

func (*AppManager) DeployApp Uses

func (am *AppManager) DeployApp(a *App) error

DeployApp adds the app and deploys it to the system. Must be called after Setup call.

func (*AppManager) Setup Uses

func (am *AppManager) Setup() error

Setup deploy apps

func (*AppManager) Teardown Uses

func (am *AppManager) Teardown() error

Teardown currently does nothing, only to satisfied cleanable{}

func (*AppManager) UndeployApp Uses

func (am *AppManager) UndeployApp(a *App) error

UndeployApp deletes the app from the system. Must be called after Setup call.

type Cleanable Uses

type Cleanable interface {
    Setup() error
    Teardown() error
}

Cleanable interfaces that need to be registered to CommonConfig

type CommonConfig Uses

type CommonConfig struct {
    // Test Cleanup registration
    Cleanup *testCleanup
    // Test Information
    Info *testInfo
    // Kubernetes and istio installation information
    Kube *KubeInfo
}

CommonConfig regroup all common test configuration.

func NewCommonConfig Uses

func NewCommonConfig(testID string) (*CommonConfig, error)

NewCommonConfig creates a full config with the local head version.

func NewCommonConfigWithVersion Uses

func NewCommonConfigWithVersion(testID, version string) (*CommonConfig, error)

NewCommonConfigWithVersion creates a new CommonConfig with the specified version of Istio. If baseVersion is empty, it will use the local head version.

func (*CommonConfig) RunTest Uses

func (c *CommonConfig) RunTest(m runnable) int

RunTest sets up all registered cleanables in FIFO order Execute the runnable Call teardown on all the cleanables in LIFO order.

type GCPRawVM Uses

type GCPRawVM struct {
    Name        string
    ClusterName string
    Namespace   string
    ProjectID   string
    Zone        string
    // Use Mason does not require provisioning, and therefore all following fields are not required
    UseMason bool
    // ServiceAccount must have iam.serviceAccountActor or owner permissions
    // to the project. Use IAM settings.
    ServiceAccount string
    Image          string
    ImageProject   string
}

GCPRawVM is hosted on Google Cloud Platform

func NewGCPRawVM Uses

func NewGCPRawVM(namespace string) (*GCPRawVM, error)

NewGCPRawVM creates a new vm on GCP

func (*GCPRawVM) GetExternalIP Uses

func (vm *GCPRawVM) GetExternalIP() (string, error)

GetExternalIP returns the internal IP of the VM

func (*GCPRawVM) GetInternalIP Uses

func (vm *GCPRawVM) GetInternalIP() (string, error)

GetInternalIP returns the internal IP of the VM

func (*GCPRawVM) SecureCopy Uses

func (vm *GCPRawVM) SecureCopy(files ...string) (string, error)

SecureCopy copies files to vm via scp

func (*GCPRawVM) SecureShell Uses

func (vm *GCPRawVM) SecureShell(cmd string) (string, error)

SecureShell execeutes cmd on vm through ssh

func (*GCPRawVM) Setup Uses

func (vm *GCPRawVM) Setup() error

Setup initialize the VM

func (*GCPRawVM) Teardown Uses

func (vm *GCPRawVM) Teardown() error

Teardown releases the VM to resource manager

type Istioctl Uses

type Istioctl struct {
    // contains filtered or unexported fields
}

Istioctl gathers istioctl information.

func NewIstioctl Uses

func NewIstioctl(yamlDir, namespace, istioNamespace, injectConfigMap, kubeconfig string) (*Istioctl, error)

NewIstioctl create a new istioctl by given temp dir.

func (*Istioctl) DeleteRule Uses

func (i *Istioctl) DeleteRule(rule string) error

DeleteRule Delete rule(s)

func (*Istioctl) GetProxyConfigEndpoints Uses

func (i *Istioctl) GetProxyConfigEndpoints(podName string, services []string) (epInfo map[string]PortEPs, err error)

GetProxyConfigEndpoints returns endpoints in the proxy config from a pod.

func (*Istioctl) Install Uses

func (i *Istioctl) Install() error

Install downloads Istioctl binary.

func (*Istioctl) KubeInject Uses

func (i *Istioctl) KubeInject(src, dest, kubeconfig string) error

KubeInject use istio kube-inject to create new yaml with a proxy as sidecar. TODO The commands below could be generalized so that istioctl doesn't default to using the in cluster kubeconfig this is useful in multicluster cases to perform injection on remote clusters.

func (*Istioctl) Setup Uses

func (i *Istioctl) Setup() error

Setup set up istioctl prerequest for tests, port forwarding

func (*Istioctl) Teardown Uses

func (i *Istioctl) Teardown() error

Teardown clean up everything created by setup

type KubeInfo Uses

type KubeInfo struct {
    Namespace string

    TmpDir string

    AuthEnabled    bool
    AuthSdsEnabled bool
    RBACEnabled    bool

    // Istioctl installation
    Istioctl *Istioctl
    // App Manager
    AppManager *AppManager

    // Release directory
    ReleaseDir string
    // Use baseversion if not empty.
    BaseVersion string

    Clusters map[string]string

    KubeConfig         string
    KubeAccessor       *testKube.Accessor
    RemoteKubeConfig   string
    RemoteKubeAccessor *testKube.Accessor
    RemoteAppManager   *AppManager
    RemoteIstioctl     *Istioctl
    // contains filtered or unexported fields
}

KubeInfo gathers information for kubectl

func (*KubeInfo) AppHub Uses

func (k *KubeInfo) AppHub() string

AppHub exposes the Docker hub used for the test application image.

func (*KubeInfo) AppTag Uses

func (k *KubeInfo) AppTag() string

AppTag exposes the Docker tag used for the test application image.

func (*KubeInfo) CheckJobSucceeded Uses

func (k *KubeInfo) CheckJobSucceeded(cluster, jobName string) error

CheckJobSucceeded checks whether the job succeeded.

func (*KubeInfo) DeployTiller Uses

func (k *KubeInfo) DeployTiller() error

DeployTiller deploys tiller in Istio mesh or returns error

func (*KubeInfo) GetAppPods Uses

func (k *KubeInfo) GetAppPods(cluster string) map[string][]string

GetAppPods gets a map of app name to pods for that app. If pods are found, the results are cached.

func (*KubeInfo) GetRoutes Uses

func (k *KubeInfo) GetRoutes(app string) (routes string, err error)

GetRoutes gets routes from the pod or returns error

func (*KubeInfo) ImagePullPolicy Uses

func (k *KubeInfo) ImagePullPolicy() string

ImagePullPolicy exposes the pull policy override used for Docker images. May be "".

func (*KubeInfo) Ingress Uses

func (k *KubeInfo) Ingress() (string, error)

Ingress lazily initialize ingress

func (*KubeInfo) IngressGateway Uses

func (k *KubeInfo) IngressGateway() (string, error)

IngressGateway lazily initialize Ingress Gateway

func (*KubeInfo) IngressGatewayOrFail Uses

func (k *KubeInfo) IngressGatewayOrFail(t *testing.T) string

IngressGatewayOrFail lazily initialize ingress gateway and fail test if not found.

func (*KubeInfo) IngressOrFail Uses

func (k *KubeInfo) IngressOrFail(t *testing.T) string

IngressOrFail lazily initialize ingress and fail test if not found.

func (*KubeInfo) IsClusterWide Uses

func (k *KubeInfo) IsClusterWide() bool

IsClusterWide indicates whether or not the environment is configured for a cluster-wide deployment.

func (*KubeInfo) IstioEgressGatewayService Uses

func (k *KubeInfo) IstioEgressGatewayService() string

IstioEgressGatewayService returns the service name for the egress gateway service

func (*KubeInfo) IstioIngressGatewayService Uses

func (k *KubeInfo) IstioIngressGatewayService() string

IstioIngressGatewayService returns the service name for the ingress gateway service

func (*KubeInfo) IstioIngressService Uses

func (k *KubeInfo) IstioIngressService() string

IstioIngressService returns the service name for the ingress service

func (*KubeInfo) IstioSystemNamespace Uses

func (k *KubeInfo) IstioSystemNamespace() string

IstioSystemNamespace returns the namespace used for the Istio system components.

func (*KubeInfo) PilotHub Uses

func (k *KubeInfo) PilotHub() string

PilotHub exposes the Docker hub used for the pilot image.

func (*KubeInfo) PilotTag Uses

func (k *KubeInfo) PilotTag() string

PilotTag exposes the Docker tag used for the pilot image.

func (*KubeInfo) ProxyHub Uses

func (k *KubeInfo) ProxyHub() string

ProxyHub exposes the Docker hub used for the proxy image.

func (*KubeInfo) ProxyTag Uses

func (k *KubeInfo) ProxyTag() string

ProxyTag exposes the Docker tag used for the proxy image.

func (*KubeInfo) Setup Uses

func (k *KubeInfo) Setup() error

Setup Kubernetes pre-requisites for tests

func (*KubeInfo) Teardown Uses

func (k *KubeInfo) Teardown() error

Teardown clean up everything created by setup

type PortEPs Uses

type PortEPs map[string][]string

PortEPs is a map from port number to a list of endpoints

type RawVM Uses

type RawVM interface {
    Cleanable
    GetInternalIP() (string, error)
    GetExternalIP() (string, error)
    SecureShell(cmd string) (string, error)
    SecureCopy(files ...string) (string, error)
}

RawVM interfaces different cloud vendors to support e2e testing with VM

type TestFlags Uses

type TestFlags struct {
    Ingress bool
    Egress  bool
}

TestFlags holds routing versions to test, and also if Ingress/Egress should be tested

func (*TestFlags) Init Uses

func (tf *TestFlags) Init()

Init initializes golang "flags" with the flags of TestFlags

Package framework imports 29 packages (graph). Updated 2019-11-13. Refresh now. Tools for package owners.