diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2021-11-02 12:51:10 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2021-11-04 13:16:17 +0100 |
commit | 0234b153cc99edcb2865dc42e43f1edf8b7fccdc (patch) | |
tree | 481b14e1f0519799dc733231a4cb551c2b75678e /test/e2e/libpod_suite_remote_test.go | |
parent | 0686f0bb2ff22abae7ca90f1b17b32d73b8615a8 (diff) | |
download | podman-0234b153cc99edcb2865dc42e43f1edf8b7fccdc.tar.gz podman-0234b153cc99edcb2865dc42e43f1edf8b7fccdc.tar.bz2 podman-0234b153cc99edcb2865dc42e43f1edf8b7fccdc.zip |
test: run --cgroups=split in new cgroup
the --cgroups=split test changes the current cgroup as it creates a
sub-cgroup. This can cause a race condition in tests that are reading
the current cgroup.
Closes: https://github.com/containers/podman/issues/11191
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test/e2e/libpod_suite_remote_test.go')
-rw-r--r-- | test/e2e/libpod_suite_remote_test.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/e2e/libpod_suite_remote_test.go b/test/e2e/libpod_suite_remote_test.go index 3115c246f..ad511cc9e 100644 --- a/test/e2e/libpod_suite_remote_test.go +++ b/test/e2e/libpod_suite_remote_test.go @@ -38,11 +38,25 @@ func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration return &PodmanSessionIntegration{podmanSession} } +// PodmanSystemdScope runs the podman command in a new systemd scope +func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSessionIntegration { + var remoteArgs = []string{"--remote", "--url", p.RemoteSocket} + remoteArgs = append(remoteArgs, args...) + + wrapper := []string{"systemd-run", "--scope"} + if rootless.IsRootless() { + wrapper = []string{"systemd-run", "--scope", "--user"} + } + + podmanSession := p.PodmanAsUserBase(remoteArgs, 0, 0, "", nil, false, false, wrapper, nil) + return &PodmanSessionIntegration{podmanSession} +} + // PodmanExtraFiles is the exec call to podman on the filesystem and passes down extra files func (p *PodmanTestIntegration) PodmanExtraFiles(args []string, extraFiles []*os.File) *PodmanSessionIntegration { var remoteArgs = []string{"--remote", "--url", p.RemoteSocket} remoteArgs = append(remoteArgs, args...) - podmanSession := p.PodmanAsUserBase(remoteArgs, 0, 0, "", nil, false, false, extraFiles) + podmanSession := p.PodmanAsUserBase(remoteArgs, 0, 0, "", nil, false, false, nil, extraFiles) return &PodmanSessionIntegration{podmanSession} } |