MCPcopy
hub / github.com/containerd/containerd / checkContainerLog

Function checkContainerLog

integration/container_log_test.go:140–150  ·  view source on GitHub ↗
(t *testing.T, log string, messages []string)

Source from the content-addressed store, hash-verified

138}
139
140func checkContainerLog(t *testing.T, log string, messages []string) {
141 lines := strings.Split(strings.TrimSpace(log), "\n")
142 require.Len(t, lines, len(messages), "log line number should match")
143 for i, line := range lines {
144 ts, msg, ok := strings.Cut(line, " ")
145 require.True(t, ok)
146 _, err := time.Parse(time.RFC3339Nano, ts)
147 assert.NoError(t, err, "timestamp should be in RFC3339Nano format")
148 assert.Equal(t, messages[i], msg, "log content should match")
149 }
150}

Callers 4

TestLongContainerLogFunction · 0.85
TestWindowsDeviceFunction · 0.85
TestContainerStopSignalsFunction · 0.85

Calls 1

LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…