Modify post-mortem logs so I don't need to count dashes

pull/7523/head
Thomas Stromberg 2020-04-08 15:34:16 -07:00
parent 688a0b2a9f
commit 194b8cd7d8
1 changed files with 6 additions and 8 deletions

View File

@ -201,9 +201,9 @@ func clusterLogs(t *testing.T, profile string) {
return
}
t.Logf("-----------------------post-mortem--------------------------------")
t.Logf("------------------------------------------------------------------")
t.Logf("<<< %s FAILED: start of post-mortem logs <<<", t.Name())
t.Logf("-------------------post-mortem minikube logs----------------------")
t.Logf("------++> post-mortem[%s]: minikube logs", t.Name())
rr, err := Run(t, exec.Command(Target(), "-p", profile, "logs", "--problems"))
if err != nil {
@ -212,21 +212,20 @@ func clusterLogs(t *testing.T, profile string) {
}
t.Logf("%s logs: %s", t.Name(), rr.Output())
t.Logf("------------------post-mortem disk usage-------------------")
t.Logf("------++> post-mortem[%s]: disk usage", t.Name())
rr, err = Run(t, exec.Command(Target(), "-p", profile, "ssh", "df -h /var/lib/docker/overlay2 /var /; du -hs /var/lib/docker/overlay2"))
if err != nil {
t.Logf("failed df error: %v", err)
}
t.Logf("%s df: %s", t.Name(), rr.Stdout)
t.Logf("------------------post-mortem api server status-------------------")
st = Status(context.Background(), t, Target(), profile, "APIServer")
if st != state.Running.String() {
t.Logf("%q apiserver is not running, skipping kubectl commands (state=%q)", profile, st)
return
}
t.Logf("--------------------post-mortem get pods--------------------------")
t.Logf("------++> post-mortem[%s]: get pods", t.Name())
rr, rerr := Run(t, exec.Command("kubectl", "--context", profile, "get", "po", "-A", "--show-labels"))
if rerr != nil {
t.Logf("%s: %v", rr.Command(), rerr)
@ -234,7 +233,7 @@ func clusterLogs(t *testing.T, profile string) {
}
t.Logf("(dbg) %s:\n%s", rr.Command(), rr.Output())
t.Logf("-------------------post-mortem describe node----------------------")
t.Logf("------++> post-mortem[%s]: describe node", t.Name())
rr, err = Run(t, exec.Command("kubectl", "--context", profile, "describe", "node"))
if err != nil {
t.Logf("%s: %v", rr.Command(), err)
@ -242,7 +241,7 @@ func clusterLogs(t *testing.T, profile string) {
t.Logf("(dbg) %s:\n%s", rr.Command(), rr.Output())
}
t.Logf("-------------------post-mortem describe pods----------------------")
t.Logf("------++> post-mortem[%s]: describe pods", t.Name())
rr, err = Run(t, exec.Command("kubectl", "--context", profile, "describe", "po", "-A"))
if err != nil {
t.Logf("%s: %v", rr.Command(), err)
@ -250,7 +249,6 @@ func clusterLogs(t *testing.T, profile string) {
t.Logf("(dbg) %s:\n%s", rr.Command(), rr.Stdout)
}
t.Logf("------------------------------------------------------------------")
t.Logf("<<< %s FAILED: end of post-mortem logs <<<", t.Name())
t.Logf("---------------------/post-mortem---------------------------------")
}