mirror of
https://github.com/containers/podman.git
synced 2025-12-02 11:08:36 +08:00
Merge pull request #25097 from mtrmac/PodmanOptions
Refactor Podman E2E helpers to allow passing/adding more options to the low-level executor
This commit is contained in:
@@ -1704,7 +1704,13 @@ VOLUME %s`, ALPINE, volPath, volPath)
|
||||
}
|
||||
}
|
||||
|
||||
container := podmanTest.PodmanSystemdScope([]string{"run", "--rm", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup"})
|
||||
scopeOptions := PodmanExecOptions{
|
||||
Wrapper: []string{"systemd-run", "--scope"},
|
||||
}
|
||||
if isRootless() {
|
||||
scopeOptions.Wrapper = append(scopeOptions.Wrapper, "--user")
|
||||
}
|
||||
container := podmanTest.PodmanWithOptions(scopeOptions, "run", "--rm", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup")
|
||||
container.WaitWithDefaultTimeout()
|
||||
Expect(container).Should(Exit(0))
|
||||
checkLines(container.OutputToStringArray())
|
||||
@@ -1713,7 +1719,7 @@ VOLUME %s`, ALPINE, volPath, volPath)
|
||||
ContainSubstring("Running as unit: "))) // systemd >= 255
|
||||
|
||||
// check that --cgroups=split is honored also when a container runs in a pod
|
||||
container = podmanTest.PodmanSystemdScope([]string{"run", "--rm", "--pod", "new:split-test-pod", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup"})
|
||||
container = podmanTest.PodmanWithOptions(scopeOptions, "run", "--rm", "--pod", "new:split-test-pod", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup")
|
||||
container.WaitWithDefaultTimeout()
|
||||
Expect(container).Should(Exit(0))
|
||||
checkLines(container.OutputToStringArray())
|
||||
@@ -1849,7 +1855,9 @@ VOLUME %s`, ALPINE, volPath, volPath)
|
||||
files := []*os.File{
|
||||
devNull,
|
||||
}
|
||||
session := podmanTest.PodmanExtraFiles([]string{"run", "--preserve-fds", "1", ALPINE, "ls"}, files)
|
||||
session := podmanTest.PodmanWithOptions(PodmanExecOptions{
|
||||
ExtraFiles: files,
|
||||
}, "run", "--preserve-fds", "1", ALPINE, "ls")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user