Turn PodmanAsUserBase into PodmanExecBaseWithOptions

... replacing the many parameters with a struct with named fields.

This makes the meaning of parameters more explicit, and more importantly
it makes it easier to just edit _one_ of the parameters without requiring
specialized wrappers for every single case.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2025-01-22 22:13:52 +01:00
parent 55f7efc408
commit f2d552f5db
4 changed files with 50 additions and 21 deletions

View File

@@ -13,6 +13,7 @@ import (
"syscall"
"time"
. "github.com/containers/podman/v5/test/utils"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
@@ -37,14 +38,18 @@ func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSession
wrapper = []string{"systemd-run", "--scope", "--user"}
}
podmanSession := p.PodmanAsUserBase(args, 0, 0, "", nil, false, false, wrapper, nil)
podmanSession := p.PodmanExecBaseWithOptions(args, PodmanExecOptions{
Wrapper: wrapper,
})
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 {
args = p.makeOptions(args, false, false)
podmanSession := p.PodmanAsUserBase(args, 0, 0, "", nil, false, false, nil, extraFiles)
podmanSession := p.PodmanExecBaseWithOptions(args, PodmanExecOptions{
ExtraFiles: extraFiles,
})
return &PodmanSessionIntegration{podmanSession}
}