const pollInterval … const containerStatsPollingInterval … const maxNodesToCheck … // getPodMatches returns a set of pod names on the given node that matches the // podNamePrefix and namespace. func getPodMatches(ctx context.Context, c clientset.Interface, nodeName string, podNamePrefix string, namespace string) sets.String { … } // waitTillNPodsRunningOnNodes polls the /runningpods endpoint on kubelet until // it finds targetNumPods pods that match the given criteria (namespace and // podNamePrefix). Note that we usually use label selector to filter pods that // belong to the same RC. However, we use podNamePrefix with namespace here // because pods returned from /runningpods do not contain the original label // information; they are reconstructed by examining the container runtime. In // the scope of this test, we do not expect pod naming conflicts so // podNamePrefix should be sufficient to identify the pods. func waitTillNPodsRunningOnNodes(ctx context.Context, c clientset.Interface, nodeNames sets.String, podNamePrefix string, namespace string, targetNumPods int, timeout time.Duration) error { … } // Restart the passed-in nfs-server by issuing a `/usr/sbin/rpc.nfsd 1` command in the // pod's (only) container. This command changes the number of nfs server threads from // (presumably) zero back to 1, and therefore allows nfs to open connections again. func restartNfsServer(serverPod *v1.Pod) { … } // Stop the passed-in nfs-server by issuing a `/usr/sbin/rpc.nfsd 0` command in the // pod's (only) container. This command changes the number of nfs server threads to 0, // thus closing all open nfs connections. func stopNfsServer(serverPod *v1.Pod) { … } // Creates a pod that mounts an nfs volume that is served by the nfs-server pod. The container // will execute the passed in shell cmd. Waits for the pod to start. // Note: the nfs plugin is defined inline, no PV or PVC. func createPodUsingNfs(ctx context.Context, f *framework.Framework, c clientset.Interface, ns, nfsIP, cmd string) *v1.Pod { … } // getHostExternalAddress gets the node for a pod and returns the first External // address. Returns an error if the node the pod is on doesn't have an External // address. func getHostExternalAddress(ctx context.Context, client clientset.Interface, p *v1.Pod) (externalAddress string, err error) { … } // Checks for a lingering nfs mount and/or uid directory on the pod's host. The host IP is used // so that this test runs in GCE, where it appears that SSH cannot resolve the hostname. // If expectClean is true then we expect the node to be cleaned up and thus commands like // `ls <uid-dir>` should fail (since that dir was removed). If expectClean is false then we expect // the node is not cleaned up, and thus cmds like `ls <uid-dir>` should succeed. We wait for the // kubelet to be cleaned up, afterwhich an error is reported. func checkPodCleanup(ctx context.Context, c clientset.Interface, pod *v1.Pod, expectClean bool) { … } var _ … func getLinuxNodes(nodes *v1.NodeList) *v1.NodeList { … } func getWindowsNodes(nodes *v1.NodeList) *v1.NodeList { … } func isNode(node *v1.Node, os string) bool { … } func runKubectlCommand(cmd *exec.Cmd) (result string) { … } func assertContains(expectedString string, result string) { … } func commandOnNode(nodeName string, cmd string) string { … } func journalctlCommandOnNode(nodeName string, args string) string { … } func getWinEventCommandOnNode(nodeName string, providerName, args string) string { … } func trimSpaceNewlineInString(s string) string { … }