Skip to content

Commit

Permalink
Test stop and start
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Wadhwa committed Dec 11, 2018
1 parent a5e6cf6 commit f61f838
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 10 additions & 3 deletions test/integration/addons_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,23 @@ func testGvisor(t *testing.T) {
func testGvisorRestart(t *testing.T) {
minikubeRunner := NewMinikubeRunner(t)
minikubeRunner.EnsureRunning()
fmt.Println("enabling gvisor")
minikubeRunner.RunCommand("addons enable gvisor", true)

t.Log("waiting for gvisor controller to come up")
if err := util.WaitForGvisorControllerRunning(t); err != nil {
t.Fatalf("waiting for gvisor controller to be up: %v", err)
}

minikubeRunner.RunCommand("delete", false)
minikubeRunner.CheckStatus(state.None.String())
checkStop := func() error {
minikubeRunner.RunCommand("stop", true)
return minikubeRunner.CheckStatusNoFail(state.Stopped.String())
}

fmt.Println("trying to stop")
if err := util.Retry(t, checkStop, 5*time.Second, 6); err != nil {
t.Fatalf("timed out while checking stopped status: %v", err)
}

minikubeRunner.Start()
minikubeRunner.CheckStatus(state.Running.String())

Expand Down
3 changes: 1 addition & 2 deletions test/integration/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ func (m *MinikubeRunner) SSH(command string) (string, error) {
func (m *MinikubeRunner) Start() {
switch r := m.Runtime; r {
case constants.ContainerdRuntime:
// TODO: priyawadhwa@ remove iso url once updated iso is being used in integration tests
containerdFlags := "--container-runtime=containerd --network-plugin=cni --docker-opt containerd=/var/run/containerd/containerd.sock --iso-url=https://storage.googleapis.com/k8s-minikube/gvisor-preview.iso"
containerdFlags := "--container-runtime=containerd --network-plugin=cni --docker-opt containerd=/var/run/containerd/containerd.sock"
m.RunCommand(fmt.Sprintf("start %s %s %s", m.StartArgs, m.Args, containerdFlags), true)
default:
m.RunCommand(fmt.Sprintf("start %s %s", m.StartArgs, m.Args), true)
Expand Down

0 comments on commit f61f838

Please sign in to comment.