Skip to content

Commit

Permalink
Merge pull request #24225 from Luap99/pasta-hang
Browse files Browse the repository at this point in the history
test/e2e: try debug potential pasta issue
  • Loading branch information
openshift-merge-bot[bot] authored Oct 10, 2024
2 parents 9a887d1 + f517e52 commit 569d005
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 2 deletions.
25 changes: 24 additions & 1 deletion test/e2e/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package integration

import (
"fmt"
"io"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -664,13 +665,33 @@ var _ = Describe("Podman pull", func() {

podmanTest.AddImageToRWStore(ALPINE)

success := false
registryArgs := []string{"run", "-d", "--name", "registry", "-p", "5012:5000"}
if isRootless() {
err := podmanTest.RestoreArtifact(REGISTRY_IMAGE)
Expect(err).ToNot(HaveOccurred())

// Debug code for https://github.com/containers/podman/issues/24219
logFile := filepath.Join(podmanTest.TempDir, "pasta.log")
registryArgs = append(registryArgs, "--network", "pasta:--trace,--log-file,"+logFile)
defer func() {
if success {
// only print the log on errors otherwise it will clutter CI logs way to much
return
}

f, err := os.Open(logFile)
Expect(err).ToNot(HaveOccurred())
defer f.Close()
GinkgoWriter.Println("pasta trace log:")
_, err = io.Copy(GinkgoWriter, f)
Expect(err).ToNot(HaveOccurred())
}()
}
registryArgs = append(registryArgs, REGISTRY_IMAGE, "/entrypoint.sh", "/etc/docker/registry/config.yml")
lock := GetPortLock("5012")
defer lock.Unlock()
session := podmanTest.Podman([]string{"run", "-d", "--name", "registry", "-p", "5012:5000", REGISTRY_IMAGE, "/entrypoint.sh", "/etc/docker/registry/config.yml"})
session := podmanTest.Podman(registryArgs)
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())

Expand All @@ -683,6 +704,8 @@ var _ = Describe("Podman pull", func() {
session = decryptionTestHelper(imgPath)

Expect(session.LineInOutputContainsTag(imgPath, "latest")).To(BeTrue())

success = true
})
})

Expand Down
27 changes: 26 additions & 1 deletion test/e2e/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package integration

import (
"fmt"
"io"
"net"
"os"
"path/filepath"
Expand Down Expand Up @@ -2182,9 +2183,31 @@ WORKDIR /madethis`, BB)

podmanTest.AddImageToRWStore(ALPINE)

success := false
registryArgs := []string{"run", "-d", "--name", "registry", "-p", "5006:5000"}
if isRootless() {
// Debug code for https://github.com/containers/podman/issues/24219
logFile := filepath.Join(podmanTest.TempDir, "pasta.log")
registryArgs = append(registryArgs, "--network", "pasta:--trace,--log-file,"+logFile)
defer func() {
if success {
// only print the log on errors otherwise it will clutter CI logs way to much
return
}

f, err := os.Open(logFile)
Expect(err).ToNot(HaveOccurred())
defer f.Close()
GinkgoWriter.Println("pasta trace log:")
_, err = io.Copy(GinkgoWriter, f)
Expect(err).ToNot(HaveOccurred())
}()
}
registryArgs = append(registryArgs, REGISTRY_IMAGE, "/entrypoint.sh", "/etc/docker/registry/config.yml")

lock := GetPortLock("5006")
defer lock.Unlock()
session := podmanTest.Podman([]string{"run", "-d", "--name", "registry", "-p", "5006:5000", REGISTRY_IMAGE, "/entrypoint.sh", "/etc/docker/registry/config.yml"})
session := podmanTest.Podman(registryArgs)
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())

Expand Down Expand Up @@ -2218,6 +2241,8 @@ WORKDIR /madethis`, BB)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session.ErrorToString()).To(ContainSubstring("Trying to pull " + imgPath))

success = true
})

It("podman run --shm-size-systemd", func() {
Expand Down

1 comment on commit 569d005

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.