ptptesthelper

package
v0.0.0-...-a74e115 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicClockSyncCheck

func BasicClockSyncCheck(fullConfig testconfig.TestConfig, ptpConfig *ptpv1.PtpConfig, gmID *string) error

waits for the foreign master to appear in the logs and checks the clock accuracy

func CheckSlaveSyncWithMaster

func CheckSlaveSyncWithMaster(fullConfig testconfig.TestConfig)

func CreatePtpTestPrivilegedDaemonSet

func CreatePtpTestPrivilegedDaemonSet(daemonsetName, daemonsetNamespace, daemonsetContainerName string) *corev1.PodList

To create a ptp test privileged daemonset

func DeletePtpTestPrivilegedDaemonSet

func DeletePtpTestPrivilegedDaemonSet(daemonsetName, daemonsetNamespace string)

To delete a ptp test priviledged daemonset

func GetContainerCpuUsage

func GetContainerCpuUsage(podName, containerName, podNamespace string, rateTimeWindow time.Duration, prometheusPod *corev1.Pod) (float64, error)

GetContainerCpuUsage uses prometheus metric "container_cpu_usage_seconds_total" to return the cpu usage for a container in a pod. As each query needs to be done inside one of the prometheus pods, an optional param prometheusPod can be set for that purpose. If it's nil, the function will try to get it on every call.

func GetPodTotalCpuUsage

func GetPodTotalCpuUsage(podName, podNamespace string, rateTimeWindow time.Duration, prometheusPod *corev1.Pod) (float64, error)

GetPodTotalCpuUsage uses prometheus metric "container_cpu_usage_seconds_total" to return the total cpu usage by all the given pods. As each query needs to be done inside one of the prometheus pods, an optional param prometheusPod can be set for that purpose. If it's nil, the function will try to get it on every call.

func GetPodsTotalCpuUsage

func GetPodsTotalCpuUsage(pods []*corev1.Pod, prometheusPod *corev1.Pod) (float64, error)

GetPodsTotalCpuUsage uses prometheus metric "container_cpu_usage_seconds_total" to return the total cpu usage by all the given pods. As each query needs to be done inside one of the prometheus pods, an optional param prometheusPod can be set for that purpose. If it's nil, the function will try to get it on every call.

func GetPtpPodsPerNode

func GetPtpPodsPerNode() (map[string][]*corev1.Pod, error)

GetPtpPodsPerNode is a helper method to get a map of ptp-related pods (daemonset + operator) that are deployed on each node.

func RebootSlaveNode

func RebootSlaveNode(fullConfig testconfig.TestConfig)

func RecoverySlaveNetworkOutage

func RecoverySlaveNetworkOutage(fullConfig testconfig.TestConfig, skippedInterfaces map[string]bool)

func VerifyAfterRebootState

func VerifyAfterRebootState(rebootedNodes []string, fullConfig testconfig.TestConfig)

Types

This section is empty.

Jump to

Keyboard shortcuts

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