test/e2e: try debug potential pasta issue

Run pasta with --trace and a log file to see if the hangs are caused by
pasta not correctly closing connections as assumed in #24219.

As the log is super verbose do not log it by default so I added some
extra logic to make sure it is only logged when the test fails.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger 2024-10-10 12:00:25 +02:00
parent 9a887d1600
commit f517e52167
No known key found for this signature in database
GPG Key ID: EB145DD938A3CAF2
2 changed files with 50 additions and 2 deletions

View File

@ -4,6 +4,7 @@ package integration
import (
"fmt"
"io"
"os"
"path/filepath"
"runtime"
@ -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())
@ -683,6 +704,8 @@ var _ = Describe("Podman pull", func() {
session = decryptionTestHelper(imgPath)
Expect(session.LineInOutputContainsTag(imgPath, "latest")).To(BeTrue())
success = true
})
})

View File

@ -4,6 +4,7 @@ package integration
import (
"fmt"
"io"
"net"
"os"
"path/filepath"
@ -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())
@ -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() {