test/e2e: dedup Before/AfterEach nodes

There is no reason to define the same code every time in each file, just
use global nodes. This diff should speak for itself.

CleanupSecrets()/Volume() no longer call Cleanup() directly, as the
global AfterEach node will always call Cleanup() this is no longer
necessary. If one AfterEach() node fails it will still run the others.

Also always unset the CONTAINERS_CONF env vars. This prevents people
from forgetting to unset it. And fix the special CONTAINERS_CONF logic
in the system connection tests, we do not want to preserve
CONTAINERS_CONF anyway so just remove this logic.

Ginkgo orders the BeforeEach and AfterEach nodes. They will be executed
from the outer-most defined to inner-most. This means our global
BeforeEach is always first. Only then the inner one (in the Describe()
function in each file). For AfterEach it is inverted, from the inner to
the outer.
Also see https://onsi.github.io/ginkgo/#organizing-specs-with-container-nodes

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger 2023-05-11 18:59:13 +02:00
parent 493aac69e0
commit ab29ff2f66
No known key found for this signature in database
GPG Key ID: EB145DD938A3CAF2
129 changed files with 44 additions and 2695 deletions

View File

@ -4,31 +4,12 @@ import (
"syscall" "syscall"
"time" "time"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman attach", func() { var _ = Describe("Podman attach", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
Expect(err).ToNot(HaveOccurred())
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman attach to bogus container", func() { It("podman attach to bogus container", func() {
session := podmanTest.Podman([]string{"attach", "foobar"}) session := podmanTest.Podman([]string{"attach", "foobar"})

View File

@ -10,34 +10,12 @@ import (
"strings" "strings"
"github.com/containers/buildah" "github.com/containers/buildah"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman build", func() { var _ = Describe("Podman build", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
// Let's first do the most simple build possible to make sure stuff is // Let's first do the most simple build possible to make sure stuff is
// happy and then clean up after ourselves to make sure that works too. // happy and then clean up after ourselves to make sure that works too.
It("podman build and remove basic alpine", func() { It("podman build and remove basic alpine", func() {

View File

@ -1,7 +1,6 @@
package integration package integration
import ( import (
"os"
"os/exec" "os/exec"
"strconv" "strconv"
"strings" "strings"
@ -14,21 +13,10 @@ import (
) )
var _ = Describe("Podman checkpoint", func() { var _ = Describe("Podman checkpoint", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfContainerized("FIXME: #15015. All checkpoint tests hang when containerized.") SkipIfContainerized("FIXME: #15015. All checkpoint tests hang when containerized.")
SkipIfRootless("checkpoint not supported in rootless mode") SkipIfRootless("checkpoint not supported in rootless mode")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
// Check if the runtime implements checkpointing. Currently only // Check if the runtime implements checkpointing. Currently only
// runc's checkpoint/restore implementation is supported. // runc's checkpoint/restore implementation is supported.
cmd := exec.Command(podmanTest.OCIRuntime, "checkpoint", "--help") cmd := exec.Command(podmanTest.OCIRuntime, "checkpoint", "--help")
@ -44,12 +32,6 @@ var _ = Describe("Podman checkpoint", func() {
} }
}) })
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman checkpoint --create-image with bogus container", func() { It("podman checkpoint --create-image with bogus container", func() {
checkpointImage := "foobar-checkpoint" checkpointImage := "foobar-checkpoint"
session := podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage, "foobar"}) session := podmanTest.Podman([]string{"container", "checkpoint", "--create-image", checkpointImage, "foobar"})

View File

@ -28,20 +28,11 @@ func getRunString(input []string) []string {
} }
var _ = Describe("Podman checkpoint", func() { var _ = Describe("Podman checkpoint", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRootless("checkpoint not supported in rootless mode") SkipIfRootless("checkpoint not supported in rootless mode")
SkipIfContainerized("FIXME: #15015. All checkpoint tests hang when containerized.") SkipIfContainerized("FIXME: #15015. All checkpoint tests hang when containerized.")
tempdir, err = CreateTempDirInTempDir()
Expect(err).ToNot(HaveOccurred())
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
// Check if the runtime implements checkpointing. Currently only // Check if the runtime implements checkpointing. Currently only
// runc's checkpoint/restore implementation is supported. // runc's checkpoint/restore implementation is supported.
cmd := exec.Command(podmanTest.OCIRuntime, "checkpoint", "--help") cmd := exec.Command(podmanTest.OCIRuntime, "checkpoint", "--help")
@ -64,13 +55,6 @@ var _ = Describe("Podman checkpoint", func() {
} }
}) })
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman checkpoint bogus container", func() { It("podman checkpoint bogus container", func() {
session := podmanTest.Podman([]string{"container", "checkpoint", "foobar"}) session := podmanTest.Podman([]string{"container", "checkpoint", "foobar"})
session.WaitWithDefaultTimeout() session.WaitWithDefaultTimeout()

View File

@ -1,36 +1,15 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman container cleanup", func() { var _ = Describe("Podman container cleanup", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRemote("podman container cleanup is not supported in remote") SkipIfRemote("podman container cleanup is not supported in remote")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
It("podman cleanup bogus container", func() { It("podman cleanup bogus container", func() {

View File

@ -12,25 +12,6 @@ import (
) )
var _ = Describe("Podman commit", func() { var _ = Describe("Podman commit", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
Expect(err).ToNot(HaveOccurred())
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman commit container", func() { It("podman commit container", func() {
_, ec, _ := podmanTest.RunLsContainer("test1") _, ec, _ := podmanTest.RunLsContainer("test1")

View File

@ -102,6 +102,29 @@ func TestLibpod(t *testing.T) {
RunSpecs(t, "Libpod Suite") RunSpecs(t, "Libpod Suite")
} }
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
_ = BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
Expect(err).ToNot(HaveOccurred())
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
_ = AfterEach(func() {
// First unset CONTAINERS_CONF before doing Cleanup() to prevent
// invalid containers.conf files to fail the cleanup.
os.Unsetenv("CONTAINERS_CONF")
os.Unsetenv("CONTAINERS_CONF_OVERRIDE")
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
)
var _ = SynchronizedBeforeSuite(func() []byte { var _ = SynchronizedBeforeSuite(func() []byte {
// make cache dir // make cache dir
ImageCacheDir = filepath.Join(os.TempDir(), "imagecachedir") ImageCacheDir = filepath.Join(os.TempDir(), "imagecachedir")
@ -643,8 +666,6 @@ func (p *PodmanTestIntegration) CleanupVolume() {
// Remove all containers // Remove all containers
session := p.Podman([]string{"volume", "rm", "-fa"}) session := p.Podman([]string{"volume", "rm", "-fa"})
session.WaitWithDefaultTimeout() session.WaitWithDefaultTimeout()
p.Cleanup()
Expect(session).To(Exit(0), "command: %v\nstdout: %s\nstderr: %s", session.Command.Args, session.OutputToString(), session.ErrorToString()) Expect(session).To(Exit(0), "command: %v\nstdout: %s\nstderr: %s", session.Command.Args, session.OutputToString(), session.ErrorToString())
} }
@ -654,8 +675,6 @@ func (p *PodmanTestIntegration) CleanupSecrets() {
// Remove all containers // Remove all containers
session := p.Podman([]string{"secret", "rm", "-a"}) session := p.Podman([]string{"secret", "rm", "-a"})
session.Wait(90) session.Wait(90)
p.Cleanup()
Expect(session).To(Exit(0), "command: %v\nstdout: %s\nstderr: %s", session.Command.Args, session.OutputToString(), session.ErrorToString()) Expect(session).To(Exit(0), "command: %v\nstdout: %s\nstderr: %s", session.Command.Args, session.OutputToString(), session.ErrorToString())
} }

View File

@ -1,36 +1,14 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman container clone", func() { var _ = Describe("Podman container clone", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRemote("podman container clone is not supported in remote") SkipIfRemote("podman container clone is not supported in remote")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
It("podman container clone basic test", func() { It("podman container clone basic test", func() {

View File

@ -5,7 +5,6 @@ import (
"os" "os"
"path/filepath" "path/filepath"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
@ -69,27 +68,6 @@ func checkDataVolumeContainer(pTest *PodmanTestIntegration, image, cont, dest, d
} }
var _ = Describe("Podman create data volume", func() { var _ = Describe("Podman create data volume", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
os.Unsetenv("CONTAINERS_CONF")
})
It("podman create with volume data copy turned off", func() { It("podman create with volume data copy turned off", func() {
imgName, volData, volDest := "dataimg", "dummy", "/test" imgName, volData, volDest := "dataimg", "dummy", "/test"

View File

@ -1,37 +1,14 @@
package integration package integration
import ( import (
"os"
"github.com/containers/podman/v4/libpod/define" "github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/pkg/annotations" "github.com/containers/podman/v4/pkg/annotations"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman container inspect", func() { var _ = Describe("Podman container inspect", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman inspect a container for the container manager annotation", func() { It("podman inspect a container for the container manager annotation", func() {
const testContainer = "container-inspect-test-1" const testContainer = "container-inspect-test-1"

View File

@ -16,19 +16,8 @@ import (
) )
var _ = Describe("Verify podman containers.conf usage", func() { var _ = Describe("Verify podman containers.conf usage", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
os.Setenv("CONTAINERS_CONF", "config/containers.conf") os.Setenv("CONTAINERS_CONF", "config/containers.conf")
if IsRemote() { if IsRemote() {
podmanTest.RestartRemoteService() podmanTest.RestartRemoteService()
@ -36,14 +25,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
}) })
AfterEach(func() {
os.Unsetenv("CONTAINERS_CONF")
os.Unsetenv("CONTAINERS_CONF_OVERRIDE")
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("limits test", func() { It("limits test", func() {
SkipIfRootlessCgroupsV1("Setting limits not supported on cgroupv1 for rootless users") SkipIfRootlessCgroupsV1("Setting limits not supported on cgroupv1 for rootless users")
// containers.conf is set to "nofile=500:500" // containers.conf is set to "nofile=500:500"

View File

@ -17,27 +17,6 @@ import (
// rather than e2e tests. System tests are used in RHEL gating. // rather than e2e tests. System tests are used in RHEL gating.
var _ = Describe("Podman cp", func() { var _ = Describe("Podman cp", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
// Copy a file to the container, then back to the host and make sure // Copy a file to the container, then back to the host and make sure
// that the contents match. // that the contents match.

View File

@ -1,7 +1,6 @@
package integration package integration
import ( import (
"os"
"time" "time"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -11,27 +10,6 @@ import (
) )
var _ = Describe("Podman create with --ip flag", func() { var _ = Describe("Podman create with --ip flag", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("Podman create --ip with garbage address", func() { It("Podman create --ip with garbage address", func() {
result := podmanTest.Podman([]string{"create", "--name", "test", "--ip", "114232346", ALPINE, "ls"}) result := podmanTest.Podman([]string{"create", "--name", "test", "--ip", "114232346", ALPINE, "ls"})

View File

@ -1,9 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils"
"github.com/containers/storage/pkg/stringid" "github.com/containers/storage/pkg/stringid"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -11,27 +8,6 @@ import (
) )
var _ = Describe("Podman run with --mac-address flag", func() { var _ = Describe("Podman run with --mac-address flag", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("Podman run --mac-address", func() { It("Podman run --mac-address", func() {
result := podmanTest.Podman([]string{"run", "--mac-address", "92:d0:c6:0a:29:34", ALPINE, "ip", "addr"}) result := podmanTest.Podman([]string{"run", "--mac-address", "92:d0:c6:0a:29:34", ALPINE, "ip", "addr"})

View File

@ -15,25 +15,6 @@ import (
) )
var _ = Describe("Podman create", func() { var _ = Describe("Podman create", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
Expect(err).ToNot(HaveOccurred())
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman create container based on a local image", func() { It("podman create container based on a local image", func() {
session := podmanTest.Podman([]string{"create", "--name", "local_image_test", ALPINE, "ls"}) session := podmanTest.Podman([]string{"create", "--name", "local_image_test", ALPINE, "ls"})

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"sort" "sort"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -13,27 +12,6 @@ import (
) )
var _ = Describe("Podman diff", func() { var _ = Describe("Podman diff", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman diff of image", func() { It("podman diff of image", func() {
session := podmanTest.Podman([]string{"diff", ALPINE}) session := podmanTest.Podman([]string{"diff", ALPINE})

View File

@ -3,12 +3,10 @@ package integration
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"os"
"sync" "sync"
"time" "time"
"github.com/containers/podman/v4/libpod/events" "github.com/containers/podman/v4/libpod/events"
. "github.com/containers/podman/v4/test/utils"
"github.com/containers/storage/pkg/stringid" "github.com/containers/storage/pkg/stringid"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -16,26 +14,6 @@ import (
) )
var _ = Describe("Podman events", func() { var _ = Describe("Podman events", func() {
var (
tempdir string
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
var err error
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
// For most, all, of these tests we do not "live" test following a log because it may make a fragile test // For most, all, of these tests we do not "live" test following a log because it may make a fragile test
// system more complex. Instead we run the "events" and then verify that the events are processed correctly. // system more complex. Instead we run the "events" and then verify that the events are processed correctly.

View File

@ -13,27 +13,6 @@ import (
) )
var _ = Describe("Podman exec", func() { var _ = Describe("Podman exec", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman exec into bogus container", func() { It("podman exec into bogus container", func() {
session := podmanTest.Podman([]string{"exec", "foobar", "ls"}) session := podmanTest.Podman([]string{"exec", "foobar", "ls"})

View File

@ -1,36 +1,12 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman image|container exists", func() { var _ = Describe("Podman image|container exists", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman image exists in local storage by fq name", func() { It("podman image exists in local storage by fq name", func() {
session := podmanTest.Podman([]string{"image", "exists", ALPINE}) session := podmanTest.Podman([]string{"image", "exists", ALPINE})

View File

@ -11,27 +11,6 @@ import (
) )
var _ = Describe("Podman export", func() { var _ = Describe("Podman export", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman export output flag", func() { It("podman export output flag", func() {
_, ec, cid := podmanTest.RunLsContainer("") _, ec, cid := podmanTest.RunLsContainer("")

View File

@ -19,27 +19,6 @@ import (
) )
var _ = Describe("Podman kube generate", func() { var _ = Describe("Podman kube generate", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman kube generate pod on bogus object", func() { It("podman kube generate pod on bogus object", func() {
session := podmanTest.Podman([]string{"generate", "kube", "foobar"}) session := podmanTest.Podman([]string{"generate", "kube", "foobar"})

View File

@ -1,7 +1,6 @@
package integration package integration
import ( import (
"os"
"path/filepath" "path/filepath"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -11,27 +10,9 @@ import (
) )
var _ = Describe("Podman generate spec", func() { var _ = Describe("Podman generate spec", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRemote("podman generate spec is not supported on the remote client") SkipIfRemote("podman generate spec is not supported on the remote client")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
It("podman generate spec bogus should fail", func() { It("podman generate spec bogus should fail", func() {

View File

@ -11,27 +11,6 @@ import (
) )
var _ = Describe("Podman generate systemd", func() { var _ = Describe("Podman generate systemd", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman generate systemd on bogus container/pod", func() { It("podman generate systemd on bogus container/pod", func() {
session := podmanTest.Podman([]string{"generate", "systemd", "foobar"}) session := podmanTest.Podman([]string{"generate", "systemd", "foobar"})

View File

@ -14,27 +14,6 @@ import (
) )
var _ = Describe("Podman healthcheck run", func() { var _ = Describe("Podman healthcheck run", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman healthcheck run bogus container", func() { It("podman healthcheck run bogus container", func() {
session := podmanTest.Podman([]string{"healthcheck", "run", "foobar"}) session := podmanTest.Podman([]string{"healthcheck", "run", "foobar"})

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -10,27 +8,6 @@ import (
) )
var _ = Describe("Podman history", func() { var _ = Describe("Podman history", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman history output flag", func() { It("podman history output flag", func() {
session := podmanTest.Podman([]string{"history", ALPINE}) session := podmanTest.Podman([]string{"history", ALPINE})

View File

@ -13,42 +13,8 @@ import (
) )
var _ = Describe("podman image scp", func() { var _ = Describe("podman image scp", func() {
ConfPath := struct {
Value string
IsSet bool
}{}
var (
tempdir string
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(setupEmptyContainersConf)
ConfPath.Value, ConfPath.IsSet = os.LookupEnv("CONTAINERS_CONF")
conf, err := os.CreateTemp("", "containersconf")
Expect(err).ToNot(HaveOccurred())
os.Setenv("CONTAINERS_CONF", conf.Name())
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
os.Remove(os.Getenv("CONTAINERS_CONF"))
if ConfPath.IsSet {
os.Setenv("CONTAINERS_CONF", ConfPath.Value)
} else {
os.Unsetenv("CONTAINERS_CONF")
}
f := CurrentSpecReport()
processTestResult(f)
})
It("podman image scp bogus image", func() { It("podman image scp bogus image", func() {
scp := podmanTest.Podman([]string{"image", "scp", "FOOBAR"}) scp := podmanTest.Podman([]string{"image", "scp", "FOOBAR"})

View File

@ -5,28 +5,16 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman image sign", func() { var _ = Describe("Podman image sign", func() {
var ( var origGNUPGHOME string
origGNUPGHOME string
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRemote("podman-remote image sign is not supported") SkipIfRemote("podman-remote image sign is not supported")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
tempGNUPGHOME := filepath.Join(podmanTest.TempDir, "tmpGPG") tempGNUPGHOME := filepath.Join(podmanTest.TempDir, "tmpGPG")
err := os.Mkdir(tempGNUPGHOME, os.ModePerm) err := os.Mkdir(tempGNUPGHOME, os.ModePerm)
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
@ -38,9 +26,6 @@ var _ = Describe("Podman image sign", func() {
}) })
AfterEach(func() { AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
os.Setenv("GNUPGHOME", origGNUPGHOME) os.Setenv("GNUPGHOME", origGNUPGHOME)
}) })

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"sort" "sort"
"strings" "strings"
@ -14,27 +13,7 @@ import (
) )
var _ = Describe("Podman images", func() { var _ = Describe("Podman images", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman images", func() { It("podman images", func() {
session := podmanTest.Podman([]string{"images"}) session := podmanTest.Podman([]string{"images"})
session.WaitWithDefaultTimeout() session.WaitWithDefaultTimeout()

View File

@ -1,7 +1,6 @@
package integration package integration
import ( import (
"os"
"path/filepath" "path/filepath"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -11,27 +10,6 @@ import (
) )
var _ = Describe("Podman import", func() { var _ = Describe("Podman import", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman import with source and reference", func() { It("podman import with source and reference", func() {
outfile := filepath.Join(podmanTest.TempDir, "container.tar") outfile := filepath.Join(podmanTest.TempDir, "container.tar")

View File

@ -7,33 +7,12 @@ import (
"os/user" "os/user"
"path/filepath" "path/filepath"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman Info", func() { var _ = Describe("Podman Info", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman info --format json", func() { It("podman info --format json", func() {
tests := []struct { tests := []struct {

View File

@ -1,36 +1,12 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman init", func() { var _ = Describe("Podman init", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman init bogus container", func() { It("podman init bogus container", func() {
session := podmanTest.Podman([]string{"start", "123456"}) session := podmanTest.Podman([]string{"start", "123456"})

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -11,27 +9,6 @@ import (
) )
var _ = Describe("Podman inspect", func() { var _ = Describe("Podman inspect", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman inspect alpine image", func() { It("podman inspect alpine image", func() {
session := podmanTest.Podman([]string{"inspect", "--format=json", ALPINE}) session := podmanTest.Podman([]string{"inspect", "--format=json", ALPINE})

View File

@ -10,27 +10,6 @@ import (
) )
var _ = Describe("Podman kill", func() { var _ = Describe("Podman kill", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman kill bogus container", func() { It("podman kill bogus container", func() {
session := podmanTest.Podman([]string{"kill", "foobar"}) session := podmanTest.Podman([]string{"kill", "foobar"})

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"path/filepath" "path/filepath"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -12,29 +11,11 @@ import (
) )
var _ = Describe("Podman load", func() { var _ = Describe("Podman load", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
podmanTest.AddImageToRWStore(ALPINE) podmanTest.AddImageToRWStore(ALPINE)
}) })
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman load input flag", func() { It("podman load input flag", func() {
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar") outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")

View File

@ -16,9 +16,7 @@ import (
var _ = Describe("Podman login and logout", func() { var _ = Describe("Podman login and logout", func() {
var ( var (
tempdir string
err error err error
podmanTest *PodmanTestIntegration
authPath string authPath string
certPath string certPath string
certDirPath string certDirPath string
@ -28,11 +26,6 @@ var _ = Describe("Podman login and logout", func() {
) )
BeforeEach(func() { BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
authPath = filepath.Join(podmanTest.TempDir, "auth") authPath = filepath.Join(podmanTest.TempDir, "auth")
err := os.Mkdir(authPath, os.ModePerm) err := os.Mkdir(authPath, os.ModePerm)
@ -98,7 +91,6 @@ var _ = Describe("Podman login and logout", func() {
AfterEach(func() { AfterEach(func() {
os.Unsetenv("REGISTRY_AUTH_FILE") os.Unsetenv("REGISTRY_AUTH_FILE")
podmanTest.Cleanup()
os.RemoveAll(authPath) os.RemoveAll(authPath)
os.RemoveAll(certDirPath) os.RemoveAll(certDirPath)
}) })

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"os/exec" "os/exec"
"time" "time"
@ -24,26 +23,6 @@ func isEventBackendJournald(podmanTest *PodmanTestIntegration) bool {
} }
var _ = Describe("Podman logs", func() { var _ = Describe("Podman logs", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman logs on not existent container", func() { It("podman logs on not existent container", func() {
results := podmanTest.Podman([]string{"logs", "notexist"}) results := podmanTest.Podman([]string{"logs", "notexist"})

View File

@ -16,11 +16,6 @@ import (
) )
var _ = Describe("Podman manifest", func() { var _ = Describe("Podman manifest", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
const ( const (
imageList = "docker://registry.k8s.io/pause:3.1" imageList = "docker://registry.k8s.io/pause:3.1"
@ -32,20 +27,6 @@ var _ = Describe("Podman manifest", func() {
imageListS390XInstanceDigest = "sha256:882a20ee0df7399a445285361d38b711c299ca093af978217112c73803546d5e" imageListS390XInstanceDigest = "sha256:882a20ee0df7399a445285361d38b711c299ca093af978217112c73803546d5e"
) )
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("create w/o image and attempt push w/o dest", func() { It("create w/o image and attempt push w/o dest", func() {
for _, amend := range []string{"--amend", "-a"} { for _, amend := range []string{"--amend", "-a"} {
session := podmanTest.Podman([]string{"manifest", "create", "foo"}) session := podmanTest.Podman([]string{"manifest", "create", "foo"})

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -10,28 +8,10 @@ import (
) )
var _ = Describe("Podman mount", func() { var _ = Describe("Podman mount", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfNotRootless("This function is not enabled for rootful podman") SkipIfNotRootless("This function is not enabled for rootful podman")
SkipIfRemote("Podman mount not supported for remote connections") SkipIfRemote("Podman mount not supported for remote connections")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
It("podman mount", func() { It("podman mount", func() {

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -10,31 +8,13 @@ import (
) )
var _ = Describe("Podman mount", func() { var _ = Describe("Podman mount", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRemote("Podman mount not supported for remote connections") SkipIfRemote("Podman mount not supported for remote connections")
SkipIfRootless("Podman mount requires podman unshare first to work") SkipIfRootless("Podman mount requires podman unshare first to work")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
podmanTest.AddImageToRWStore(ALPINE) podmanTest.AddImageToRWStore(ALPINE)
}) })
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman mount", func() { It("podman mount", func() {
setup := podmanTest.Podman([]string{"create", ALPINE, "ls"}) setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
setup.WaitWithDefaultTimeout() setup.WaitWithDefaultTimeout()

View File

@ -1,34 +1,12 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )
var _ = Describe("Podman negative command-line", func() { var _ = Describe("Podman negative command-line", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman snuffleupagus exits non-zero", func() { It("podman snuffleupagus exits non-zero", func() {
session := podmanTest.Podman([]string{"snuffleupagus"}) session := podmanTest.Podman([]string{"snuffleupagus"})

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
"github.com/containers/storage/pkg/stringid" "github.com/containers/storage/pkg/stringid"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
@ -12,27 +10,6 @@ import (
) )
var _ = Describe("Podman network connect and disconnect", func() { var _ = Describe("Podman network connect and disconnect", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("bad network name in disconnect should result in error", func() { It("bad network name in disconnect should result in error", func() {
dis := podmanTest.Podman([]string{"network", "disconnect", "foobar", "test"}) dis := podmanTest.Podman([]string{"network", "disconnect", "foobar", "test"})

View File

@ -3,7 +3,6 @@ package integration
import ( import (
"encoding/json" "encoding/json"
"net" "net"
"os"
"github.com/containers/common/libnetwork/types" "github.com/containers/common/libnetwork/types"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -19,26 +18,6 @@ func removeNetworkDevice(name string) {
} }
var _ = Describe("Podman network create", func() { var _ = Describe("Podman network create", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman network create with name and subnet", func() { It("podman network create with name and subnet", func() {
netName := "subnet-" + stringid.GenerateRandomID() netName := "subnet-" + stringid.GenerateRandomID()

View File

@ -3,7 +3,6 @@ package integration
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"os"
"path/filepath" "path/filepath"
"time" "time"
@ -16,27 +15,6 @@ import (
) )
var _ = Describe("Podman network", func() { var _ = Describe("Podman network", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman --cni-config-dir backwards compat", func() { It("podman --cni-config-dir backwards compat", func() {
SkipIfRemote("--cni-config-dir only works locally") SkipIfRemote("--cni-config-dir only works locally")

View File

@ -13,21 +13,11 @@ import (
) )
var _ = Describe("Podman pause", func() { var _ = Describe("Podman pause", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
pausedState := "paused" pausedState := "paused"
createdState := "created" createdState := "created"
BeforeEach(func() { BeforeEach(func() {
SkipIfRootlessCgroupsV1("Pause is not supported in cgroups v1") SkipIfRootlessCgroupsV1("Pause is not supported in cgroups v1")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
if CGROUPSV2 { if CGROUPSV2 {
b, err := os.ReadFile("/proc/self/cgroup") b, err := os.ReadFile("/proc/self/cgroup")
@ -42,15 +32,6 @@ var _ = Describe("Podman pause", func() {
} }
} }
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
It("podman pause bogus container", func() { It("podman pause bogus container", func() {

View File

@ -16,27 +16,6 @@ import (
) )
var _ = Describe("Podman play kube with build", func() { var _ = Describe("Podman play kube with build", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
var testYAML = ` var testYAML = `
apiVersion: v1 apiVersion: v1

View File

@ -1854,29 +1854,12 @@ func verifyPodPorts(podmanTest *PodmanTestIntegration, podName string, ports ...
} }
var _ = Describe("Podman play kube", func() { var _ = Describe("Podman play kube", func() {
var ( var kubeYaml string
tempdir string
err error
podmanTest *PodmanTestIntegration
kubeYaml string
)
BeforeEach(func() { BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
kubeYaml = filepath.Join(podmanTest.TempDir, "kube.yaml") kubeYaml = filepath.Join(podmanTest.TempDir, "kube.yaml")
}) })
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman play kube fail with yaml of unsupported kind", func() { It("podman play kube fail with yaml of unsupported kind", func() {
err := writeYaml(unknownKindYaml, kubeYaml) err := writeYaml(unknownKindYaml, kubeYaml)
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
@ -1966,7 +1949,6 @@ var _ = Describe("Podman play kube", func() {
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
os.Setenv("CONTAINERS_CONF", conffile) os.Setenv("CONTAINERS_CONF", conffile)
defer os.Unsetenv("CONTAINERS_CONF")
if IsRemote() { if IsRemote() {
podmanTest.RestartRemoteService() podmanTest.RestartRemoteService()
@ -4105,7 +4087,6 @@ invalid kube kind
confPath, err := filepath.Abs("config/containers-netns2.conf") confPath, err := filepath.Abs("config/containers-netns2.conf")
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
os.Setenv("CONTAINERS_CONF", confPath) os.Setenv("CONTAINERS_CONF", confPath)
defer os.Unsetenv("CONTAINERS_CONF")
if IsRemote() { if IsRemote() {
podmanTest.RestartRemoteService() podmanTest.RestartRemoteService()
} }
@ -4897,7 +4878,6 @@ ENV OPENJ9_JAVA_OPTIONS=%q
ipcns="host" ipcns="host"
cgroups="disabled"`), 0644) cgroups="disabled"`), 0644)
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
defer os.Unsetenv("CONTAINERS_CONF")
os.Setenv("CONTAINERS_CONF", conffile) os.Setenv("CONTAINERS_CONF", conffile)
err = writeYaml(simplePodYaml, kubeYaml) err = writeYaml(simplePodYaml, kubeYaml)
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())

View File

@ -3,35 +3,17 @@ package integration
import ( import (
"os" "os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman pod clone", func() { var _ = Describe("Podman pod clone", func() {
var (
tempdir string hostname, _ := os.Hostname()
err error
podmanTest *PodmanTestIntegration
hostname, _ = os.Hostname()
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRemote("podman pod clone is not supported in remote") SkipIfRemote("podman pod clone is not supported in remote")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
It("podman pod clone basic test", func() { It("podman pod clone basic test", func() {

View File

@ -21,28 +21,7 @@ import (
) )
var _ = Describe("Podman pod create", func() { var _ = Describe("Podman pod create", func() {
var ( hostname, _ := os.Hostname()
tempdir string
err error
podmanTest *PodmanTestIntegration
hostname, _ = os.Hostname()
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman create pod", func() { It("podman create pod", func() {
_, ec, podID := podmanTest.CreatePod(nil) _, ec, podID := podmanTest.CreatePod(nil)
@ -952,7 +931,6 @@ ENTRYPOINT ["sleep","99999"]
confPath, err := filepath.Abs("config/containers-netns.conf") confPath, err := filepath.Abs("config/containers-netns.conf")
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
os.Setenv("CONTAINERS_CONF", confPath) os.Setenv("CONTAINERS_CONF", confPath)
defer os.Unsetenv("CONTAINERS_CONF")
if IsRemote() { if IsRemote() {
podmanTest.RestartRemoteService() podmanTest.RestartRemoteService()
} }

View File

@ -1,7 +1,6 @@
package integration package integration
import ( import (
"os"
"strconv" "strconv"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -11,27 +10,6 @@ import (
) )
var _ = Describe("Podman pod create", func() { var _ = Describe("Podman pod create", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman create infra container", func() { It("podman create infra container", func() {
session := podmanTest.Podman([]string{"pod", "create"}) session := podmanTest.Podman([]string{"pod", "create"})

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"path/filepath" "path/filepath"
"github.com/containers/podman/v4/libpod/define" "github.com/containers/podman/v4/libpod/define"
@ -13,27 +12,6 @@ import (
) )
var _ = Describe("Podman init containers", func() { var _ = Describe("Podman init containers", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman create init container without --pod should fail", func() { It("podman create init container without --pod should fail", func() {
session := podmanTest.Podman([]string{"create", "--init-ctr", "always", ALPINE, "top"}) session := podmanTest.Podman([]string{"create", "--init-ctr", "always", ALPINE, "top"})

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"encoding/json" "encoding/json"
"os"
"github.com/containers/podman/v4/libpod/define" "github.com/containers/podman/v4/libpod/define"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -12,27 +11,6 @@ import (
) )
var _ = Describe("Podman pod inspect", func() { var _ = Describe("Podman pod inspect", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman inspect bogus pod", func() { It("podman inspect bogus pod", func() {
session := podmanTest.Podman([]string{"pod", "inspect", "foobar"}) session := podmanTest.Podman([]string{"pod", "inspect", "foobar"})

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -10,27 +8,6 @@ import (
) )
var _ = Describe("Podman pod kill", func() { var _ = Describe("Podman pod kill", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman pod kill bogus", func() { It("podman pod kill bogus", func() {
session := podmanTest.Podman([]string{"pod", "kill", "foobar"}) session := podmanTest.Podman([]string{"pod", "kill", "foobar"})

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -10,29 +8,10 @@ import (
) )
var _ = Describe("Podman pod pause", func() { var _ = Describe("Podman pod pause", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
pausedState := "Paused" pausedState := "Paused"
BeforeEach(func() { BeforeEach(func() {
SkipIfRootlessCgroupsV1("Pause is not supported in cgroups v1") SkipIfRootlessCgroupsV1("Pause is not supported in cgroups v1")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
It("podman pod pause bogus pod", func() { It("podman pod pause bogus pod", func() {

View File

@ -1,36 +1,12 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman pod create", func() { var _ = Describe("Podman pod create", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman pod container share Namespaces", func() { It("podman pod container share Namespaces", func() {
session := podmanTest.Podman([]string{"pod", "create"}) session := podmanTest.Podman([]string{"pod", "create"})

View File

@ -1,36 +1,12 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman pod prune", func() { var _ = Describe("Podman pod prune", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman pod prune empty pod", func() { It("podman pod prune empty pod", func() {
_, ec, _ := podmanTest.CreatePod(nil) _, ec, _ := podmanTest.CreatePod(nil)

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"sort" "sort"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -13,27 +12,6 @@ import (
) )
var _ = Describe("Podman ps", func() { var _ = Describe("Podman ps", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman pod ps no pods", func() { It("podman pod ps no pods", func() {
session := podmanTest.Podman([]string{"pod", "ps"}) session := podmanTest.Podman([]string{"pod", "ps"})

View File

@ -1,36 +1,12 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman pod restart", func() { var _ = Describe("Podman pod restart", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman pod restart bogus pod", func() { It("podman pod restart bogus pod", func() {
session := podmanTest.Podman([]string{"pod", "restart", "123"}) session := podmanTest.Podman([]string{"pod", "restart", "123"})

View File

@ -15,27 +15,6 @@ import (
) )
var _ = Describe("Podman pod rm", func() { var _ = Describe("Podman pod rm", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman pod rm empty pod", func() { It("podman pod rm empty pod", func() {
_, ec, podid := podmanTest.CreatePod(nil) _, ec, podid := podmanTest.CreatePod(nil)

View File

@ -13,27 +13,6 @@ import (
) )
var _ = Describe("Podman pod start", func() { var _ = Describe("Podman pod start", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman pod start bogus pod", func() { It("podman pod start bogus pod", func() {
session := podmanTest.Podman([]string{"pod", "start", "123"}) session := podmanTest.Podman([]string{"pod", "start", "123"})

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -10,32 +8,14 @@ import (
) )
var _ = Describe("Podman pod stats", func() { var _ = Describe("Podman pod stats", func() {
var (
err error
tempdir string
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRootlessCgroupsV1("Tests fail with both CGv1 + required --cgroup-manager=cgroupfs") SkipIfRootlessCgroupsV1("Tests fail with both CGv1 + required --cgroup-manager=cgroupfs")
if isContainerized() { if isContainerized() {
SkipIfCgroupV1("All tests fail Error: unable to load cgroup at ...: cgroup deleted") SkipIfCgroupV1("All tests fail Error: unable to load cgroup at ...: cgroup deleted")
} }
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
}) })
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman pod stats should run with no pods", func() { It("podman pod stats should run with no pods", func() {
session := podmanTest.Podman([]string{"pod", "stats", "--no-stream"}) session := podmanTest.Podman([]string{"pod", "stats", "--no-stream"})
session.WaitWithDefaultTimeout() session.WaitWithDefaultTimeout()

View File

@ -3,34 +3,12 @@ package integration
import ( import (
"os" "os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman pod stop", func() { var _ = Describe("Podman pod stop", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman pod stop bogus pod", func() { It("podman pod stop bogus pod", func() {
session := podmanTest.Podman([]string{"pod", "stop", "123"}) session := podmanTest.Podman([]string{"pod", "stop", "123"})

View File

@ -2,37 +2,14 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"time" "time"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman top", func() { var _ = Describe("Podman top", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman pod top without pod name or id", func() { It("podman pod top without pod name or id", func() {
result := podmanTest.Podman([]string{"pod", "top"}) result := podmanTest.Podman([]string{"pod", "top"})

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"strings" "strings"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -12,27 +11,6 @@ import (
) )
var _ = Describe("Podman port", func() { var _ = Describe("Podman port", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman port all and latest", func() { It("podman port all and latest", func() {
result := podmanTest.Podman([]string{"port", "-a", "-l"}) result := podmanTest.Podman([]string{"port", "-a", "-l"})

View File

@ -5,7 +5,6 @@ import (
"os" "os"
"path/filepath" "path/filepath"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
@ -23,27 +22,6 @@ ENV test1=test1
ENV test2=test2` ENV test2=test2`
var _ = Describe("Podman prune", func() { var _ = Describe("Podman prune", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman container prune containers", func() { It("podman container prune containers", func() {
top := podmanTest.RunTopContainer("") top := podmanTest.RunTopContainer("")

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"regexp" "regexp"
"sort" "sort"
"strconv" "strconv"
@ -16,27 +15,6 @@ import (
) )
var _ = Describe("Podman ps", func() { var _ = Describe("Podman ps", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman ps no containers", func() { It("podman ps no containers", func() {
session := podmanTest.Podman([]string{"ps"}) session := podmanTest.Podman([]string{"ps"})

View File

@ -13,27 +13,6 @@ import (
) )
var _ = Describe("Podman pull", func() { var _ = Describe("Podman pull", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman pull multiple images with/without tag/digest", func() { It("podman pull multiple images with/without tag/digest", func() {
session := podmanTest.Podman([]string{"pull", "busybox:musl", "alpine", "alpine:latest", "quay.io/libpod/cirros", "quay.io/libpod/testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"}) session := podmanTest.Podman([]string{"pull", "busybox:musl", "alpine", "alpine:latest", "quay.io/libpod/cirros", "quay.io/libpod/testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})

View File

@ -15,29 +15,11 @@ import (
) )
var _ = Describe("Podman push", func() { var _ = Describe("Podman push", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
podmanTest.AddImageToRWStore(ALPINE) podmanTest.AddImageToRWStore(ALPINE)
}) })
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman push to containers/storage", func() { It("podman push to containers/storage", func() {
SkipIfRemote("Remote push does not support containers-storage transport") SkipIfRemote("Remote push does not support containers-storage transport")
session := podmanTest.Podman([]string{"push", ALPINE, "containers-storage:busybox:test"}) session := podmanTest.Podman([]string{"push", ALPINE, "containers-storage:busybox:test"})

View File

@ -12,7 +12,6 @@ import (
"github.com/containers/podman/v4/version" "github.com/containers/podman/v4/version"
"github.com/mattn/go-shellwords" "github.com/mattn/go-shellwords"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
@ -395,21 +394,12 @@ func (t *quadletTestcase) check(generateDir string, session *PodmanSessionIntegr
var _ = Describe("quadlet system generator", func() { var _ = Describe("quadlet system generator", func() {
var ( var (
tempdir string
err error err error
generatedDir string generatedDir string
quadletDir string quadletDir string
podmanTest *PodmanTestIntegration
) )
BeforeEach(func() { BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
generatedDir = filepath.Join(podmanTest.TempDir, "generated") generatedDir = filepath.Join(podmanTest.TempDir, "generated")
err = os.Mkdir(generatedDir, os.ModePerm) err = os.Mkdir(generatedDir, os.ModePerm)
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
@ -419,13 +409,6 @@ var _ = Describe("quadlet system generator", func() {
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
}) })
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
Describe("quadlet -version", func() { Describe("quadlet -version", func() {
It("Should print correct version", func() { It("Should print correct version", func() {
session := podmanTest.Quadlet([]string{"-version"}, "/something") session := podmanTest.Quadlet([]string{"-version"}, "/something")

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
@ -11,27 +10,6 @@ import (
) )
var _ = Describe("podman rename", func() { var _ = Describe("podman rename", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman rename on non-existent container", func() { It("podman rename on non-existent container", func() {
session := podmanTest.Podman([]string{"rename", "doesNotExist", "aNewName"}) session := podmanTest.Podman([]string{"rename", "doesNotExist", "aNewName"})

View File

@ -12,27 +12,6 @@ import (
) )
var _ = Describe("Podman restart", func() { var _ = Describe("Podman restart", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman restart bogus container", func() { It("podman restart bogus container", func() {
session := podmanTest.Podman([]string{"start", "123"}) session := podmanTest.Podman([]string{"start", "123"})

View File

@ -4,34 +4,12 @@ import (
"fmt" "fmt"
"os" "os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman rm", func() { var _ = Describe("Podman rm", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman rm stopped container", func() { It("podman rm stopped container", func() {
_, ec, cid := podmanTest.RunLsContainer("") _, ec, cid := podmanTest.RunLsContainer("")

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"sync" "sync"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -12,27 +11,6 @@ import (
) )
var _ = Describe("Podman rmi", func() { var _ = Describe("Podman rmi", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman rmi bogus image", func() { It("podman rmi bogus image", func() {
session := podmanTest.Podman([]string{"rmi", "debian:6.0.10"}) session := podmanTest.Podman([]string{"rmi", "debian:6.0.10"})

View File

@ -2,39 +2,19 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"strings" "strings"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman run networking", func() { var _ = Describe("Podman run networking", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
SkipIfCNI(podmanTest) SkipIfCNI(podmanTest)
}) })
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("Aardvark Test 1: One container", func() { It("Aardvark Test 1: One container", func() {
netName := createNetworkName("Test") netName := createNetworkName("Test")
session := podmanTest.Podman([]string{"network", "create", netName}) session := podmanTest.Podman([]string{"network", "create", netName})

View File

@ -28,27 +28,6 @@ func skipIfAppArmorDisabled() {
} }
var _ = Describe("Podman run", func() { var _ = Describe("Podman run", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run apparmor default", func() { It("podman run apparmor default", func() {
skipIfAppArmorDisabled() skipIfAppArmorDisabled()

View File

@ -15,27 +15,9 @@ import (
const cgroupRoot = "/sys/fs/cgroup" const cgroupRoot = "/sys/fs/cgroup"
var _ = Describe("Podman run with --cgroup-parent", func() { var _ = Describe("Podman run with --cgroup-parent", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRootlessCgroupsV1("cgroup parent is not supported in cgroups v1") SkipIfRootlessCgroupsV1("cgroup parent is not supported in cgroups v1")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
Specify("valid --cgroup-parent using cgroupfs", func() { Specify("valid --cgroup-parent using cgroupfs", func() {

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -10,29 +8,6 @@ import (
) )
var _ = Describe("Podman run exit", func() { var _ = Describe("Podman run exit", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
err = podmanTest.RestoreArtifact(ALPINE)
Expect(err).ToNot(HaveOccurred())
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run -d mount cleanup test", func() { It("podman run -d mount cleanup test", func() {
SkipIfRemote("podman-remote does not support mount") SkipIfRemote("podman-remote does not support mount")

View File

@ -10,35 +10,15 @@ import (
) )
var _ = Describe("Podman run cpu", func() { var _ = Describe("Podman run cpu", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRootlessCgroupsV1("Setting CPU not supported on cgroupv1 for rootless users") SkipIfRootlessCgroupsV1("Setting CPU not supported on cgroupv1 for rootless users")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
if CGROUPSV2 { if CGROUPSV2 {
if err := os.WriteFile("/sys/fs/cgroup/cgroup.subtree_control", []byte("+cpuset"), 0644); err != nil { if err := os.WriteFile("/sys/fs/cgroup/cgroup.subtree_control", []byte("+cpuset"), 0644); err != nil {
Skip("cpuset controller not available on the current kernel") Skip("cpuset controller not available on the current kernel")
} }
} }
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
It("podman run cpu-period", func() { It("podman run cpu-period", func() {

View File

@ -26,27 +26,6 @@ func createContainersConfFileWithDevices(pTest *PodmanTestIntegration, devices s
} }
var _ = Describe("Podman run device", func() { var _ = Describe("Podman run device", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
os.Unsetenv("CONTAINERS_CONF")
})
It("podman run bad device test", func() { It("podman run bad device test", func() {
session := podmanTest.Podman([]string{"run", "-q", "--device", "/dev/baddevice", ALPINE, "true"}) session := podmanTest.Podman([]string{"run", "-q", "--device", "/dev/baddevice", ALPINE, "true"})

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -10,27 +8,6 @@ import (
) )
var _ = Describe("Podman run dns", func() { var _ = Describe("Podman run dns", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run add search domain", func() { It("podman run add search domain", func() {
session := podmanTest.Podman([]string{"run", "--dns-search=foobar.com", ALPINE, "cat", "/etc/resolv.conf"}) session := podmanTest.Podman([]string{"run", "--dns-search=foobar.com", ALPINE, "cat", "/etc/resolv.conf"})

View File

@ -1,36 +1,12 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman run entrypoint", func() { var _ = Describe("Podman run entrypoint", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run no command, entrypoint, or cmd", func() { It("podman run no command, entrypoint, or cmd", func() {
dockerfile := `FROM quay.io/libpod/alpine:latest dockerfile := `FROM quay.io/libpod/alpine:latest

View File

@ -3,34 +3,12 @@ package integration
import ( import (
"os" "os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman run", func() { var _ = Describe("Podman run", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run environment test", func() { It("podman run environment test", func() {
session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "printenv", "HOME"}) session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "printenv", "HOME"})

View File

@ -2,37 +2,14 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"github.com/containers/podman/v4/libpod/define" "github.com/containers/podman/v4/libpod/define"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman run exit", func() { var _ = Describe("Podman run exit", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run exit define.ExecErrorCodeGeneric", func() { It("podman run exit define.ExecErrorCodeGeneric", func() {
result := podmanTest.Podman([]string{"run", "--foobar", ALPINE, "ls", "$tmp"}) result := podmanTest.Podman([]string{"run", "--foobar", ALPINE, "ls", "$tmp"})

View File

@ -2,37 +2,16 @@ package integration
import ( import (
"fmt" "fmt"
"os"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman run memory", func() { var _ = Describe("Podman run memory", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRootlessCgroupsV1("Setting Memory not supported on cgroupv1 for rootless users") SkipIfRootlessCgroupsV1("Setting Memory not supported on cgroupv1 for rootless users")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
It("podman run memory test", func() { It("podman run memory test", func() {

View File

@ -19,28 +19,8 @@ import (
) )
var _ = Describe("Podman run networking", func() { var _ = Describe("Podman run networking", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
hostname, _ = os.Hostname()
)
BeforeEach(func() { hostname, _ := os.Hostname()
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman verify network scoped DNS server and also verify updating network dns server", func() { It("podman verify network scoped DNS server and also verify updating network dns server", func() {
// Following test is only functional with netavark and aardvark // Following test is only functional with netavark and aardvark

View File

@ -1,7 +1,6 @@
package integration package integration
import ( import (
"os"
"os/exec" "os/exec"
"strings" "strings"
@ -12,27 +11,6 @@ import (
) )
var _ = Describe("Podman run ns", func() { var _ = Describe("Podman run ns", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run pidns test", func() { It("podman run pidns test", func() {
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1") SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
@ -11,27 +10,6 @@ import (
) )
var _ = Describe("Podman run passwd", func() { var _ = Describe("Podman run passwd", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run no user specified ", func() { It("podman run no user specified ", func() {
session := podmanTest.Podman([]string{"run", "--read-only", BB, "mount"}) session := podmanTest.Podman([]string{"run", "--read-only", BB, "mount"})

View File

@ -36,27 +36,6 @@ func containerCapMatchesHost(ctrCap string, hostCap string) {
} }
var _ = Describe("Podman privileged container tests", func() { var _ = Describe("Podman privileged container tests", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman privileged make sure sys is mounted rw", func() { It("podman privileged make sure sys is mounted rw", func() {
session := podmanTest.Podman([]string{"run", "--privileged", BB, "mount"}) session := podmanTest.Podman([]string{"run", "--privileged", BB, "mount"})

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -10,27 +8,6 @@ import (
) )
var _ = Describe("Podman run restart containers", func() { var _ = Describe("Podman run restart containers", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("Podman start after successful run", func() { It("Podman start after successful run", func() {
session := podmanTest.Podman([]string{"run", "--name", "test", ALPINE, "ls"}) session := podmanTest.Podman([]string{"run", "--name", "test", ALPINE, "ls"})

View File

@ -1,8 +1,6 @@
package integration package integration
import ( import (
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -10,27 +8,6 @@ import (
) )
var _ = Describe("Podman run", func() { var _ = Describe("Podman run", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run --seccomp-policy default", func() { It("podman run --seccomp-policy default", func() {
session := podmanTest.Podman([]string{"run", "--seccomp-policy", "default", alpineSeccomp, "ls"}) session := podmanTest.Podman([]string{"run", "--seccomp-policy", "default", alpineSeccomp, "ls"})

View File

@ -2,36 +2,14 @@ package integration
import ( import (
"fmt" "fmt"
"os"
"strings" "strings"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman generate kube", func() { var _ = Describe("Podman generate kube", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman security labels", func() { It("podman security labels", func() {
test1 := podmanTest.Podman([]string{"create", "--label", "io.containers.capabilities=setuid,setgid", "--name", "test1", "alpine", "echo", "test1"}) test1 := podmanTest.Podman([]string{"create", "--label", "io.containers.capabilities=setuid,setgid", "--name", "test1", "alpine", "echo", "test1"})

View File

@ -4,7 +4,6 @@ import (
"os" "os"
"path/filepath" "path/filepath"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
@ -12,31 +11,12 @@ import (
) )
var _ = Describe("Podman run", func() { var _ = Describe("Podman run", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
if !selinux.GetEnabled() { if !selinux.GetEnabled() {
Skip("SELinux not enabled") Skip("SELinux not enabled")
} }
}) })
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run selinux", func() { It("podman run selinux", func() {
session := podmanTest.Podman([]string{"run", ALPINE, "cat", "/proc/self/attr/current"}) session := podmanTest.Podman([]string{"run", ALPINE, "cat", "/proc/self/attr/current"})
session.WaitWithDefaultTimeout() session.WaitWithDefaultTimeout()

View File

@ -20,27 +20,6 @@ const sigCatch = "trap \"echo FOO >> /h/fifo \" 8; echo READY >> /h/fifo; while
const sigCatch2 = "trap \"echo Received\" SIGFPE; while :; do sleep 0.25; done" const sigCatch2 = "trap \"echo Received\" SIGFPE; while :; do sleep 0.25; done"
var _ = Describe("Podman run with --sig-proxy", func() { var _ = Describe("Podman run with --sig-proxy", func() {
var (
tmpdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tmpdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tmpdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
Specify("signals are forwarded to container using sig-proxy", func() { Specify("signals are forwarded to container using sig-proxy", func() {
if podmanTest.Host.Arch == "ppc64le" { if podmanTest.Host.Arch == "ppc64le" {
@ -48,7 +27,7 @@ var _ = Describe("Podman run with --sig-proxy", func() {
} }
signal := syscall.SIGFPE signal := syscall.SIGFPE
// Set up a socket for communication // Set up a socket for communication
udsDir := filepath.Join(tmpdir, "socket") udsDir := filepath.Join(tempdir, "socket")
err := os.Mkdir(udsDir, 0700) err := os.Mkdir(udsDir, 0700)
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
udsPath := filepath.Join(udsDir, "fifo") udsPath := filepath.Join(udsDir, "fifo")

View File

@ -3,7 +3,6 @@ package integration
import ( import (
"fmt" "fmt"
"net/http" "net/http"
"os"
"time" "time"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -14,27 +13,9 @@ import (
) )
var _ = Describe("Podman run with --ip flag", func() { var _ = Describe("Podman run with --ip flag", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRootless("rootless does not support --ip without network") SkipIfRootless("rootless does not support --ip without network")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
It("Podman run --ip with garbage address", func() { It("Podman run --ip with garbage address", func() {

View File

@ -21,26 +21,6 @@ import (
) )
var _ = Describe("Podman run", func() { var _ = Describe("Podman run", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run a container based on local image", func() { It("podman run a container based on local image", func() {
session := podmanTest.Podman([]string{"run", ALPINE, "ls"}) session := podmanTest.Podman([]string{"run", ALPINE, "ls"})

View File

@ -1,7 +1,6 @@
package integration package integration
import ( import (
"os"
"path/filepath" "path/filepath"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
@ -12,10 +11,6 @@ import (
var _ = Describe("Podman run with volumes", func() { var _ = Describe("Podman run with volumes", func() {
var ( var (
tempdir string
err error
podmanTest *PodmanTestIntegration
containerStorageDir string containerStorageDir string
dbDir string dbDir string
runContainerStorageDir string runContainerStorageDir string
@ -23,25 +18,12 @@ var _ = Describe("Podman run with volumes", func() {
) )
BeforeEach(func() { BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
containerStorageDir = filepath.Join(podmanTest.Root, podmanTest.ImageCacheFS+"-containers") containerStorageDir = filepath.Join(podmanTest.Root, podmanTest.ImageCacheFS+"-containers")
dbDir = filepath.Join(podmanTest.Root, "libpod") dbDir = filepath.Join(podmanTest.Root, "libpod")
runContainerStorageDir = filepath.Join(podmanTest.RunRoot, podmanTest.ImageCacheFS+"-containers") runContainerStorageDir = filepath.Join(podmanTest.RunRoot, podmanTest.ImageCacheFS+"-containers")
runDBDir = tempdir runDBDir = tempdir
}) })
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run with no transient-store", func() { It("podman run with no transient-store", func() {
session := podmanTest.Podman([]string{"run", ALPINE, "true"}) session := podmanTest.Podman([]string{"run", ALPINE, "true"})
session.WaitWithDefaultTimeout() session.WaitWithDefaultTimeout()

View File

@ -7,7 +7,6 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
. "github.com/containers/podman/v4/test/utils"
"github.com/containers/storage" "github.com/containers/storage"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
@ -28,12 +27,6 @@ func createContainersConfFileWithCustomUserns(pTest *PodmanTestIntegration, user
} }
var _ = Describe("Podman UserNS support", func() { var _ = Describe("Podman UserNS support", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
if os.Getenv("SKIP_USERNS") != "" { if os.Getenv("SKIP_USERNS") != "" {
Skip("Skip userns tests.") Skip("Skip userns tests.")
@ -41,19 +34,6 @@ var _ = Describe("Podman UserNS support", func() {
if _, err := os.Stat("/proc/self/uid_map"); err != nil { if _, err := os.Stat("/proc/self/uid_map"); err != nil {
Skip("User namespaces not supported.") Skip("User namespaces not supported.")
} }
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
os.Unsetenv("CONTAINERS_CONF")
}) })
// Note: Lot of tests for build with --userns=auto are already there in buildah // Note: Lot of tests for build with --userns=auto are already there in buildah

View File

@ -19,26 +19,6 @@ import (
const dest = "/unique/path" const dest = "/unique/path"
var _ = Describe("Podman run with volumes", func() { var _ = Describe("Podman run with volumes", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
// Returns the /proc/self/mountinfo line for a given mount point // Returns the /proc/self/mountinfo line for a given mount point
getMountInfo := func(volume string) []string { getMountInfo := func(volume string) []string {

View File

@ -5,34 +5,12 @@ import (
"os" "os"
"path/filepath" "path/filepath"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec" . "github.com/onsi/gomega/gexec"
) )
var _ = Describe("Podman run", func() { var _ = Describe("Podman run", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman run a container without workdir", func() { It("podman run a container without workdir", func() {
session := podmanTest.Podman([]string{"run", ALPINE, "pwd"}) session := podmanTest.Podman([]string{"run", ALPINE, "pwd"})

View File

@ -2,7 +2,6 @@ package integration
import ( import (
"fmt" "fmt"
"os"
. "github.com/containers/podman/v4/test/utils" . "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
@ -23,27 +22,9 @@ FROM %s
LABEL RUN podman run --name NAME IMAGE`, ALPINE) LABEL RUN podman run --name NAME IMAGE`, ALPINE)
var _ = Describe("podman container runlabel", func() { var _ = Describe("podman container runlabel", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() { BeforeEach(func() {
SkipIfRemote("runlabel is not supported for remote connections") SkipIfRemote("runlabel is not supported for remote connections")
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
}) })
It("podman container runlabel (podman --version)", func() { It("podman container runlabel (podman --version)", func() {

View File

@ -14,27 +14,6 @@ import (
) )
var _ = Describe("Podman save", func() { var _ = Describe("Podman save", func() {
var (
tempdir string
err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentSpecReport()
processTestResult(f)
})
It("podman save output flag", func() { It("podman save output flag", func() {
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar") outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")

Some files were not shown because too many files have changed in this diff Show More