提交 8d9e26d9 编写于 作者: P Priya Wadhwa

Test restart with preloaded tarball and without

上级 4a7f59f8
...@@ -175,7 +175,7 @@ func TestStartStopWithPreload(t *testing.T) { ...@@ -175,7 +175,7 @@ func TestStartStopWithPreload(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) ctx, cancel := context.WithTimeout(context.Background(), Minutes(40))
defer CleanupWithLogs(t, profile, cancel) defer CleanupWithLogs(t, profile, cancel)
startArgs := []string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", "-v=3", "--wait=true"} startArgs := []string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", "-v=3", "--wait=true", "--preload=false"}
startArgs = append(startArgs, StartArgs()...) startArgs = append(startArgs, StartArgs()...)
k8sVersion := "v1.17.0" k8sVersion := "v1.17.0"
startArgs = append(startArgs, fmt.Sprintf("--kubernetes-version=%s", k8sVersion)) startArgs = append(startArgs, fmt.Sprintf("--kubernetes-version=%s", k8sVersion))
...@@ -191,6 +191,18 @@ func TestStartStopWithPreload(t *testing.T) { ...@@ -191,6 +191,18 @@ func TestStartStopWithPreload(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("%s failed: %v", rr.Args, err) t.Fatalf("%s failed: %v", rr.Args, err)
} }
// Restart again with v1.17.0, this time with the preloaded tarball
startArgs = []string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", "-v=3", "--wait=true"}
startArgs = append(startArgs, StartArgs()...)
startArgs = append(startArgs, fmt.Sprintf("--kubernetes-version=%s", k8sVersion))
rr, err = Run(t, exec.CommandContext(ctx, Target(), startArgs...))
if err != nil {
t.Fatalf("%s failed: %v", rr.Args, err)
}
verifyImageExistsInDaemon(ctx, t, profile, image)
// Restart minikube with v1.17.3, which has a preloaded tarball // Restart minikube with v1.17.3, which has a preloaded tarball
startArgs = []string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", "-v=3", "--wait=true"} startArgs = []string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", "-v=3", "--wait=true"}
startArgs = append(startArgs, StartArgs()...) startArgs = append(startArgs, StartArgs()...)
...@@ -200,9 +212,13 @@ func TestStartStopWithPreload(t *testing.T) { ...@@ -200,9 +212,13 @@ func TestStartStopWithPreload(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("%s failed: %v", rr.Args, err) t.Fatalf("%s failed: %v", rr.Args, err)
} }
verifyImageExistsInDaemon(ctx, t, profile, image)
}
func verifyImageExistsInDaemon(ctx context.Context, t *testing.T, profile, image string) {
// Ensure that busybox still exists in the daemon // Ensure that busybox still exists in the daemon
rr, err = Run(t, exec.CommandContext(ctx, Target(), "ssh", "-p", profile, "--", "docker", "images")) rr, err := Run(t, exec.CommandContext(ctx, Target(), "ssh", "-p", profile, "--", "docker", "images"))
if err != nil { if err != nil {
t.Fatalf("%s failed: %v", rr.Args, err) t.Fatalf("%s failed: %v", rr.Args, err)
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册