From b793b9a17e5dde0a926af7d81d9412a81329570e Mon Sep 17 00:00:00 2001 From: Andrew Keesler Date: Thu, 11 Mar 2021 10:42:12 -0500 Subject: [PATCH] test/integration: add 'kubectl logs' test to TestImpersonationProxy Signed-off-by: Andrew Keesler --- test/integration/concierge_impersonation_proxy_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/integration/concierge_impersonation_proxy_test.go b/test/integration/concierge_impersonation_proxy_test.go index 05d2b3f7..721c9253 100644 --- a/test/integration/concierge_impersonation_proxy_test.go +++ b/test/integration/concierge_impersonation_proxy_test.go @@ -523,6 +523,12 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl _, _, _ = runKubectl("exec", "--namespace", env.ConciergeNamespace, podName, "--", "rm", remoteEchoFile) // cleanup remote echo file }() + // run the kubectl logs command + logLinesCount := 10 + stdout, _, err = runKubectl("logs", "--namespace", env.ConciergeNamespace, podName, fmt.Sprintf("--tail=%d", logLinesCount)) + require.NoError(t, err, `"kubectl logs" failed`) + require.Equalf(t, logLinesCount, strings.Count(stdout, "\n"), "wanted %d newlines in kubectl logs output:\n%s", logLinesCount, stdout) + // run the kubectl port-forward command timeout, cancelFunc := context.WithTimeout(ctx, 2*time.Minute) defer cancelFunc()