Documentation
¶
Index ¶
- func AssertContains(t *testing.T, alerts []Alert, expectedRuleName string, expectedCommand string, ...)
- func AssertNetworkNeighborhoodContains(t *testing.T, nn *v1beta1.NetworkNeighborhood, containerName string, ...)
- func AssertNetworkNeighborhoodNotContains(t *testing.T, nn *v1beta1.NetworkNeighborhood, containerName string, ...)
- func AssertNotContains(t *testing.T, alerts []Alert, notExpectedRuleName string, ...)
- func AssertUIDFieldsPopulated(t *testing.T, alerts []Alert, namespace string)
- func ExecIntoPod(podName, podNamespace string, command []string, container string) (string, string, error)
- func ExecIntoPodNoTTY(podName, podNamespace string, command []string, container string) (string, string, error)
- func GetNodeAgentAverageCPUUsage(start, end time.Time) (map[string]float64, error)
- func IncreaseNodeAgentSniffingTime(newDuration string)
- func PlotNodeAgentPrometheusCPUUsage(testcase string, startTime, endTime time.Time) error
- func PrintAppLogs(t *testing.T, app string)
- func RestartDaemonSet(namespace, name string) error
- func RestartDeployment(namespace, name string) error
- func RunCommand(name string, args ...string) int
- type Alert
- type TestNamespace
- type TestWorkload
- func (w *TestWorkload) Delete() error
- func (w *TestWorkload) ExecIntoPod(command []string, container string) (string, string, error)
- func (w *TestWorkload) ExecIntoPodNoTTY(command []string, container string) (string, string, error)
- func (w *TestWorkload) GetApplicationProfile() (*v1beta1.ApplicationProfile, error)
- func (w *TestWorkload) GetNetworkNeighborhood() (*v1beta1.NetworkNeighborhood, error)
- func (w *TestWorkload) GetPods() ([]v1.Pod, error)
- func (w *TestWorkload) GetWorkloadEvents() ([]eventsv1.Event, error)
- func (w *TestWorkload) WaitForApplicationProfile(maxRetries uint64, expectedStatus string) error
- func (w *TestWorkload) WaitForApplicationProfileCompletion(maxRetries uint64) error
- func (w *TestWorkload) WaitForApplicationProfileCompletionWithBlacklist(maxRetries uint64, blacklist []string) error
- func (w *TestWorkload) WaitForNetworkNeighborhood(maxRetries uint64, expectedStatus string) error
- func (w *TestWorkload) WaitForNetworkNeighborhoodCompletion(maxRetries uint64) error
- func (w *TestWorkload) WaitForNetworkNeighborhoodCompletionWithBlacklist(maxRetries uint64, blacklist []string) error
- func (w *TestWorkload) WaitForReady(maxRetries uint64) error
- type WorkloadMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertContains ¶
func AssertNotContains ¶
func AssertUIDFieldsPopulated ¶ added in v0.3.6
AssertUIDFieldsPopulated verifies that pod_uid and workload_uid fields are populated in alerts
func ExecIntoPod ¶
func ExecIntoPodNoTTY ¶ added in v0.3.165
func ExecIntoPodNoTTY(podName, podNamespace string, command []string, container string) (string, string, error)
ExecIntoPodNoTTY is ExecIntoPod without a controlling terminal.
Every other exec helper here sets TTY: true, and the API server allocates a pty on that flag alone regardless of Stdin — so all ordinary component-test execs run *with* a terminal. Note that `kubectl exec -t` is not a way to check this: kubectl silently drops the TTY flag when -i is absent, so it never sends TTY=true/Stdin=false at all and reports "not a tty" misleadingly. Verified against a live API server: TTY=true/Stdin=false -> /dev/pts/0.
Use this when a test needs a process with genuinely no controlling terminal.
func IncreaseNodeAgentSniffingTime ¶
func IncreaseNodeAgentSniffingTime(newDuration string)
func PrintAppLogs ¶ added in v0.3.3
func RestartDaemonSet ¶ added in v0.2.317
func RestartDeployment ¶ added in v0.2.335
func RunCommand ¶
Types ¶
type Alert ¶
Alert structure based on the expected JSON format from Alertmanager
func GetMalwareAlerts ¶
type TestNamespace ¶
type TestNamespace struct {
Name string
// contains filtered or unexported fields
}
func NewNamespace ¶
func NewNamespace(name string) TestNamespace
func NewRandomNamespace ¶
func NewRandomNamespace() TestNamespace
type TestWorkload ¶
type TestWorkload struct {
Namespace string
UnstructuredObj *unstructured.Unstructured
WorkloadObj *workloadinterface.Workload
// contains filtered or unexported fields
}
func CreateWorkloadsInPath ¶
func CreateWorkloadsInPath(namespace, dir string) ([]TestWorkload, error)
func NewTestWorkload ¶
func NewTestWorkload(namespace, resourcePath string) (*TestWorkload, error)
func NewTestWorkloadFromK8sIdentifiers ¶ added in v0.2.335
func NewTestWorkloadFromK8sIdentifiers(namespace, kind, name string) (*TestWorkload, error)
func (*TestWorkload) Delete ¶ added in v0.2.340
func (w *TestWorkload) Delete() error
func (*TestWorkload) ExecIntoPod ¶
func (*TestWorkload) ExecIntoPodNoTTY ¶ added in v0.3.165
ExecIntoPodNoTTY execs without a controlling terminal. See ExecIntoPodNoTTY.
func (*TestWorkload) GetApplicationProfile ¶
func (w *TestWorkload) GetApplicationProfile() (*v1beta1.ApplicationProfile, error)
func (*TestWorkload) GetNetworkNeighborhood ¶
func (w *TestWorkload) GetNetworkNeighborhood() (*v1beta1.NetworkNeighborhood, error)
func (*TestWorkload) GetWorkloadEvents ¶ added in v0.2.340
func (w *TestWorkload) GetWorkloadEvents() ([]eventsv1.Event, error)
func (*TestWorkload) WaitForApplicationProfile ¶
func (w *TestWorkload) WaitForApplicationProfile(maxRetries uint64, expectedStatus string) error
func (*TestWorkload) WaitForApplicationProfileCompletion ¶
func (w *TestWorkload) WaitForApplicationProfileCompletion(maxRetries uint64) error
func (*TestWorkload) WaitForApplicationProfileCompletionWithBlacklist ¶ added in v0.2.335
func (w *TestWorkload) WaitForApplicationProfileCompletionWithBlacklist(maxRetries uint64, blacklist []string) error
func (*TestWorkload) WaitForNetworkNeighborhood ¶
func (w *TestWorkload) WaitForNetworkNeighborhood(maxRetries uint64, expectedStatus string) error
func (*TestWorkload) WaitForNetworkNeighborhoodCompletion ¶
func (w *TestWorkload) WaitForNetworkNeighborhoodCompletion(maxRetries uint64) error
func (*TestWorkload) WaitForNetworkNeighborhoodCompletionWithBlacklist ¶ added in v0.2.335
func (w *TestWorkload) WaitForNetworkNeighborhoodCompletionWithBlacklist(maxRetries uint64, blacklist []string) error
func (*TestWorkload) WaitForReady ¶
func (w *TestWorkload) WaitForReady(maxRetries uint64) error
type WorkloadMetrics ¶
func PlotNodeAgentPrometheusMemoryUsage ¶
func PlotNodeAgentPrometheusMemoryUsage(testcase string, startTime, endTime time.Time) ([]WorkloadMetrics, error)