MCPcopy
hub / github.com/baetyl/baetyl / TestCollectNodeInfo

Function TestCollectNodeInfo

ami/kube/kube_collect_test.go:75–94  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

73}
74
75func TestCollectNodeInfo(t *testing.T) {
76 ami := initCollectKubeAMI(t)
77 res, err := ami.CollectNodeInfo()
78 assert.NoError(t, err)
79 expected := map[string]interface{}{
80 "node1": &specv1.NodeInfo{
81 Hostname: "hostname",
82 Arch: "arch",
83 KernelVersion: "kernel",
84 OS: "os",
85 ContainerRuntime: "runtime",
86 MachineID: "machine",
87 BootID: "boot",
88 SystemUUID: "system",
89 OSImage: "image",
90 Role: "worker",
91 },
92 }
93 assert.EqualValues(t, expected["node1"], res["node1"])
94}
95
96func TestGetContainerStatus(t *testing.T) {
97 info := &v1.ContainerStatus{}

Callers

nothing calls this directly

Calls 2

initCollectKubeAMIFunction · 0.85
CollectNodeInfoMethod · 0.65

Tested by

no test coverage detected