MCPcopy Create free account
hub / github.com/aws/aws-node-termination-handler / TestFetchPodsNameList

Function TestFetchPodsNameList

pkg/node/node_test.go:294–315  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

292}
293
294func TestFetchPodsNameList(t *testing.T) {
295 client := fake.NewSimpleClientset(
296 &v1.Pod{
297 ObjectMeta: metav1.ObjectMeta{
298 Name: "myPod",
299 Labels: map[string]string{
300 "spec.nodeName": nodeName,
301 },
302 },
303 },
304 &v1.Node{
305 ObjectMeta: metav1.ObjectMeta{
306 Name: nodeName,
307 },
308 },
309 )
310
311 tNode := getNode(t, getDrainHelper(client))
312 podList, err := tNode.FetchPodNameList(nodeName)
313 h.Ok(t, err)
314 h.Equals(t, []string{"myPod"}, podList)
315}
316
317func TestLogPods(t *testing.T) {
318 client := fake.NewSimpleClientset(

Callers

nothing calls this directly

Calls 3

FetchPodNameListMethod · 0.80
getNodeFunction · 0.70
getDrainHelperFunction · 0.70

Tested by

no test coverage detected