Skip to content

Commit

Permalink
Merge pull request #20141 from baude/wslenablestop
Browse files Browse the repository at this point in the history
pkg/machine/e2e: wsl stop
  • Loading branch information
openshift-merge-robot authored Sep 26, 2023
2 parents f642349 + 8bad842 commit 94f47d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/machine/e2e/stop_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package e2e_test

import (
"fmt"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
Expand Down Expand Up @@ -28,8 +30,9 @@ var _ = Describe("podman machine stop", func() {
})

It("Stop running machine", func() {
name := randomString()
i := new(initMachine)
session, err := mb.setCmd(i.withImagePath(mb.imagePath).withNow()).run()
session, err := mb.setName(name).setCmd(i.withImagePath(mb.imagePath).withNow()).run()
Expect(err).ToNot(HaveOccurred())
Expect(session).To(Exit(0))

Expand All @@ -42,5 +45,6 @@ var _ = Describe("podman machine stop", func() {
stopAgain, err := mb.setCmd(stop).run()
Expect(err).ToNot(HaveOccurred())
Expect(stopAgain).To(Exit((0)))
Expect(stopAgain.outputToString()).To(ContainSubstring(fmt.Sprintf("Machine \"%s\" stopped successfully", name)))
})
})
2 changes: 1 addition & 1 deletion pkg/machine/wsl/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@ func (v *MachineVM) Stop(name string, _ machine.StopOptions) error {
}

if !wsl || !sysd {
return fmt.Errorf("%q is not running", v.Name)
return nil
}

// Stop user-mode networking if enabled
Expand Down

1 comment on commit 94f47d6

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.