diff options
-rw-r--r-- | cmd/podman/main.go | 2 | ||||
-rw-r--r-- | cmd/podman/stop.go | 2 | ||||
-rw-r--r-- | test/e2e/rootless_test.go | 8 |
3 files changed, 11 insertions, 1 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go index 1734a2c9e..4edc86361 100644 --- a/cmd/podman/main.go +++ b/cmd/podman/main.go @@ -25,7 +25,7 @@ var ( exitCode = 125 ) -var cmdsNotRequiringRootless = map[string]bool{"help": true, "version": true, "exec": true} +var cmdsNotRequiringRootless = map[string]bool{"help": true, "version": true, "exec": true, "stop": true} func main() { debug := false diff --git a/cmd/podman/stop.go b/cmd/podman/stop.go index d1fae56dd..c8f03a748 100644 --- a/cmd/podman/stop.go +++ b/cmd/podman/stop.go @@ -6,6 +6,7 @@ import ( "github.com/containers/libpod/cmd/podman/libpodruntime" "github.com/containers/libpod/libpod" + "github.com/containers/libpod/pkg/rootless" "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -55,6 +56,7 @@ func stopCmd(c *cli.Context) error { return err } + rootless.SetSkipStorageSetup(true) runtime, err := libpodruntime.GetRuntime(c) if err != nil { return errors.Wrapf(err, "could not get runtime") diff --git a/test/e2e/rootless_test.go b/test/e2e/rootless_test.go index 9d11a5be9..f162d5ddf 100644 --- a/test/e2e/rootless_test.go +++ b/test/e2e/rootless_test.go @@ -127,6 +127,14 @@ var _ = Describe("Podman rootless", func() { cmd.WaitWithDefaultTimeout() Expect(cmd.ExitCode()).To(Equal(0)) + cmd = podmanTest.PodmanAsUser([]string{"stop", "-l", "-t", "0"}, 1000, 1000, env) + cmd.WaitWithDefaultTimeout() + Expect(cmd.ExitCode()).To(Equal(0)) + + cmd = podmanTest.PodmanAsUser([]string{"start", "-l"}, 1000, 1000, env) + cmd.WaitWithDefaultTimeout() + Expect(cmd.ExitCode()).To(Equal(0)) + if !canExec() { Skip("ioctl(NS_GET_PARENT) not supported.") } |