diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/checkpoint_test.go | 7 | ||||
-rw-r--r-- | test/e2e/exec_test.go | 1 | ||||
-rw-r--r-- | test/e2e/libpod_suite_test.go | 37 | ||||
-rw-r--r-- | test/e2e/run_test.go | 2 | ||||
-rw-r--r-- | test/e2e/stats_test.go | 19 |
5 files changed, 8 insertions, 58 deletions
diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go index 6c5d891a0..928a76324 100644 --- a/test/e2e/checkpoint_test.go +++ b/test/e2e/checkpoint_test.go @@ -4,6 +4,7 @@ import ( "fmt" "os" + "github.com/containers/libpod/pkg/criu" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) @@ -22,10 +23,8 @@ var _ = Describe("Podman checkpoint", func() { } podmanTest = PodmanCreate(tempdir) podmanTest.RestoreAllArtifacts() - // At least CRIU 3.11 is needed - skip, err := podmanTest.isCriuAtLeast(31100) - if err != nil || skip { - Skip("CRIU missing or too old.") + if !criu.CheckForCriu() { + Skip("CRIU is missing or too old.") } }) diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go index cfdc819a6..250e08704 100644 --- a/test/e2e/exec_test.go +++ b/test/e2e/exec_test.go @@ -111,6 +111,7 @@ var _ = Describe("Podman exec", func() { }) It("podman exec with user only in container", func() { + podmanTest.RestoreArtifact(fedoraMinimal) testUser := "test123" setup := podmanTest.Podman([]string{"run", "--name", "test1", "-d", fedoraMinimal, "sleep", "60"}) setup.WaitWithDefaultTimeout() diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index f34e9c5e7..56a603f3e 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -2,7 +2,6 @@ package integration import ( "bufio" - "bytes" "context" "encoding/json" "fmt" @@ -65,7 +64,6 @@ type PodmanTest struct { TempDir string CgroupManager string Host HostOS - CriuBinary string } // HostOS is a simple struct for the test os @@ -166,7 +164,6 @@ func PodmanCreate(tempDir string) PodmanTest { runCBinary = "/usr/bin/runc" } - criuBinary := "/usr/sbin/criu" CNIConfigDir := "/etc/cni/net.d" p := PodmanTest{ @@ -182,7 +179,6 @@ func PodmanCreate(tempDir string) PodmanTest { TempDir: tempDir, CgroupManager: cgroupManager, Host: host, - CriuBinary: criuBinary, } // Setup registries.conf ENV variable @@ -688,39 +684,6 @@ func (p *PodmanTest) setRegistriesConfigEnv(b []byte) { ioutil.WriteFile(outfile, b, 0644) } -func (p *PodmanTest) isCriuAtLeast(version int) (bool, error) { - cmd := exec.Command(p.CriuBinary, "-V") - var out bytes.Buffer - cmd.Stdout = &out - err := cmd.Run() - if err != nil { - return false, err - } - - var x int - var y int - var z int - - fmt.Sscanf(out.String(), "Version: %d.%d.%d", &x, &y, &z) - - if strings.Contains(out.String(), "GitID") { - // If CRIU is built from git it contains a git ID. - // If that is the case, increase minor by one as this - // could mean we are running a development version. - y = y + 1 - } - - parsed_version := x*10000 + y*100 + z - - fmt.Println(parsed_version) - - if parsed_version >= version { - return false, nil - } else { - return true, nil - } -} - func resetRegistriesConfigEnv() { os.Setenv("REGISTRIES_CONFIG_PATH", "") } diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 1cd2fdf2c..cb436ccca 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -577,6 +577,7 @@ USER mail` }) It("podman run findmnt nothing shared", func() { + podmanTest.RestoreArtifact(fedoraMinimal) vol1 := filepath.Join(podmanTest.TempDir, "vol-test1") err := os.MkdirAll(vol1, 0755) Expect(err).To(BeNil()) @@ -592,6 +593,7 @@ USER mail` }) It("podman run findmnt shared", func() { + podmanTest.RestoreArtifact(fedoraMinimal) vol1 := filepath.Join(podmanTest.TempDir, "vol-test1") err := os.MkdirAll(vol1, 0755) Expect(err).To(BeNil()) diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go index 8096f58b2..e456d7114 100644 --- a/test/e2e/stats_test.go +++ b/test/e2e/stats_test.go @@ -31,12 +31,6 @@ var _ = Describe("Podman stats", func() { GinkgoWriter.Write([]byte(timedResult)) }) - It("podman stats should run with no containers", func() { - session := podmanTest.Podman([]string{"stats", "--no-stream"}) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - }) - It("podman stats with bogus container", func() { session := podmanTest.Podman([]string{"stats", "--no-stream", "123"}) session.WaitWithDefaultTimeout() @@ -53,15 +47,6 @@ var _ = Describe("Podman stats", func() { Expect(session.ExitCode()).To(Equal(0)) }) - It("podman stats on a running container no id", func() { - session := podmanTest.RunTopContainer("") - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - session = podmanTest.Podman([]string{"stats", "--no-stream"}) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - }) - It("podman stats on all containers", func() { session := podmanTest.RunTopContainer("") session.WaitWithDefaultTimeout() @@ -75,7 +60,7 @@ var _ = Describe("Podman stats", func() { session := podmanTest.RunTopContainer("") session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - session = podmanTest.Podman([]string{"stats", "--no-stream", "--format", "\"{{.Container}}\""}) + session = podmanTest.Podman([]string{"stats", "--all", "--no-stream", "--format", "\"{{.Container}}\""}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) @@ -84,7 +69,7 @@ var _ = Describe("Podman stats", func() { session := podmanTest.RunTopContainer("") session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - session = podmanTest.Podman([]string{"stats", "--no-stream", "--format", "json"}) + session = podmanTest.Podman([]string{"stats", "--all", "--no-stream", "--format", "json"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) Expect(session.IsJSONOutputValid()).To(BeTrue()) |