Merge pull request #20141 from baude/wslenablestop

pkg/machine/e2e: wsl stop
This commit is contained in:
OpenShift Merge Robot
2023-09-26 13:37:52 -04:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,8 @@
package e2e_test
import (
"fmt"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
@ -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))
@ -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)))
})
})

View File

@ -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