From 8d9e26d9940a7c2e89387661dd15b6e6d76cb217 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Tue, 24 Mar 2020 11:58:41 -0700 Subject: [PATCH] Test restart with preloaded tarball and without --- test/integration/start_stop_delete_test.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 38ca1d9b9..f0aeb0345 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -175,7 +175,7 @@ func TestStartStopWithPreload(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) 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()...) k8sVersion := "v1.17.0" startArgs = append(startArgs, fmt.Sprintf("--kubernetes-version=%s", k8sVersion)) @@ -191,6 +191,18 @@ func TestStartStopWithPreload(t *testing.T) { if err != nil { 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 startArgs = []string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", "-v=3", "--wait=true"} startArgs = append(startArgs, StartArgs()...) @@ -200,9 +212,13 @@ func TestStartStopWithPreload(t *testing.T) { if err != nil { 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 - 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 { t.Fatalf("%s failed: %v", rr.Args, err) } -- GitLab