From 3262b7fccd0dfc87e99c54b6b16ac1da95312c9e Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Fri, 26 Aug 2016 13:58:53 +0200 Subject: [PATCH] e2e: log wget output on CheckConnectivityToHost error --- test/e2e/framework/util.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index eecaabc3899..f3ba9a51c5d 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -4665,7 +4665,18 @@ func CheckConnectivityToHost(f *Framework, nodeName, podName, host string, timeo return err } defer podClient.Delete(podName, nil) - return WaitForPodSuccessInNamespace(f.Client, podName, contName, f.Namespace.Name) + err = WaitForPodSuccessInNamespace(f.Client, podName, contName, f.Namespace.Name) + + if err != nil { + logs, logErr := GetPodLogs(f.Client, f.Namespace.Name, pod.Name, contName) + if logErr != nil { + Logf("Warning: Failed to get logs from pod %q: %v", pod.Name, logErr) + } else { + Logf("pod %s/%s \"wget\" logs:\n%s", f.Namespace.Name, pod.Name, logs) + } + } + + return err } // CoreDump SSHs to the master and all nodes and dumps their logs into dir.