diff options
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/build_test.go | 42 | ||||
-rw-r--r-- | test/e2e/common_test.go | 2 | ||||
-rw-r--r-- | test/e2e/generate_kube_test.go | 4 | ||||
-rw-r--r-- | test/e2e/run_test.go | 24 |
4 files changed, 36 insertions, 36 deletions
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index 4839d66ec..e061a2154 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -39,7 +39,7 @@ var _ = Describe("Podman build", func() { // happy and then clean up after ourselves to make sure that works too. It("podman build and remove basic alpine", func() { podmanTest.AddImageToRWStore(ALPINE) - session := podmanTest.Podman([]string{"build", "build/basicalpine"}) + session := podmanTest.Podman([]string{"build", "--pull-never", "build/basicalpine"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -59,7 +59,7 @@ var _ = Describe("Podman build", func() { It("podman build with logfile", func() { logfile := filepath.Join(podmanTest.TempDir, "logfile") - session := podmanTest.Podman([]string{"build", "--tag", "test", "--logfile", logfile, "build/basicalpine"}) + session := podmanTest.Podman([]string{"build", "--pull-never", "--tag", "test", "--logfile", logfile, "build/basicalpine"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -82,7 +82,7 @@ var _ = Describe("Podman build", func() { // If the context directory is pointing at a file and not a directory, // that's a no no, fail out. It("podman build context directory a file", func() { - session := podmanTest.Podman([]string{"build", "build/context_dir_a_file"}) + session := podmanTest.Podman([]string{"build", "--pull-never", "build/context_dir_a_file"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(125)) }) @@ -90,7 +90,7 @@ var _ = Describe("Podman build", func() { // Check that builds with different values for the squash options // create the appropriate number of layers, then clean up after. It("podman build basic alpine with squash", func() { - session := podmanTest.Podman([]string{"build", "-f", "build/squash/Dockerfile.squash-a", "-t", "test-squash-a:latest", "build/squash"}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/squash/Dockerfile.squash-a", "-t", "test-squash-a:latest", "build/squash"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -100,7 +100,7 @@ var _ = Describe("Podman build", func() { // Check for two layers Expect(len(strings.Fields(session.OutputToString()))).To(Equal(2)) - session = podmanTest.Podman([]string{"build", "-f", "build/squash/Dockerfile.squash-b", "--squash", "-t", "test-squash-b:latest", "build/squash"}) + session = podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/squash/Dockerfile.squash-b", "--squash", "-t", "test-squash-b:latest", "build/squash"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -110,7 +110,7 @@ var _ = Describe("Podman build", func() { // Check for three layers Expect(len(strings.Fields(session.OutputToString()))).To(Equal(3)) - session = podmanTest.Podman([]string{"build", "-f", "build/squash/Dockerfile.squash-c", "--squash", "-t", "test-squash-c:latest", "build/squash"}) + session = podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/squash/Dockerfile.squash-c", "--squash", "-t", "test-squash-c:latest", "build/squash"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -120,7 +120,7 @@ var _ = Describe("Podman build", func() { // Check for two layers Expect(len(strings.Fields(session.OutputToString()))).To(Equal(2)) - session = podmanTest.Podman([]string{"build", "-f", "build/squash/Dockerfile.squash-c", "--squash-all", "-t", "test-squash-d:latest", "build/squash"}) + session = podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/squash/Dockerfile.squash-c", "--squash-all", "-t", "test-squash-d:latest", "build/squash"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -162,7 +162,7 @@ var _ = Describe("Podman build", func() { // When session := podmanTest.Podman([]string{ - "build", "-f", targetFile, "-t", "test-locations", + "build", "--pull-never", "-f", targetFile, "-t", "test-locations", }) session.WaitWithDefaultTimeout() @@ -185,7 +185,7 @@ var _ = Describe("Podman build", func() { } targetFile := filepath.Join(targetPath, "idFile") - session := podmanTest.Podman([]string{"build", "build/basicalpine", "--iidfile", targetFile}) + session := podmanTest.Podman([]string{"build", "--pull-never", "build/basicalpine", "--iidfile", targetFile}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) id, _ := ioutil.ReadFile(targetFile) @@ -200,7 +200,7 @@ var _ = Describe("Podman build", func() { It("podman Test PATH in built image", func() { path := "/tmp:/bin:/usr/bin:/usr/sbin" session := podmanTest.Podman([]string{ - "build", "-f", "build/basicalpine/Containerfile.path", "-t", "test-path", + "build", "--pull-never", "-f", "build/basicalpine/Containerfile.path", "-t", "test-path", }) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -225,7 +225,7 @@ RUN printenv http_proxy` dockerfilePath := filepath.Join(podmanTest.TempDir, "Dockerfile") err := ioutil.WriteFile(dockerfilePath, []byte(dockerfile), 0755) Expect(err).To(BeNil()) - session := podmanTest.Podman([]string{"build", "--http-proxy", "--file", dockerfilePath, podmanTest.TempDir}) + session := podmanTest.Podman([]string{"build", "--pull-never", "--http-proxy", "--file", dockerfilePath, podmanTest.TempDir}) session.Wait(120) Expect(session.ExitCode()).To(Equal(0)) ok, _ := session.GrepString("1.2.3.4") @@ -234,7 +234,7 @@ RUN printenv http_proxy` }) It("podman build and check identity", func() { - session := podmanTest.Podman([]string{"build", "-f", "build/basicalpine/Containerfile.path", "--no-cache", "-t", "test", "build/basicalpine"}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-f", "build/basicalpine/Containerfile.path", "--no-cache", "-t", "test", "build/basicalpine"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -279,7 +279,7 @@ RUN find /test` // make cwd as context root path Expect(os.Chdir(targetPath)).To(BeNil()) - session := podmanTest.Podman([]string{"build", "-t", "test", "-f", "Containerfile", targetSubPath}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", "-f", "Containerfile", targetSubPath}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) ok, _ := session.GrepString("/test/dummy") @@ -321,7 +321,7 @@ RUN find /test` // make cwd as context root path Expect(os.Chdir(targetPath)).To(BeNil()) - session := podmanTest.Podman([]string{"build", "-t", "test", "-f", "subdir/Containerfile", "."}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", "-f", "subdir/Containerfile", "."}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) @@ -445,7 +445,7 @@ RUN [[ -L /test/dummy-symlink ]] && echo SYMLNKOK || echo SYMLNKERR` // make cwd as context root path Expect(os.Chdir(targetPath)).To(BeNil()) - session := podmanTest.Podman([]string{"build", "-t", "test", targetSubPath}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", targetSubPath}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) ok, _ := session.GrepString("/test/dummy") @@ -475,7 +475,7 @@ RUN grep CapEff /proc/self/status` // When session := podmanTest.Podman([]string{ - "build", "--cap-drop=all", "--cap-add=net_bind_service", "--add-host", "testhost:1.2.3.4", "--from", "alpine", targetPath, + "build", "--pull-never", "--cap-drop=all", "--cap-add=net_bind_service", "--add-host", "testhost:1.2.3.4", "--from", "alpine", targetPath, }) session.WaitWithDefaultTimeout() @@ -502,7 +502,7 @@ RUN grep CapEff /proc/self/status` // When session := podmanTest.Podman([]string{ - "build", "--isolation", "oci", "--arch", "arm64", targetPath, + "build", "--pull-never", "--isolation", "oci", "--arch", "arm64", targetPath, }) session.WaitWithDefaultTimeout() // Then @@ -510,7 +510,7 @@ RUN grep CapEff /proc/self/status` // When session = podmanTest.Podman([]string{ - "build", "--isolation", "chroot", "--arch", "arm64", targetPath, + "build", "--pull-never", "--isolation", "chroot", "--arch", "arm64", targetPath, }) session.WaitWithDefaultTimeout() // Then @@ -518,7 +518,7 @@ RUN grep CapEff /proc/self/status` // When session = podmanTest.Podman([]string{ - "build", "--isolation", "rootless", "--arch", "arm64", targetPath, + "build", "--pull-never", "--isolation", "rootless", "--arch", "arm64", targetPath, }) session.WaitWithDefaultTimeout() // Then @@ -526,7 +526,7 @@ RUN grep CapEff /proc/self/status` // When session = podmanTest.Podman([]string{ - "build", "--isolation", "bogus", "--arch", "arm64", targetPath, + "build", "--pull-never", "--isolation", "bogus", "--arch", "arm64", targetPath, }) session.WaitWithDefaultTimeout() // Then @@ -540,7 +540,7 @@ RUN echo hello` containerfilePath := filepath.Join(podmanTest.TempDir, "Containerfile") err := ioutil.WriteFile(containerfilePath, []byte(containerfile), 0755) Expect(err).To(BeNil()) - session := podmanTest.Podman([]string{"build", "-t", "test", "--timestamp", "0", "--file", containerfilePath, podmanTest.TempDir}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-t", "test", "--timestamp", "0", "--file", containerfilePath, podmanTest.TempDir}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 70ffdebea..9ae56d7ce 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -440,7 +440,7 @@ func (p *PodmanTestIntegration) BuildImage(dockerfile, imageName string, layers dockerfilePath := filepath.Join(p.TempDir, "Dockerfile") err := ioutil.WriteFile(dockerfilePath, []byte(dockerfile), 0755) Expect(err).To(BeNil()) - cmd := []string{"build", "--layers=" + layers, "--file", dockerfilePath} + cmd := []string{"build", "--pull-never", "--layers=" + layers, "--file", dockerfilePath} if len(imageName) > 0 { cmd = append(cmd, []string{"-t", imageName}...) } diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index 21e006c20..bc7c21785 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -675,7 +675,7 @@ ENTRYPOINT /bin/sleep` Expect(err).To(BeNil()) image := "generatekube:test" - session := podmanTest.Podman([]string{"build", "-f", containerfilePath, "-t", image}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-f", containerfilePath, "-t", image}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -748,7 +748,7 @@ USER test1` Expect(err).To(BeNil()) image := "generatekube:test" - session := podmanTest.Podman([]string{"build", "-f", containerfilePath, "-t", image}) + session := podmanTest.Podman([]string{"build", "--pull-never", "-f", containerfilePath, "-t", image}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 490d05699..4e5106731 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -576,23 +576,23 @@ USER bin` }) It("podman run blkio-weight test", func() { - SkipIfRootless("FIXME: This is blowing up because of no /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control file") SkipIfRootlessCgroupsV1("Setting blkio-weight not supported on cgroupv1 for rootless users") - if !CGROUPSV2 { - if _, err := os.Stat("/sys/fs/cgroup/blkio/blkio.weight"); os.IsNotExist(err) { - Skip("Kernel does not support blkio.weight") - } - } - if podmanTest.Host.Distribution == "ubuntu" { - Skip("Ubuntu <= 20.10 lacks BFQ scheduler") - } + SkipIfRootless("By default systemd doesn't delegate io to rootless users") if CGROUPSV2 { - // convert linearly from [10-1000] to [1-10000] - session := podmanTest.Podman([]string{"run", "--rm", "--blkio-weight=15", ALPINE, "sh", "-c", "cat /sys/fs/cgroup/$(sed -e 's|0::||' < /proc/self/cgroup)/io.bfq.weight"}) + if _, err := os.Stat("/sys/fs/cgroup/io.stat"); os.IsNotExist(err) { + Skip("Kernel does not have io.stat") + } + session := podmanTest.Podman([]string{"run", "--rm", "--blkio-weight=15", ALPINE, "sh", "-c", "cat /sys/fs/cgroup/io.bfq.weight"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - Expect(session.OutputToString()).To(ContainSubstring("51")) + // there was a documentation issue in the kernel that reported a different range [1-10000] for the io controller. + // older versions of crun/runc used it. For the time being allow both versions to pass the test. + // FIXME: drop "|51" once all the runtimes we test have the fix in place. + Expect(strings.Replace(session.OutputToString(), "default ", "", 1)).To(MatchRegexp("15|51")) } else { + if _, err := os.Stat("/sys/fs/cgroup/blkio/blkio.weight"); os.IsNotExist(err) { + Skip("Kernel does not support blkio.weight") + } session := podmanTest.Podman([]string{"run", "--rm", "--blkio-weight=15", ALPINE, "cat", "/sys/fs/cgroup/blkio/blkio.weight"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) |