Documentation ¶
Index ¶
- Variables
- func AddPrefix(containerId string, runtime Runtime) string
- func AssertLogContains(t *testing.T, m *Minikube, pod metav1.Object, expectedLog string)
- func AssertLogContainsWithTimeout(t *testing.T, m *Minikube, pod metav1.Object, expectedLog string, ...)
- func AssertProcessNOTRunningInContainer(t *testing.T, m *Minikube, pod metav1.Object, containername string, ...)
- func AssertProcessRunningInContainer(t *testing.T, m *Minikube, pod metav1.Object, containername string, ...)
- func GetContainerStatus(m *Minikube, pod metav1.Object, containername string) (*corev1.ContainerStatus, error)
- func HasAttribute(target discovery_kit_api.Target, key, value string) bool
- func NewContainerTarget(m *Minikube, pod metav1.Object, containername string) (*action_kit_api.Target, error)
- func PollForTarget(ctx context.Context, e *Extension, targetId string, ...) (discovery_kit_api.Target, error)
- func RemovePrefix(containerId string) string
- func Retry(t *testing.T, maxAttempts int, sleep time.Duration, f func(r *R)) bool
- func WaitForContainerStatusUsingContainerEngine(m *Minikube, containerId string, wantedStatus string) error
- func WithDefaultMinikube(t *testing.T, ext ExtensionFactory, testCases []WithMinikubeTestCase)
- func WithMinikube(t *testing.T, mOpts MinikubeOpts, ext ExtensionFactory, ...)
- type ActionExecution
- type Extension
- func (e *Extension) DiscoverTargets(targetId string) ([]discovery_kit_api.Target, error)
- func (e *Extension) RunAction(actionId string, target *action_kit_api.Target, config interface{}, ...) (ActionExecution, error)
- func (e *Extension) RunActionWithFiles(actionId string, target *action_kit_api.Target, config interface{}, ...) (ActionExecution, error)
- type ExtensionFactory
- type File
- type HelmExtensionFactory
- func (h *HelmExtensionFactory) AfterAll(t *testing.T, m *Minikube, e *Extension) error
- func (h *HelmExtensionFactory) AfterEach(t *testing.T, m *Minikube, e *Extension) error
- func (h *HelmExtensionFactory) BeforeAll(t *testing.T, m *Minikube, e *Extension) error
- func (h *HelmExtensionFactory) BeforeEach(t *testing.T, m *Minikube, e *Extension) error
- func (h *HelmExtensionFactory) CreateImage() error
- func (h *HelmExtensionFactory) Start(minikube *Minikube) (*Extension, error)
- type Iperf
- func (n *Iperf) AssertBandwidth(t *testing.T, min float64, max float64)
- func (n *Iperf) AssertPackageLoss(t *testing.T, min float64, max float64)
- func (n *Iperf) Delete() error
- func (n *Iperf) Deploy(name string, ...) error
- func (n *Iperf) MeasureBandwidth() (float64, error)
- func (n *Iperf) MeasurePackageLoss() (float64, error)
- func (n *Iperf) Target() (*action_kit_api.Target, error)
- type Minikube
- func (m *Minikube) Config() *rest.Config
- func (m *Minikube) CreatePod(pod *acorev1.PodApplyConfiguration) (metav1.Object, error)
- func (m *Minikube) CreateService(service *acorev1.ServiceApplyConfiguration) (metav1.Object, error)
- func (m *Minikube) DeletePod(pod metav1.Object) error
- func (m *Minikube) DeleteService(service metav1.Object) error
- func (m *Minikube) Exec(pod metav1.Object, containername string, cmd ...string) (string, error)
- func (m *Minikube) GetClient() *kubernetes.Clientset
- func (m *Minikube) GetPod(pod metav1.Object) (*corev1.Pod, error)
- func (m *Minikube) GetRuntime() Runtime
- func (m *Minikube) ListPods(ctx context.Context, namespace, matchLabels string) ([]corev1.Pod, error)
- func (m *Minikube) LoadImage(image string) error
- func (m *Minikube) NewRestClientForService(service metav1.Object) (*ServiceClient, error)
- func (m *Minikube) PodExec(pod metav1.Object, containername string, cmd ...string) (string, error)
- func (m *Minikube) PortForward(pod metav1.Object, remotePort uint16, stopCh <-chan struct{}) (uint16, error)
- func (m *Minikube) SshExec(arg ...string) *exec.Cmd
- func (m *Minikube) TailLog(ctx context.Context, pod metav1.Object)
- func (m *Minikube) TunnelService(service metav1.Object) (string, func(), error)
- func (m *Minikube) WaitForPodPhase(pod metav1.Object, phase corev1.PodPhase, duration time.Duration) error
- type MinikubeOpts
- type Netperf
- type Nginx
- func (n *Nginx) AssertCanReach(t *testing.T, url string, expected bool)
- func (n *Nginx) AssertCannotReach(t *testing.T, url string, errContains string)
- func (n *Nginx) AssertIsReachable(t *testing.T, expected bool)
- func (n *Nginx) CanReach(url string) error
- func (n *Nginx) ContainerStatus() (*corev1.ContainerStatus, error)
- func (n *Nginx) Delete() error
- func (n *Nginx) Deploy(podName string, opts ...func(c *acorev1.PodApplyConfiguration)) error
- func (n *Nginx) IsReachable() error
- func (n *Nginx) Target() (*action_kit_api.Target, error)
- type R
- type Runtime
- type ServiceClient
- type WithMinikubeTestCase
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AllRuntimes = []Runtime{RuntimeDocker, RuntimeContainerd, RuntimeCrio}
)
View Source
var DefaultMiniKubeOpts = MinikubeOpts{ Runtimes: []Runtime{RuntimeDocker}, Driver: "docker", }
Functions ¶
func AssertLogContains ¶
func AssertLogContainsWithTimeout ¶ added in v1.0.2
func GetContainerStatus ¶
func HasAttribute ¶
func HasAttribute(target discovery_kit_api.Target, key, value string) bool
func NewContainerTarget ¶
func PollForTarget ¶
func PollForTarget(ctx context.Context, e *Extension, targetId string, predicate func(target discovery_kit_api.Target) bool) (discovery_kit_api.Target, error)
func RemovePrefix ¶
func WithDefaultMinikube ¶
func WithDefaultMinikube(t *testing.T, ext ExtensionFactory, testCases []WithMinikubeTestCase)
func WithMinikube ¶
func WithMinikube(t *testing.T, mOpts MinikubeOpts, ext ExtensionFactory, testCases []WithMinikubeTestCase)
Types ¶
type ActionExecution ¶
type ActionExecution struct {
// contains filtered or unexported fields
}
func (*ActionExecution) Cancel ¶
func (a *ActionExecution) Cancel() error
func (*ActionExecution) Wait ¶
func (a *ActionExecution) Wait() error
type Extension ¶
type Extension struct { Client *resty.Client Pod metav1.Object // contains filtered or unexported fields }
func (*Extension) DiscoverTargets ¶
func (e *Extension) DiscoverTargets(targetId string) ([]discovery_kit_api.Target, error)
func (*Extension) RunAction ¶
func (e *Extension) RunAction(actionId string, target *action_kit_api.Target, config interface{}, executionContext *action_kit_api.ExecutionContext) (ActionExecution, error)
func (*Extension) RunActionWithFiles ¶
func (e *Extension) RunActionWithFiles(actionId string, target *action_kit_api.Target, config interface{}, executionContext *action_kit_api.ExecutionContext, files []File) (ActionExecution, error)
type ExtensionFactory ¶
type ExtensionFactory interface { CreateImage() error Start(minikube *Minikube) (*Extension, error) BeforeAll(t *testing.T, m *Minikube, e *Extension) error BeforeEach(t *testing.T, m *Minikube, e *Extension) error AfterAll(t *testing.T, m *Minikube, e *Extension) error AfterEach(t *testing.T, m *Minikube, e *Extension) error }
type HelmExtensionFactory ¶
type HelmExtensionFactory struct { Name string ImageName string Port uint16 ChartPath string PodLabelSelector string ExtraArgs func(minikube *Minikube) []string BeforeAllFunc func(t *testing.T, m *Minikube, e *Extension) error BeforeEachFunc func(t *testing.T, m *Minikube, e *Extension) error AfterAllFunc func(t *testing.T, m *Minikube, e *Extension) error AfterEachFunc func(t *testing.T, m *Minikube, e *Extension) error }
func (*HelmExtensionFactory) BeforeEach ¶ added in v1.0.6
func (*HelmExtensionFactory) CreateImage ¶
func (h *HelmExtensionFactory) CreateImage() error
type Iperf ¶
type Iperf struct { Minikube *Minikube ServerPod metav1.Object ClientPod metav1.Object ServerIp string }
func (*Iperf) AssertBandwidth ¶
func (*Iperf) AssertPackageLoss ¶
func (*Iperf) Deploy ¶
func (n *Iperf) Deploy(name string, opts ...func(server *acorev1.PodApplyConfiguration, client *acorev1.PodApplyConfiguration)) error
func (*Iperf) MeasureBandwidth ¶
func (*Iperf) MeasurePackageLoss ¶
type Minikube ¶
type Minikube struct { Runtime Runtime Driver string Profile string Client *kubernetes.Clientset ClientConfig *rest.Config // contains filtered or unexported fields }
func (*Minikube) CreateService ¶
func (*Minikube) Exec ¶
Exec executes a command in a container of a pod Deprecated: Please use PodExec instead
func (*Minikube) GetClient ¶
func (m *Minikube) GetClient() *kubernetes.Clientset
func (*Minikube) GetRuntime ¶
func (*Minikube) NewRestClientForService ¶
func (m *Minikube) NewRestClientForService(service metav1.Object) (*ServiceClient, error)
func (*Minikube) PortForward ¶
func (*Minikube) TunnelService ¶
type MinikubeOpts ¶
type Netperf ¶
type Netperf struct { Minikube *Minikube ServerPod metav1.Object ClientPod metav1.Object ServerIp string }
func (*Netperf) AssertLatency ¶
func (*Netperf) Deploy ¶
func (n *Netperf) Deploy(name string, opts ...func(server *acorev1.PodApplyConfiguration, client *acorev1.PodApplyConfiguration)) error
type Nginx ¶
func (*Nginx) AssertCanReach ¶
func (*Nginx) AssertCannotReach ¶
func (*Nginx) ContainerStatus ¶
func (n *Nginx) ContainerStatus() (*corev1.ContainerStatus, error)
func (*Nginx) Deploy ¶
func (n *Nginx) Deploy(podName string, opts ...func(c *acorev1.PodApplyConfiguration)) error
func (*Nginx) IsReachable ¶
type ServiceClient ¶
type ServiceClient struct { resty.Client // contains filtered or unexported fields }
func (*ServiceClient) Close ¶
func (c *ServiceClient) Close()
Click to show internal directories.
Click to hide internal directories.