Merge branch 'master' of github.com:kubernetes/minikube into restart
commit
e3b7476f32
|
@ -195,13 +195,22 @@ func CleanupWithLogs(t *testing.T, profile string, cancel context.CancelFunc) {
|
|||
|
||||
// clusterLogs shows logs for debugging a failed cluster
|
||||
func clusterLogs(t *testing.T, profile string) {
|
||||
t.Logf("-----------------------post-mortem--------------------------------")
|
||||
|
||||
if DockerDriver() {
|
||||
t.Logf("======> post-mortem[%s]: docker logs <======", t.Name())
|
||||
rr, err := Run(t, exec.Command("docker", "logs", "--details", profile))
|
||||
if err != nil {
|
||||
t.Logf("failed to get docker logs : %v", err)
|
||||
} else {
|
||||
t.Logf("(dbg) %s:\n%s", rr.Command(), rr.Output())
|
||||
}
|
||||
}
|
||||
st := Status(context.Background(), t, Target(), profile, "Host")
|
||||
if st != state.Running.String() {
|
||||
t.Logf("%q host is not running, skipping log retrieval (state=%q)", profile, st)
|
||||
return
|
||||
}
|
||||
|
||||
t.Logf("-----------------------post-mortem--------------------------------")
|
||||
t.Logf("<<< %s FAILED: start of post-mortem logs <<<", t.Name())
|
||||
t.Logf("======> post-mortem[%s]: minikube logs <======", t.Name())
|
||||
|
||||
|
|
|
@ -70,11 +70,13 @@ func validateStartNoReset(ctx context.Context, t *testing.T, profile string) {
|
|||
args := []string{"start", "-p", profile, "--alsologtostderr", "-v=5"}
|
||||
rr, err := Run(t, exec.CommandContext(ctx, Target(), args...))
|
||||
if err != nil {
|
||||
defer clusterLogs(t, profile)
|
||||
t.Fatalf("failed to second start a running minikube with args: %q : %v", rr.Command(), err)
|
||||
}
|
||||
if !NoneDriver() {
|
||||
softLog := "The running cluster does not need a reset"
|
||||
if !strings.Contains(rr.Output(), softLog) {
|
||||
defer clusterLogs(t, profile)
|
||||
t.Errorf("expected the second start log outputs to include %q but got: %s", softLog, rr.Output())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue