1
//go:build !remote_testing
9
. "github.com/onsi/ginkgo/v2"
10
. "github.com/onsi/gomega"
17
// Podman is the exec call to podman on the filesystem
18
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
19
podmanSession := p.PodmanBase(args, false, false)
20
return &PodmanSessionIntegration{podmanSession}
23
// PodmanSystemdScope runs the podman command in a new systemd scope
24
func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSessionIntegration {
25
wrapper := []string{"systemd-run", "--scope"}
27
wrapper = []string{"systemd-run", "--scope", "--user"}
29
podmanSession := p.PodmanAsUserBase(args, 0, 0, "", nil, false, false, wrapper, nil)
30
return &PodmanSessionIntegration{podmanSession}
33
// PodmanExtraFiles is the exec call to podman on the filesystem and passes down extra files
34
func (p *PodmanTestIntegration) PodmanExtraFiles(args []string, extraFiles []*os.File) *PodmanSessionIntegration {
35
podmanSession := p.PodmanAsUserBase(args, 0, 0, "", nil, false, false, nil, extraFiles)
36
return &PodmanSessionIntegration{podmanSession}
39
func (p *PodmanTestIntegration) setDefaultRegistriesConfigEnv() {
40
defaultFile := filepath.Join(INTEGRATION_ROOT, "test/registries.conf")
41
err := os.Setenv("CONTAINERS_REGISTRIES_CONF", defaultFile)
42
Expect(err).ToNot(HaveOccurred())
45
func (p *PodmanTestIntegration) setRegistriesConfigEnv(b []byte) {
46
outfile := filepath.Join(p.TempDir, "registries.conf")
47
os.Setenv("CONTAINERS_REGISTRIES_CONF", outfile)
48
err := os.WriteFile(outfile, b, 0644)
49
Expect(err).ToNot(HaveOccurred())
52
func resetRegistriesConfigEnv() {
53
os.Setenv("CONTAINERS_REGISTRIES_CONF", "")
56
func PodmanTestCreate(tempDir string) *PodmanTestIntegration {
57
return PodmanTestCreateUtil(tempDir, false)
60
// RestoreArtifact puts the cached image into our test store
61
func (p *PodmanTestIntegration) RestoreArtifact(image string) error {
62
tarball := imageTarPath(image)
63
if _, err := os.Stat(tarball); err == nil {
64
GinkgoWriter.Printf("Restoring %s...\n", image)
65
restore := p.PodmanNoEvents([]string{"load", "-q", "-i", tarball})
71
func (p *PodmanTestIntegration) StopRemoteService() {}
73
// We don't support running API service when local
74
func (p *PodmanTestIntegration) StartRemoteService() {
77
// Just a stub for compiling with `!remote`.
78
func getRemoteOptions(p *PodmanTestIntegration, args []string) []string {