提交 c03b2820 编写于 作者: T Tharun

add check for timeToStop field in minikube status

Signed-off-by: NTharun <rajendrantharun@live.com>
上级 628a4a83
......@@ -67,6 +67,8 @@ func TestScheduledStopWindows(t *testing.T) {
// sleep for 5 seconds
time.Sleep(5 * time.Second)
// make sure minikube timetoStop is not present
ensureTimeToStopNotPresent(ctx, t, profile)
// make sure minikube status is "Stopped"
ensureMinikubeStatus(ctx, t, profile, "Host", state.Stopped.String())
}
......@@ -111,6 +113,8 @@ func TestScheduledStopUnix(t *testing.T) {
t.Fatalf("process %v running but should have been killed on reschedule of stop", pid)
}
// make sure minikube timetoStop is not present
ensureTimeToStopNotPresent(ctx, t, profile)
// make sure minikube status is "Stopped"
ensureMinikubeStatus(ctx, t, profile, "Host", state.Stopped.String())
}
......@@ -191,3 +195,14 @@ func ensureMinikubeScheduledTime(ctx context.Context, t *testing.T, profile stri
t.Fatalf("error %v", err)
}
}
func ensureTimeToStopNotPresent(ctx context.Context, t *testing.T, profile string) {
args := []string{"status", "-p", profile}
rr, err := Run(t, exec.CommandContext(ctx, Target(), args...))
if err != nil {
t.Fatalf("minikube status: %v\n%s", err, rr.Output())
}
if strings.Contains(rr.Output(), "TimeToStop") {
t.Fatalf("expected status output to not include `TimeToStop` but got *%s*", rr.Output())
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册