mirror of https://github.com/containers/podman.git
Merge pull request #20176 from edsantiago/e2e_check_stderr__more
e2e: ExitCleanly(): the final step
This commit is contained in:
commit
46a1e25eb2
|
|
@ -7,7 +7,6 @@ import (
|
||||||
. "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"
|
||||||
. "github.com/onsi/gomega/gexec"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Podman export", func() {
|
var _ = Describe("Podman export", func() {
|
||||||
|
|
@ -19,7 +18,7 @@ var _ = Describe("Podman export", func() {
|
||||||
outfile := filepath.Join(podmanTest.TempDir, "container.tar")
|
outfile := filepath.Join(podmanTest.TempDir, "container.tar")
|
||||||
result := podmanTest.Podman([]string{"export", "-o", outfile, cid})
|
result := podmanTest.Podman([]string{"export", "-o", outfile, cid})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
_, err := os.Stat(outfile)
|
_, err := os.Stat(outfile)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
|
|
@ -34,7 +33,7 @@ var _ = Describe("Podman export", func() {
|
||||||
outfile := filepath.Join(podmanTest.TempDir, "container.tar")
|
outfile := filepath.Join(podmanTest.TempDir, "container.tar")
|
||||||
result := podmanTest.Podman([]string{"container", "export", "-o", outfile, cid})
|
result := podmanTest.Podman([]string{"container", "export", "-o", outfile, cid})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
_, err := os.Stat(outfile)
|
_, err := os.Stat(outfile)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/containers/podman/v4/pkg/systemd/parser"
|
"github.com/containers/podman/v4/pkg/systemd/parser"
|
||||||
|
. "github.com/containers/podman/v4/test/utils"
|
||||||
"github.com/containers/podman/v4/version"
|
"github.com/containers/podman/v4/version"
|
||||||
"github.com/mattn/go-shellwords"
|
"github.com/mattn/go-shellwords"
|
||||||
|
|
||||||
|
|
@ -434,7 +435,7 @@ var _ = Describe("quadlet system generator", 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")
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(Equal(version.Version.String()))
|
Expect(session.OutputToString()).To(Equal(version.Version.String()))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
@ -512,6 +513,7 @@ BOGUS=foo
|
||||||
session := podmanTest.Quadlet([]string{"-dryrun"}, quadletDir)
|
session := podmanTest.Quadlet([]string{"-dryrun"}, quadletDir)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(Exit(0))
|
||||||
|
Expect(session.ErrorToString()).To(ContainSubstring("Loading source unit file "))
|
||||||
|
|
||||||
current := session.OutputToStringArray()
|
current := session.OutputToStringArray()
|
||||||
expected := []string{
|
expected := []string{
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ var _ = Describe("Podman restart", func() {
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"restart", "test1"})
|
session := podmanTest.Podman([]string{"restart", "test1"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1"})
|
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1"})
|
||||||
restartTime.WaitWithDefaultTimeout()
|
restartTime.WaitWithDefaultTimeout()
|
||||||
Expect(restartTime.OutputToString()).To(Not(Equal(startTime.OutputToString())))
|
Expect(restartTime.OutputToString()).To(Not(Equal(startTime.OutputToString())))
|
||||||
|
|
@ -35,18 +35,18 @@ var _ = Describe("Podman restart", func() {
|
||||||
It("podman restart stopped container by ID", func() {
|
It("podman restart stopped container by ID", func() {
|
||||||
session := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
session := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
cid := session.OutputToString()
|
cid := session.OutputToString()
|
||||||
startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", cid})
|
startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", cid})
|
||||||
startTime.WaitWithDefaultTimeout()
|
startTime.WaitWithDefaultTimeout()
|
||||||
|
|
||||||
startSession := podmanTest.Podman([]string{"start", "--attach", cid})
|
startSession := podmanTest.Podman([]string{"start", "--attach", cid})
|
||||||
startSession.WaitWithDefaultTimeout()
|
startSession.WaitWithDefaultTimeout()
|
||||||
Expect(startSession).Should(Exit(0))
|
Expect(startSession).Should(ExitCleanly())
|
||||||
|
|
||||||
session2 := podmanTest.Podman([]string{"restart", cid})
|
session2 := podmanTest.Podman([]string{"restart", cid})
|
||||||
session2.WaitWithDefaultTimeout()
|
session2.WaitWithDefaultTimeout()
|
||||||
Expect(session2).Should(Exit(0))
|
Expect(session2).Should(ExitCleanly())
|
||||||
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", cid})
|
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", cid})
|
||||||
restartTime.WaitWithDefaultTimeout()
|
restartTime.WaitWithDefaultTimeout()
|
||||||
Expect(restartTime.OutputToString()).To(Not(Equal(startTime.OutputToString())))
|
Expect(restartTime.OutputToString()).To(Not(Equal(startTime.OutputToString())))
|
||||||
|
|
@ -61,7 +61,7 @@ var _ = Describe("Podman restart", func() {
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"restart", "test1"})
|
session := podmanTest.Podman([]string{"restart", "test1"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1"})
|
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1"})
|
||||||
restartTime.WaitWithDefaultTimeout()
|
restartTime.WaitWithDefaultTimeout()
|
||||||
Expect(restartTime.OutputToString()).To(Not(Equal(startTime.OutputToString())))
|
Expect(restartTime.OutputToString()).To(Not(Equal(startTime.OutputToString())))
|
||||||
|
|
@ -76,7 +76,7 @@ var _ = Describe("Podman restart", func() {
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"container", "restart", "test1"})
|
session := podmanTest.Podman([]string{"container", "restart", "test1"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
restartTime := podmanTest.Podman([]string{"container", "inspect", "--format='{{.State.StartedAt}}'", "test1"})
|
restartTime := podmanTest.Podman([]string{"container", "inspect", "--format='{{.State.StartedAt}}'", "test1"})
|
||||||
restartTime.WaitWithDefaultTimeout()
|
restartTime.WaitWithDefaultTimeout()
|
||||||
Expect(restartTime.OutputToString()).To(Not(Equal(startTime.OutputToString())))
|
Expect(restartTime.OutputToString()).To(Not(Equal(startTime.OutputToString())))
|
||||||
|
|
@ -93,7 +93,7 @@ var _ = Describe("Podman restart", func() {
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"restart", "test1", "test2"})
|
session := podmanTest.Podman([]string{"restart", "test1", "test2"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
||||||
restartTime.WaitWithDefaultTimeout()
|
restartTime.WaitWithDefaultTimeout()
|
||||||
Expect(restartTime.OutputToStringArray()[0]).To(Not(Equal(startTime.OutputToStringArray()[0])))
|
Expect(restartTime.OutputToStringArray()[0]).To(Not(Equal(startTime.OutputToStringArray()[0])))
|
||||||
|
|
@ -116,7 +116,7 @@ var _ = Describe("Podman restart", func() {
|
||||||
}
|
}
|
||||||
session := podmanTest.Podman([]string{"restart", cid})
|
session := podmanTest.Podman([]string{"restart", cid})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
||||||
restartTime.WaitWithDefaultTimeout()
|
restartTime.WaitWithDefaultTimeout()
|
||||||
Expect(restartTime.OutputToStringArray()[0]).To(Equal(startTime.OutputToStringArray()[0]))
|
Expect(restartTime.OutputToStringArray()[0]).To(Equal(startTime.OutputToStringArray()[0]))
|
||||||
|
|
@ -126,7 +126,7 @@ var _ = Describe("Podman restart", func() {
|
||||||
It("podman restart non-stop container with short timeout", func() {
|
It("podman restart non-stop container with short timeout", func() {
|
||||||
session := podmanTest.Podman([]string{"run", "-d", "--name", "test1", "--env", "STOPSIGNAL=SIGKILL", ALPINE, "sleep", "999"})
|
session := podmanTest.Podman([]string{"run", "-d", "--name", "test1", "--env", "STOPSIGNAL=SIGKILL", ALPINE, "sleep", "999"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
session = podmanTest.Podman([]string{"restart", "-t", "2", "test1"})
|
session = podmanTest.Podman([]string{"restart", "-t", "2", "test1"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
|
|
@ -134,6 +134,12 @@ var _ = Describe("Podman restart", func() {
|
||||||
timeSince := time.Since(startTime)
|
timeSince := time.Since(startTime)
|
||||||
Expect(timeSince).To(BeNumerically("<", 10*time.Second))
|
Expect(timeSince).To(BeNumerically("<", 10*time.Second))
|
||||||
Expect(timeSince).To(BeNumerically(">", 2*time.Second))
|
Expect(timeSince).To(BeNumerically(">", 2*time.Second))
|
||||||
|
stderr := session.ErrorToString()
|
||||||
|
if IsRemote() {
|
||||||
|
Expect(stderr).To(BeEmpty())
|
||||||
|
} else {
|
||||||
|
Expect(stderr).To(ContainSubstring("StopSignal SIGTERM failed to stop container test1 in 2 seconds, resorting to SIGKILL"))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman restart --all", func() {
|
It("podman restart --all", func() {
|
||||||
|
|
@ -142,14 +148,14 @@ var _ = Describe("Podman restart", func() {
|
||||||
|
|
||||||
test2 := podmanTest.RunTopContainer("test2")
|
test2 := podmanTest.RunTopContainer("test2")
|
||||||
test2.WaitWithDefaultTimeout()
|
test2.WaitWithDefaultTimeout()
|
||||||
Expect(test2).Should(Exit(0))
|
Expect(test2).Should(ExitCleanly())
|
||||||
|
|
||||||
startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
||||||
startTime.WaitWithDefaultTimeout()
|
startTime.WaitWithDefaultTimeout()
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"restart", "--all"})
|
session := podmanTest.Podman([]string{"restart", "--all"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
||||||
restartTime.WaitWithDefaultTimeout()
|
restartTime.WaitWithDefaultTimeout()
|
||||||
Expect(restartTime.OutputToStringArray()[0]).To(Not(Equal(startTime.OutputToStringArray()[0])))
|
Expect(restartTime.OutputToStringArray()[0]).To(Not(Equal(startTime.OutputToStringArray()[0])))
|
||||||
|
|
@ -162,14 +168,14 @@ var _ = Describe("Podman restart", func() {
|
||||||
|
|
||||||
test2 := podmanTest.RunTopContainer("test2")
|
test2 := podmanTest.RunTopContainer("test2")
|
||||||
test2.WaitWithDefaultTimeout()
|
test2.WaitWithDefaultTimeout()
|
||||||
Expect(test2).Should(Exit(0))
|
Expect(test2).Should(ExitCleanly())
|
||||||
|
|
||||||
startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
||||||
startTime.WaitWithDefaultTimeout()
|
startTime.WaitWithDefaultTimeout()
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"restart", "-a", "--running"})
|
session := podmanTest.Podman([]string{"restart", "-a", "--running"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
|
||||||
restartTime.WaitWithDefaultTimeout()
|
restartTime.WaitWithDefaultTimeout()
|
||||||
Expect(restartTime.OutputToStringArray()[0]).To(Equal(startTime.OutputToStringArray()[0]))
|
Expect(restartTime.OutputToStringArray()[0]).To(Equal(startTime.OutputToStringArray()[0]))
|
||||||
|
|
@ -184,22 +190,22 @@ var _ = Describe("Podman restart", func() {
|
||||||
|
|
||||||
session := podmanTest.RunTopContainerInPod("host-restart-test", "foobar99")
|
session := podmanTest.RunTopContainerInPod("host-restart-test", "foobar99")
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
testCmd := []string{"exec", "host-restart-test", "sh", "-c", "wc -l < /etc/hosts"}
|
testCmd := []string{"exec", "host-restart-test", "sh", "-c", "wc -l < /etc/hosts"}
|
||||||
|
|
||||||
// before restart
|
// before restart
|
||||||
beforeRestart := podmanTest.Podman(testCmd)
|
beforeRestart := podmanTest.Podman(testCmd)
|
||||||
beforeRestart.WaitWithDefaultTimeout()
|
beforeRestart.WaitWithDefaultTimeout()
|
||||||
Expect(beforeRestart).Should(Exit(0))
|
Expect(beforeRestart).Should(ExitCleanly())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"restart", "host-restart-test"})
|
session = podmanTest.Podman([]string{"restart", "host-restart-test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
afterRestart := podmanTest.Podman(testCmd)
|
afterRestart := podmanTest.Podman(testCmd)
|
||||||
afterRestart.WaitWithDefaultTimeout()
|
afterRestart.WaitWithDefaultTimeout()
|
||||||
Expect(afterRestart).Should(Exit(0))
|
Expect(afterRestart).Should(ExitCleanly())
|
||||||
|
|
||||||
// line count should be equal
|
// line count should be equal
|
||||||
Expect(beforeRestart.OutputToString()).To(Equal(afterRestart.OutputToString()))
|
Expect(beforeRestart.OutputToString()).To(Equal(afterRestart.OutputToString()))
|
||||||
|
|
@ -208,22 +214,22 @@ var _ = Describe("Podman restart", func() {
|
||||||
It("podman restart all stopped containers with --all", func() {
|
It("podman restart all stopped containers with --all", func() {
|
||||||
session := podmanTest.RunTopContainer("")
|
session := podmanTest.RunTopContainer("")
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
|
||||||
|
|
||||||
session = podmanTest.RunTopContainer("")
|
session = podmanTest.RunTopContainer("")
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2))
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"stop", "--all"})
|
session = podmanTest.Podman([]string{"stop", "--all"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"restart", "--all"})
|
session = podmanTest.Podman([]string{"restart", "--all"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2))
|
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -233,16 +239,16 @@ var _ = Describe("Podman restart", func() {
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"create", "--cidfile", tmpFile, ALPINE, "top"})
|
session := podmanTest.Podman([]string{"create", "--cidfile", tmpFile, ALPINE, "top"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
cid := session.OutputToStringArray()[0]
|
cid := session.OutputToStringArray()[0]
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"start", cid})
|
session = podmanTest.Podman([]string{"start", cid})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
result := podmanTest.Podman([]string{"restart", "--cidfile", tmpFile})
|
result := podmanTest.Podman([]string{"restart", "--cidfile", tmpFile})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
output := result.OutputToString()
|
output := result.OutputToString()
|
||||||
Expect(output).To(ContainSubstring(cid))
|
Expect(output).To(ContainSubstring(cid))
|
||||||
})
|
})
|
||||||
|
|
@ -254,19 +260,19 @@ var _ = Describe("Podman restart", func() {
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"run", "--cidfile", tmpFile1, "-d", ALPINE, "top"})
|
session := podmanTest.Podman([]string{"run", "--cidfile", tmpFile1, "-d", ALPINE, "top"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
cid1 := session.OutputToStringArray()[0]
|
cid1 := session.OutputToStringArray()[0]
|
||||||
Expect(podmanTest.NumberOfContainers()).To(Equal(1))
|
Expect(podmanTest.NumberOfContainers()).To(Equal(1))
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"run", "--cidfile", tmpFile2, "-d", ALPINE, "top"})
|
session = podmanTest.Podman([]string{"run", "--cidfile", tmpFile2, "-d", ALPINE, "top"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
cid2 := session.OutputToStringArray()[0]
|
cid2 := session.OutputToStringArray()[0]
|
||||||
Expect(podmanTest.NumberOfContainers()).To(Equal(2))
|
Expect(podmanTest.NumberOfContainers()).To(Equal(2))
|
||||||
|
|
||||||
result := podmanTest.Podman([]string{"restart", "--cidfile", tmpFile1, "--cidfile", tmpFile2})
|
result := podmanTest.Podman([]string{"restart", "--cidfile", tmpFile1, "--cidfile", tmpFile2})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
output := result.OutputToString()
|
output := result.OutputToString()
|
||||||
Expect(output).To(ContainSubstring(cid1))
|
Expect(output).To(ContainSubstring(cid1))
|
||||||
Expect(output).To(ContainSubstring(cid2))
|
Expect(output).To(ContainSubstring(cid2))
|
||||||
|
|
@ -296,17 +302,17 @@ var _ = Describe("Podman restart", func() {
|
||||||
It("podman restart --filter", func() {
|
It("podman restart --filter", func() {
|
||||||
session1 := podmanTest.RunTopContainer("")
|
session1 := podmanTest.RunTopContainer("")
|
||||||
session1.WaitWithDefaultTimeout()
|
session1.WaitWithDefaultTimeout()
|
||||||
Expect(session1).Should(Exit(0))
|
Expect(session1).Should(ExitCleanly())
|
||||||
cid1 := session1.OutputToString()
|
cid1 := session1.OutputToString()
|
||||||
|
|
||||||
session1 = podmanTest.RunTopContainer("")
|
session1 = podmanTest.RunTopContainer("")
|
||||||
session1.WaitWithDefaultTimeout()
|
session1.WaitWithDefaultTimeout()
|
||||||
Expect(session1).Should(Exit(0))
|
Expect(session1).Should(ExitCleanly())
|
||||||
cid2 := session1.OutputToString()
|
cid2 := session1.OutputToString()
|
||||||
|
|
||||||
session1 = podmanTest.RunTopContainerWithArgs("", []string{"--label", "test=with,comma"})
|
session1 = podmanTest.RunTopContainerWithArgs("", []string{"--label", "test=with,comma"})
|
||||||
session1.WaitWithDefaultTimeout()
|
session1.WaitWithDefaultTimeout()
|
||||||
Expect(session1).Should(Exit(0))
|
Expect(session1).Should(ExitCleanly())
|
||||||
cid3 := session1.OutputToString()
|
cid3 := session1.OutputToString()
|
||||||
shortCid3 := cid3[0:5]
|
shortCid3 := cid3[0:5]
|
||||||
|
|
||||||
|
|
@ -316,22 +322,22 @@ var _ = Describe("Podman restart", func() {
|
||||||
|
|
||||||
session1 = podmanTest.Podman([]string{"restart", "-a", "--filter", fmt.Sprintf("id=%swrongid", shortCid3)})
|
session1 = podmanTest.Podman([]string{"restart", "-a", "--filter", fmt.Sprintf("id=%swrongid", shortCid3)})
|
||||||
session1.WaitWithDefaultTimeout()
|
session1.WaitWithDefaultTimeout()
|
||||||
Expect(session1).Should(Exit(0))
|
Expect(session1).Should(ExitCleanly())
|
||||||
Expect(session1.OutputToString()).To(BeEmpty())
|
Expect(session1.OutputToString()).To(BeEmpty())
|
||||||
|
|
||||||
session1 = podmanTest.Podman([]string{"restart", "-a", "--filter", fmt.Sprintf("id=%s", shortCid3)})
|
session1 = podmanTest.Podman([]string{"restart", "-a", "--filter", fmt.Sprintf("id=%s", shortCid3)})
|
||||||
session1.WaitWithDefaultTimeout()
|
session1.WaitWithDefaultTimeout()
|
||||||
Expect(session1).Should(Exit(0))
|
Expect(session1).Should(ExitCleanly())
|
||||||
Expect(session1.OutputToString()).To(BeEquivalentTo(cid3))
|
Expect(session1.OutputToString()).To(BeEquivalentTo(cid3))
|
||||||
|
|
||||||
session1 = podmanTest.Podman([]string{"restart", "-a", "--filter", "label=test=with,comma"})
|
session1 = podmanTest.Podman([]string{"restart", "-a", "--filter", "label=test=with,comma"})
|
||||||
session1.WaitWithDefaultTimeout()
|
session1.WaitWithDefaultTimeout()
|
||||||
Expect(session1).Should(Exit(0))
|
Expect(session1).Should(ExitCleanly())
|
||||||
Expect(session1.OutputToString()).To(BeEquivalentTo(cid3))
|
Expect(session1.OutputToString()).To(BeEquivalentTo(cid3))
|
||||||
|
|
||||||
session1 = podmanTest.Podman([]string{"restart", "-f", fmt.Sprintf("id=%s", cid2)})
|
session1 = podmanTest.Podman([]string{"restart", "-f", fmt.Sprintf("id=%s", cid2)})
|
||||||
session1.WaitWithDefaultTimeout()
|
session1.WaitWithDefaultTimeout()
|
||||||
Expect(session1).Should(Exit(0))
|
Expect(session1).Should(ExitCleanly())
|
||||||
Expect(session1.OutputToString()).To(BeEquivalentTo(cid2))
|
Expect(session1.OutputToString()).To(BeEquivalentTo(cid2))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"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"
|
||||||
|
|
@ -14,11 +15,11 @@ var _ = Describe("Podman generate kube", func() {
|
||||||
It("podman empty security labels", func() {
|
It("podman empty security labels", func() {
|
||||||
test1 := podmanTest.Podman([]string{"create", "--label", "io.containers.capabilities=", "--name", "test1", "alpine", "echo", "test1"})
|
test1 := podmanTest.Podman([]string{"create", "--label", "io.containers.capabilities=", "--name", "test1", "alpine", "echo", "test1"})
|
||||||
test1.WaitWithDefaultTimeout()
|
test1.WaitWithDefaultTimeout()
|
||||||
Expect(test1).Should(Exit(0))
|
Expect(test1).Should(ExitCleanly())
|
||||||
|
|
||||||
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(ExitCleanly())
|
||||||
|
|
||||||
ctr := inspect.InspectContainerToJSON()
|
ctr := inspect.InspectContainerToJSON()
|
||||||
Expect(ctr[0].EffectiveCaps).To(BeNil())
|
Expect(ctr[0].EffectiveCaps).To(BeNil())
|
||||||
|
|
@ -31,11 +32,11 @@ var _ = Describe("Podman generate kube", func() {
|
||||||
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"})
|
||||||
test1.WaitWithDefaultTimeout()
|
test1.WaitWithDefaultTimeout()
|
||||||
Expect(test1).Should(Exit(0))
|
Expect(test1).Should(ExitCleanly())
|
||||||
|
|
||||||
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(ExitCleanly())
|
||||||
|
|
||||||
ctr := inspect.InspectContainerToJSON()
|
ctr := inspect.InspectContainerToJSON()
|
||||||
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
||||||
|
|
@ -46,10 +47,16 @@ var _ = Describe("Podman generate kube", func() {
|
||||||
test1 := podmanTest.Podman([]string{"create", "--label", "io.containers.capabilities=sys_admin", "--name", "test1", "alpine", "echo", "test1"})
|
test1 := podmanTest.Podman([]string{"create", "--label", "io.containers.capabilities=sys_admin", "--name", "test1", "alpine", "echo", "test1"})
|
||||||
test1.WaitWithDefaultTimeout()
|
test1.WaitWithDefaultTimeout()
|
||||||
Expect(test1).Should(Exit(0))
|
Expect(test1).Should(Exit(0))
|
||||||
|
stderr := test1.ErrorToString()
|
||||||
|
if IsRemote() {
|
||||||
|
Expect(stderr).To(BeEmpty())
|
||||||
|
} else {
|
||||||
|
Expect(stderr).To(ContainSubstring("Capabilities requested by user or image are not allowed by default: \\\"CAP_SYS_ADMIN\\\""))
|
||||||
|
}
|
||||||
|
|
||||||
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(ExitCleanly())
|
||||||
|
|
||||||
ctr := inspect.InspectContainerToJSON()
|
ctr := inspect.InspectContainerToJSON()
|
||||||
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
||||||
|
|
@ -59,11 +66,11 @@ var _ = Describe("Podman generate kube", func() {
|
||||||
It("podman --cap-add sys_admin security labels", func() {
|
It("podman --cap-add sys_admin security labels", func() {
|
||||||
test1 := podmanTest.Podman([]string{"create", "--cap-add", "SYS_ADMIN", "--label", "io.containers.capabilities=sys_admin", "--name", "test1", "alpine", "echo", "test1"})
|
test1 := podmanTest.Podman([]string{"create", "--cap-add", "SYS_ADMIN", "--label", "io.containers.capabilities=sys_admin", "--name", "test1", "alpine", "echo", "test1"})
|
||||||
test1.WaitWithDefaultTimeout()
|
test1.WaitWithDefaultTimeout()
|
||||||
Expect(test1).Should(Exit(0))
|
Expect(test1).Should(ExitCleanly())
|
||||||
|
|
||||||
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(ExitCleanly())
|
||||||
|
|
||||||
ctr := inspect.InspectContainerToJSON()
|
ctr := inspect.InspectContainerToJSON()
|
||||||
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
||||||
|
|
@ -74,10 +81,16 @@ var _ = Describe("Podman generate kube", func() {
|
||||||
test1 := podmanTest.Podman([]string{"create", "--cap-drop", "all", "--label", "io.containers.capabilities=sys_admin", "--name", "test1", "alpine", "echo", "test1"})
|
test1 := podmanTest.Podman([]string{"create", "--cap-drop", "all", "--label", "io.containers.capabilities=sys_admin", "--name", "test1", "alpine", "echo", "test1"})
|
||||||
test1.WaitWithDefaultTimeout()
|
test1.WaitWithDefaultTimeout()
|
||||||
Expect(test1).Should(Exit(0))
|
Expect(test1).Should(Exit(0))
|
||||||
|
stderr := test1.ErrorToString()
|
||||||
|
if IsRemote() {
|
||||||
|
Expect(stderr).To(BeEmpty())
|
||||||
|
} else {
|
||||||
|
Expect(stderr).To(ContainSubstring("Capabilities requested by user or image are not allowed by default: \\\"CAP_SYS_ADMIN\\\""))
|
||||||
|
}
|
||||||
|
|
||||||
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(ExitCleanly())
|
||||||
|
|
||||||
ctr := inspect.InspectContainerToJSON()
|
ctr := inspect.InspectContainerToJSON()
|
||||||
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
||||||
|
|
@ -87,19 +100,19 @@ var _ = Describe("Podman generate kube", func() {
|
||||||
It("podman security labels from image", func() {
|
It("podman security labels from image", func() {
|
||||||
test1 := podmanTest.Podman([]string{"create", "--name", "test1", "alpine", "echo", "test1"})
|
test1 := podmanTest.Podman([]string{"create", "--name", "test1", "alpine", "echo", "test1"})
|
||||||
test1.WaitWithDefaultTimeout()
|
test1.WaitWithDefaultTimeout()
|
||||||
Expect(test1).Should(Exit(0))
|
Expect(test1).Should(ExitCleanly())
|
||||||
|
|
||||||
commit := podmanTest.Podman([]string{"commit", "-c", "label=io.containers.capabilities=setgid,setuid", "test1", "image1"})
|
commit := podmanTest.Podman([]string{"commit", "-q", "-c", "label=io.containers.capabilities=setgid,setuid", "test1", "image1"})
|
||||||
commit.WaitWithDefaultTimeout()
|
commit.WaitWithDefaultTimeout()
|
||||||
Expect(commit).Should(Exit(0))
|
Expect(commit).Should(ExitCleanly())
|
||||||
|
|
||||||
image1 := podmanTest.Podman([]string{"create", "--name", "test2", "image1", "echo", "test1"})
|
image1 := podmanTest.Podman([]string{"create", "--name", "test2", "image1", "echo", "test1"})
|
||||||
image1.WaitWithDefaultTimeout()
|
image1.WaitWithDefaultTimeout()
|
||||||
Expect(image1).Should(Exit(0))
|
Expect(image1).Should(ExitCleanly())
|
||||||
|
|
||||||
inspect := podmanTest.Podman([]string{"inspect", "test2"})
|
inspect := podmanTest.Podman([]string{"inspect", "test2"})
|
||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(ExitCleanly())
|
||||||
|
|
||||||
ctr := inspect.InspectContainerToJSON()
|
ctr := inspect.InspectContainerToJSON()
|
||||||
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
||||||
|
|
@ -110,11 +123,11 @@ var _ = Describe("Podman generate kube", func() {
|
||||||
It("podman --privileged security labels", func() {
|
It("podman --privileged security labels", func() {
|
||||||
pull := podmanTest.Podman([]string{"create", "--privileged", "--label", "io.containers.capabilities=setuid,setgid", "--name", "test1", "alpine", "echo", "test"})
|
pull := podmanTest.Podman([]string{"create", "--privileged", "--label", "io.containers.capabilities=setuid,setgid", "--name", "test1", "alpine", "echo", "test"})
|
||||||
pull.WaitWithDefaultTimeout()
|
pull.WaitWithDefaultTimeout()
|
||||||
Expect(pull).Should(Exit(0))
|
Expect(pull).Should(ExitCleanly())
|
||||||
|
|
||||||
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(ExitCleanly())
|
||||||
|
|
||||||
ctr := inspect.InspectContainerToJSON()
|
ctr := inspect.InspectContainerToJSON()
|
||||||
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
||||||
|
|
@ -132,11 +145,11 @@ LABEL io.containers.capabilities=chown,kill`, ALPINE)
|
||||||
|
|
||||||
test1 := podmanTest.Podman([]string{"create", "--name", "test1", image, "echo", "test1"})
|
test1 := podmanTest.Podman([]string{"create", "--name", "test1", image, "echo", "test1"})
|
||||||
test1.WaitWithDefaultTimeout()
|
test1.WaitWithDefaultTimeout()
|
||||||
Expect(test1).Should(Exit(0))
|
Expect(test1).Should(ExitCleanly())
|
||||||
|
|
||||||
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
inspect := podmanTest.Podman([]string{"inspect", "test1"})
|
||||||
inspect.WaitWithDefaultTimeout()
|
inspect.WaitWithDefaultTimeout()
|
||||||
Expect(inspect).Should(Exit(0))
|
Expect(inspect).Should(ExitCleanly())
|
||||||
|
|
||||||
ctr := inspect.InspectContainerToJSON()
|
ctr := inspect.InspectContainerToJSON()
|
||||||
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
caps := strings.Join(ctr[0].EffectiveCaps, ",")
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ registries = []`
|
||||||
It("podman search", func() {
|
It("podman search", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "alpine"})
|
search := podmanTest.Podman([]string{"search", "alpine"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 1))
|
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 1))
|
||||||
Expect(search.OutputToString()).To(ContainSubstring("alpine"))
|
Expect(search.OutputToString()).To(ContainSubstring("alpine"))
|
||||||
})
|
})
|
||||||
|
|
@ -53,14 +53,14 @@ registries = []`
|
||||||
It("podman search single registry flag", func() {
|
It("podman search single registry flag", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "quay.io/skopeo/stable:latest"})
|
search := podmanTest.Podman([]string{"search", "quay.io/skopeo/stable:latest"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(search.OutputToString()).To(ContainSubstring("quay.io/skopeo/stable"))
|
Expect(search.OutputToString()).To(ContainSubstring("quay.io/skopeo/stable"))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman search image with description", func() {
|
It("podman search image with description", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "quay.io/libpod/whalesay"})
|
search := podmanTest.Podman([]string{"search", "quay.io/libpod/whalesay"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
output := string(search.Out.Contents())
|
output := string(search.Out.Contents())
|
||||||
Expect(output).To(MatchRegexp(`(?m)NAME\s+DESCRIPTION$`))
|
Expect(output).To(MatchRegexp(`(?m)NAME\s+DESCRIPTION$`))
|
||||||
Expect(output).To(MatchRegexp(`(?m)quay.io/libpod/whalesay\s+Static image used for automated testing.+$`))
|
Expect(output).To(MatchRegexp(`(?m)quay.io/libpod/whalesay\s+Static image used for automated testing.+$`))
|
||||||
|
|
@ -69,7 +69,7 @@ registries = []`
|
||||||
It("podman search image with --compatible", func() {
|
It("podman search image with --compatible", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--compatible", "quay.io/libpod/whalesay"})
|
search := podmanTest.Podman([]string{"search", "--compatible", "quay.io/libpod/whalesay"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
output := string(search.Out.Contents())
|
output := string(search.Out.Contents())
|
||||||
Expect(output).To(MatchRegexp(`(?m)NAME\s+DESCRIPTION\s+STARS\s+OFFICIAL\s+AUTOMATED$`))
|
Expect(output).To(MatchRegexp(`(?m)NAME\s+DESCRIPTION\s+STARS\s+OFFICIAL\s+AUTOMATED$`))
|
||||||
})
|
})
|
||||||
|
|
@ -77,7 +77,7 @@ registries = []`
|
||||||
It("podman search format flag", func() {
|
It("podman search format flag", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--format", "table {{.Index}} {{.Name}}", "alpine"})
|
search := podmanTest.Podman([]string{"search", "--format", "table {{.Index}} {{.Name}}", "alpine"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 1))
|
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 1))
|
||||||
Expect(search.OutputToString()).To(ContainSubstring("docker.io/library/alpine"))
|
Expect(search.OutputToString()).To(ContainSubstring("docker.io/library/alpine"))
|
||||||
})
|
})
|
||||||
|
|
@ -85,7 +85,7 @@ registries = []`
|
||||||
It("podman search format json", func() {
|
It("podman search format json", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--format", "json", "busybox"})
|
search := podmanTest.Podman([]string{"search", "--format", "json", "busybox"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(search.OutputToString()).To(BeValidJSON())
|
Expect(search.OutputToString()).To(BeValidJSON())
|
||||||
Expect(search.OutputToString()).To(ContainSubstring("docker.io/library/busybox"))
|
Expect(search.OutputToString()).To(ContainSubstring("docker.io/library/busybox"))
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@ registries = []`
|
||||||
It("podman search format json list tags", func() {
|
It("podman search format json list tags", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--list-tags", "--format", "json", ALPINE})
|
search := podmanTest.Podman([]string{"search", "--list-tags", "--format", "json", ALPINE})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(search.OutputToString()).To(BeValidJSON())
|
Expect(search.OutputToString()).To(BeValidJSON())
|
||||||
Expect(search.OutputToString()).To(ContainSubstring("quay.io/libpod/alpine"))
|
Expect(search.OutputToString()).To(ContainSubstring("quay.io/libpod/alpine"))
|
||||||
Expect(search.OutputToString()).To(ContainSubstring("3.10.2"))
|
Expect(search.OutputToString()).To(ContainSubstring("3.10.2"))
|
||||||
|
|
@ -113,7 +113,7 @@ registries = []`
|
||||||
It("podman search no-trunc=false flag", func() {
|
It("podman search no-trunc=false flag", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--no-trunc=false", "alpine", "--format={{.Description}}"})
|
search := podmanTest.Podman([]string{"search", "--no-trunc=false", "alpine", "--format={{.Description}}"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
|
|
||||||
for _, line := range search.OutputToStringArray() {
|
for _, line := range search.OutputToStringArray() {
|
||||||
if len(line) > 44 {
|
if len(line) > 44 {
|
||||||
|
|
@ -125,24 +125,24 @@ registries = []`
|
||||||
It("podman search limit flag", func() {
|
It("podman search limit flag", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "docker.io/alpine"})
|
search := podmanTest.Podman([]string{"search", "docker.io/alpine"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 10))
|
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 10))
|
||||||
|
|
||||||
search = podmanTest.Podman([]string{"search", "--limit", "3", "docker.io/alpine"})
|
search = podmanTest.Podman([]string{"search", "--limit", "3", "docker.io/alpine"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(search.OutputToStringArray()).To(HaveLen(4))
|
Expect(search.OutputToStringArray()).To(HaveLen(4))
|
||||||
|
|
||||||
search = podmanTest.Podman([]string{"search", "--limit", "30", "docker.io/alpine"})
|
search = podmanTest.Podman([]string{"search", "--limit", "30", "docker.io/alpine"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(search.OutputToStringArray()).To(HaveLen(31))
|
Expect(search.OutputToStringArray()).To(HaveLen(31))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman search with filter stars", func() {
|
It("podman search with filter stars", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--filter", "stars=10", "--format", "{{.Stars}}", "alpine"})
|
search := podmanTest.Podman([]string{"search", "--filter", "stars=10", "--format", "{{.Stars}}", "alpine"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
output := search.OutputToStringArray()
|
output := search.OutputToStringArray()
|
||||||
for i := 0; i < len(output); i++ {
|
for i := 0; i < len(output); i++ {
|
||||||
Expect(strconv.Atoi(output[i])).To(BeNumerically(">=", 10))
|
Expect(strconv.Atoi(output[i])).To(BeNumerically(">=", 10))
|
||||||
|
|
@ -152,7 +152,7 @@ registries = []`
|
||||||
It("podman search with filter is-official", func() {
|
It("podman search with filter is-official", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--filter", "is-official", "--format", "{{.Official}}", "alpine"})
|
search := podmanTest.Podman([]string{"search", "--filter", "is-official", "--format", "{{.Official}}", "alpine"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
output := search.OutputToStringArray()
|
output := search.OutputToStringArray()
|
||||||
for i := 0; i < len(output); i++ {
|
for i := 0; i < len(output); i++ {
|
||||||
Expect(output[i]).To(Equal("[OK]"))
|
Expect(output[i]).To(Equal("[OK]"))
|
||||||
|
|
@ -162,7 +162,7 @@ registries = []`
|
||||||
It("podman search with filter is-automated", func() {
|
It("podman search with filter is-automated", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--filter", "is-automated=false", "--format", "{{.Automated}}", "alpine"})
|
search := podmanTest.Podman([]string{"search", "--filter", "is-automated=false", "--format", "{{.Automated}}", "alpine"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
output := search.OutputToStringArray()
|
output := search.OutputToStringArray()
|
||||||
for i := 0; i < len(output); i++ {
|
for i := 0; i < len(output); i++ {
|
||||||
Expect(output[i]).To(Equal(""))
|
Expect(output[i]).To(Equal(""))
|
||||||
|
|
@ -172,7 +172,7 @@ registries = []`
|
||||||
It("podman search format list tags with custom", func() {
|
It("podman search format list tags with custom", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--list-tags", "--format", "{{.Name}}", "--limit", "1", ALPINE})
|
search := podmanTest.Podman([]string{"search", "--list-tags", "--format", "{{.Name}}", "--limit", "1", ALPINE})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(search.OutputToString()).To(Equal("quay.io/libpod/alpine"))
|
Expect(search.OutputToString()).To(Equal("quay.io/libpod/alpine"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -185,7 +185,7 @@ registries = []`
|
||||||
"-p", fmt.Sprintf("%d:5000", port),
|
"-p", fmt.Sprintf("%d:5000", port),
|
||||||
REGISTRY_IMAGE, "/entrypoint.sh", "/etc/docker/registry/config.yml"})
|
REGISTRY_IMAGE, "/entrypoint.sh", "/etc/docker/registry/config.yml"})
|
||||||
fakereg.WaitWithDefaultTimeout()
|
fakereg.WaitWithDefaultTimeout()
|
||||||
Expect(fakereg).Should(Exit(0))
|
Expect(fakereg).Should(ExitCleanly())
|
||||||
|
|
||||||
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
|
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
|
||||||
Fail("Cannot start docker registry on port %s", port)
|
Fail("Cannot start docker registry on port %s", port)
|
||||||
|
|
@ -197,9 +197,8 @@ registries = []`
|
||||||
|
|
||||||
// if this test succeeded, there will be no output (there is no entry named fake/image:andtag in an empty registry)
|
// if this test succeeded, there will be no output (there is no entry named fake/image:andtag in an empty registry)
|
||||||
// and the exit code will be 0
|
// and the exit code will be 0
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(search.OutputToString()).Should(BeEmpty())
|
Expect(search.OutputToString()).Should(BeEmpty())
|
||||||
Expect(search.ErrorToString()).Should(BeEmpty())
|
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman search in local registry", func() {
|
It("podman search in local registry", func() {
|
||||||
|
|
@ -211,7 +210,7 @@ registries = []`
|
||||||
"-p", fmt.Sprintf("%d:5000", port), REGISTRY_IMAGE,
|
"-p", fmt.Sprintf("%d:5000", port), REGISTRY_IMAGE,
|
||||||
"/entrypoint.sh", "/etc/docker/registry/config.yml"})
|
"/entrypoint.sh", "/etc/docker/registry/config.yml"})
|
||||||
registry.WaitWithDefaultTimeout()
|
registry.WaitWithDefaultTimeout()
|
||||||
Expect(registry).Should(Exit(0))
|
Expect(registry).Should(ExitCleanly())
|
||||||
|
|
||||||
if !WaitContainerReady(podmanTest, "registry3", "listening on", 20, 1) {
|
if !WaitContainerReady(podmanTest, "registry3", "listening on", 20, 1) {
|
||||||
Fail("Cannot start docker registry on port %s", port)
|
Fail("Cannot start docker registry on port %s", port)
|
||||||
|
|
@ -220,19 +219,19 @@ registries = []`
|
||||||
err = podmanTest.RestoreArtifact(ALPINE)
|
err = podmanTest.RestoreArtifact(ALPINE)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
image := fmt.Sprintf("%s/my-alpine", ep.Address())
|
image := fmt.Sprintf("%s/my-alpine", ep.Address())
|
||||||
push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, image})
|
push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", ALPINE, image})
|
||||||
push.WaitWithDefaultTimeout()
|
push.WaitWithDefaultTimeout()
|
||||||
Expect(push).Should(Exit(0))
|
Expect(push).Should(ExitCleanly())
|
||||||
search := podmanTest.Podman([]string{"search", image, "--tls-verify=false"})
|
search := podmanTest.Podman([]string{"search", image, "--tls-verify=false"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
|
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(search.OutputToString()).ShouldNot(BeEmpty())
|
Expect(search.OutputToString()).ShouldNot(BeEmpty())
|
||||||
|
|
||||||
// podman search v2 registry with empty query
|
// podman search v2 registry with empty query
|
||||||
searchEmpty := podmanTest.Podman([]string{"search", fmt.Sprintf("%s/", ep.Address()), "--tls-verify=false"})
|
searchEmpty := podmanTest.Podman([]string{"search", fmt.Sprintf("%s/", ep.Address()), "--tls-verify=false"})
|
||||||
searchEmpty.WaitWithDefaultTimeout()
|
searchEmpty.WaitWithDefaultTimeout()
|
||||||
Expect(searchEmpty).Should(Exit(0))
|
Expect(searchEmpty).Should(ExitCleanly())
|
||||||
Expect(searchEmpty.OutputToStringArray()).ToNot(BeEmpty())
|
Expect(searchEmpty.OutputToStringArray()).ToNot(BeEmpty())
|
||||||
Expect(search.OutputToString()).To(ContainSubstring("my-alpine"))
|
Expect(search.OutputToString()).To(ContainSubstring("my-alpine"))
|
||||||
})
|
})
|
||||||
|
|
@ -247,7 +246,7 @@ registries = []`
|
||||||
registry := podmanTest.Podman([]string{"run", "-d", "-p", fmt.Sprintf("%d:5000", port),
|
registry := podmanTest.Podman([]string{"run", "-d", "-p", fmt.Sprintf("%d:5000", port),
|
||||||
"--name", "registry4", REGISTRY_IMAGE, "/entrypoint.sh", "/etc/docker/registry/config.yml"})
|
"--name", "registry4", REGISTRY_IMAGE, "/entrypoint.sh", "/etc/docker/registry/config.yml"})
|
||||||
registry.WaitWithDefaultTimeout()
|
registry.WaitWithDefaultTimeout()
|
||||||
Expect(registry).Should(Exit(0))
|
Expect(registry).Should(ExitCleanly())
|
||||||
|
|
||||||
if !WaitContainerReady(podmanTest, "registry4", "listening on", 20, 1) {
|
if !WaitContainerReady(podmanTest, "registry4", "listening on", 20, 1) {
|
||||||
Fail("unable to start registry on port %s", port)
|
Fail("unable to start registry on port %s", port)
|
||||||
|
|
@ -256,9 +255,9 @@ registries = []`
|
||||||
err = podmanTest.RestoreArtifact(ALPINE)
|
err = podmanTest.RestoreArtifact(ALPINE)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
image := fmt.Sprintf("%s/my-alpine", ep.Address())
|
image := fmt.Sprintf("%s/my-alpine", ep.Address())
|
||||||
push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, image})
|
push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", ALPINE, image})
|
||||||
push.WaitWithDefaultTimeout()
|
push.WaitWithDefaultTimeout()
|
||||||
Expect(push).Should(Exit(0))
|
Expect(push).Should(ExitCleanly())
|
||||||
|
|
||||||
// registries.conf set up
|
// registries.conf set up
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
|
|
@ -275,9 +274,8 @@ registries = []`
|
||||||
search := podmanTest.Podman([]string{"search", image})
|
search := podmanTest.Podman([]string{"search", image})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
|
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(search.OutputToString()).To(ContainSubstring("my-alpine"))
|
Expect(search.OutputToString()).To(ContainSubstring("my-alpine"))
|
||||||
Expect(search.ErrorToString()).Should(BeEmpty())
|
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
resetRegistriesConfigEnv()
|
resetRegistriesConfigEnv()
|
||||||
|
|
@ -292,7 +290,7 @@ registries = []`
|
||||||
registry := podmanTest.Podman([]string{"run", "-d", "-p", fmt.Sprintf("%d:5000", port),
|
registry := podmanTest.Podman([]string{"run", "-d", "-p", fmt.Sprintf("%d:5000", port),
|
||||||
"--name", "registry5", REGISTRY_IMAGE})
|
"--name", "registry5", REGISTRY_IMAGE})
|
||||||
registry.WaitWithDefaultTimeout()
|
registry.WaitWithDefaultTimeout()
|
||||||
Expect(registry).Should(Exit(0))
|
Expect(registry).Should(ExitCleanly())
|
||||||
|
|
||||||
if !WaitContainerReady(podmanTest, "registry5", "listening on", 20, 1) {
|
if !WaitContainerReady(podmanTest, "registry5", "listening on", 20, 1) {
|
||||||
Fail("Cannot start docker registry on port %s", port)
|
Fail("Cannot start docker registry on port %s", port)
|
||||||
|
|
@ -301,9 +299,9 @@ registries = []`
|
||||||
err = podmanTest.RestoreArtifact(ALPINE)
|
err = podmanTest.RestoreArtifact(ALPINE)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
image := fmt.Sprintf("%s/my-alpine", ep.Address())
|
image := fmt.Sprintf("%s/my-alpine", ep.Address())
|
||||||
push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, image})
|
push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", ALPINE, image})
|
||||||
push.WaitWithDefaultTimeout()
|
push.WaitWithDefaultTimeout()
|
||||||
Expect(push).Should(Exit(0))
|
Expect(push).Should(ExitCleanly())
|
||||||
|
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
err = registryFileTmpl.Execute(&buffer, ep)
|
err = registryFileTmpl.Execute(&buffer, ep)
|
||||||
|
|
@ -332,7 +330,7 @@ registries = []`
|
||||||
registry := podmanTest.Podman([]string{"run", "-d", "-p", fmt.Sprintf("%d:5000", port),
|
registry := podmanTest.Podman([]string{"run", "-d", "-p", fmt.Sprintf("%d:5000", port),
|
||||||
"--name", "registry6", REGISTRY_IMAGE})
|
"--name", "registry6", REGISTRY_IMAGE})
|
||||||
registry.WaitWithDefaultTimeout()
|
registry.WaitWithDefaultTimeout()
|
||||||
Expect(registry).Should(Exit(0))
|
Expect(registry).Should(ExitCleanly())
|
||||||
|
|
||||||
if !WaitContainerReady(podmanTest, "registry6", "listening on", 20, 1) {
|
if !WaitContainerReady(podmanTest, "registry6", "listening on", 20, 1) {
|
||||||
Fail("Cannot start docker registry on port %s", port)
|
Fail("Cannot start docker registry on port %s", port)
|
||||||
|
|
@ -341,9 +339,9 @@ registries = []`
|
||||||
err = podmanTest.RestoreArtifact(ALPINE)
|
err = podmanTest.RestoreArtifact(ALPINE)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
image := fmt.Sprintf("%s/my-alpine", ep.Address())
|
image := fmt.Sprintf("%s/my-alpine", ep.Address())
|
||||||
push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, image})
|
push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", ALPINE, image})
|
||||||
push.WaitWithDefaultTimeout()
|
push.WaitWithDefaultTimeout()
|
||||||
Expect(push).Should(Exit(0))
|
Expect(push).Should(ExitCleanly())
|
||||||
|
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
err = registryFileBadTmpl.Execute(&buffer, ep)
|
err = registryFileBadTmpl.Execute(&buffer, ep)
|
||||||
|
|
@ -379,19 +377,19 @@ registries = []`
|
||||||
It("podman search with wildcards", FlakeAttempts(3), func() {
|
It("podman search with wildcards", FlakeAttempts(3), func() {
|
||||||
search := podmanTest.Podman([]string{"search", "registry.access.redhat.com/*openshift*"})
|
search := podmanTest.Podman([]string{"search", "registry.access.redhat.com/*openshift*"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 1))
|
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 1))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman search repository tags", func() {
|
It("podman search repository tags", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--list-tags", "--limit", "30", "docker.io/library/alpine"})
|
search := podmanTest.Podman([]string{"search", "--list-tags", "--limit", "30", "docker.io/library/alpine"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(search.OutputToStringArray()).To(HaveLen(31))
|
Expect(search.OutputToStringArray()).To(HaveLen(31))
|
||||||
|
|
||||||
search = podmanTest.Podman([]string{"search", "--list-tags", "docker.io/library/alpine"})
|
search = podmanTest.Podman([]string{"search", "--list-tags", "docker.io/library/alpine"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 2))
|
Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 2))
|
||||||
|
|
||||||
search = podmanTest.Podman([]string{"search", "--filter=is-official", "--list-tags", "docker.io/library/alpine"})
|
search = podmanTest.Podman([]string{"search", "--filter=is-official", "--list-tags", "docker.io/library/alpine"})
|
||||||
|
|
@ -406,7 +404,7 @@ registries = []`
|
||||||
It("podman search with limit over 100", func() {
|
It("podman search with limit over 100", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--limit", "100", "quay.io/podman"})
|
search := podmanTest.Podman([]string{"search", "--limit", "100", "quay.io/podman"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search).Should(Exit(0))
|
Expect(search).Should(ExitCleanly())
|
||||||
Expect(len(search.OutputToStringArray())).To(BeNumerically("<=", 101))
|
Expect(len(search.OutputToStringArray())).To(BeNumerically("<=", 101))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ var _ = Describe("podman system connection", func() {
|
||||||
}
|
}
|
||||||
session := podmanTest.Podman(cmd)
|
session := podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.Out.Contents()).Should(BeEmpty())
|
Expect(session.Out.Contents()).Should(BeEmpty())
|
||||||
|
|
||||||
cfg, err := config.ReadCustomConfig()
|
cfg, err := config.ReadCustomConfig()
|
||||||
|
|
@ -57,7 +57,7 @@ var _ = Describe("podman system connection", func() {
|
||||||
}
|
}
|
||||||
session = podmanTest.Podman(cmd)
|
session = podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
Expect(config.ReadCustomConfig()).Should(HaveActiveService("QE"))
|
Expect(config.ReadCustomConfig()).Should(HaveActiveService("QE"))
|
||||||
})
|
})
|
||||||
|
|
@ -71,6 +71,8 @@ var _ = Describe("podman system connection", func() {
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(Exit(0))
|
||||||
Expect(session.Out.Contents()).Should(BeEmpty())
|
Expect(session.Out.Contents()).Should(BeEmpty())
|
||||||
|
// stderr will probably warn (ENOENT or EACCESS) about socket
|
||||||
|
// but it's too unreliable to test for.
|
||||||
|
|
||||||
Expect(config.ReadCustomConfig()).Should(VerifyService(
|
Expect(config.ReadCustomConfig()).Should(VerifyService(
|
||||||
"QA-UDS",
|
"QA-UDS",
|
||||||
|
|
@ -103,7 +105,7 @@ var _ = Describe("podman system connection", func() {
|
||||||
}
|
}
|
||||||
session := podmanTest.Podman(cmd)
|
session := podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.Out.Contents()).Should(BeEmpty())
|
Expect(session.Out.Contents()).Should(BeEmpty())
|
||||||
|
|
||||||
Expect(config.ReadCustomConfig()).Should(VerifyService(
|
Expect(config.ReadCustomConfig()).Should(VerifyService(
|
||||||
|
|
@ -127,7 +129,7 @@ var _ = Describe("podman system connection", func() {
|
||||||
}
|
}
|
||||||
session := podmanTest.Podman(cmd)
|
session := podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.Out.Contents()).Should(BeEmpty())
|
Expect(session.Out.Contents()).Should(BeEmpty())
|
||||||
|
|
||||||
cfg, err = config.ReadCustomConfig()
|
cfg, err = config.ReadCustomConfig()
|
||||||
|
|
@ -146,7 +148,7 @@ var _ = Describe("podman system connection", func() {
|
||||||
cmd := []string{"farm", "create", "empty-farm"}
|
cmd := []string{"farm", "create", "empty-farm"}
|
||||||
session := podmanTest.Podman(cmd)
|
session := podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.Out.Contents()).Should(ContainSubstring("Farm \"empty-farm\" created"))
|
Expect(session.Out.Contents()).Should(ContainSubstring("Farm \"empty-farm\" created"))
|
||||||
|
|
||||||
cfg, err := config.ReadCustomConfig()
|
cfg, err := config.ReadCustomConfig()
|
||||||
|
|
@ -162,7 +164,7 @@ var _ = Describe("podman system connection", func() {
|
||||||
}
|
}
|
||||||
session = podmanTest.Podman(cmd)
|
session = podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.Out.Contents()).Should(BeEmpty())
|
Expect(session.Out.Contents()).Should(BeEmpty())
|
||||||
|
|
||||||
cfg, err = config.ReadCustomConfig()
|
cfg, err = config.ReadCustomConfig()
|
||||||
|
|
@ -190,7 +192,7 @@ var _ = Describe("podman system connection", func() {
|
||||||
}
|
}
|
||||||
session := podmanTest.Podman(cmd)
|
session := podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.Out.Contents()).Should(BeEmpty())
|
Expect(session.Out.Contents()).Should(BeEmpty())
|
||||||
|
|
||||||
cfg, err = config.ReadCustomConfig()
|
cfg, err = config.ReadCustomConfig()
|
||||||
|
|
@ -206,7 +208,7 @@ var _ = Describe("podman system connection", func() {
|
||||||
// Remove the QA connection
|
// Remove the QA connection
|
||||||
session = podmanTest.Podman([]string{"system", "connection", "remove", "QA"})
|
session = podmanTest.Podman([]string{"system", "connection", "remove", "QA"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.Out.Contents()).Should(BeEmpty())
|
Expect(session.Out.Contents()).Should(BeEmpty())
|
||||||
|
|
||||||
cfg, err = config.ReadCustomConfig()
|
cfg, err = config.ReadCustomConfig()
|
||||||
|
|
@ -224,13 +226,13 @@ var _ = Describe("podman system connection", func() {
|
||||||
"ssh://root@podman.test:2222/run/podman/podman.sock",
|
"ssh://root@podman.test:2222/run/podman/podman.sock",
|
||||||
})
|
})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
// two passes to test that removing non-existent connection is not an error
|
// two passes to test that removing non-existent connection is not an error
|
||||||
for i := 0; i < 2; i++ {
|
for i := 0; i < 2; i++ {
|
||||||
session = podmanTest.Podman([]string{"system", "connection", "remove", "QA"})
|
session = podmanTest.Podman([]string{"system", "connection", "remove", "QA"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.Out.Contents()).Should(BeEmpty())
|
Expect(session.Out.Contents()).Should(BeEmpty())
|
||||||
|
|
||||||
cfg, err := config.ReadCustomConfig()
|
cfg, err := config.ReadCustomConfig()
|
||||||
|
|
@ -248,17 +250,17 @@ var _ = Describe("podman system connection", func() {
|
||||||
"ssh://root@podman.test:2222/run/podman/podman.sock",
|
"ssh://root@podman.test:2222/run/podman/podman.sock",
|
||||||
})
|
})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"system", "connection", "remove", "--all"})
|
session = podmanTest.Podman([]string{"system", "connection", "remove", "--all"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.Out.Contents()).Should(BeEmpty())
|
Expect(session.Out.Contents()).Should(BeEmpty())
|
||||||
Expect(session.Err.Contents()).Should(BeEmpty())
|
Expect(session.Err.Contents()).Should(BeEmpty())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"system", "connection", "list"})
|
session = podmanTest.Podman([]string{"system", "connection", "list"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
})
|
})
|
||||||
|
|
||||||
It("default", func() {
|
It("default", func() {
|
||||||
|
|
@ -271,13 +273,13 @@ var _ = Describe("podman system connection", func() {
|
||||||
}
|
}
|
||||||
session := podmanTest.Podman(cmd)
|
session := podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := []string{"system", "connection", "default", "devl"}
|
cmd := []string{"system", "connection", "default", "devl"}
|
||||||
session := podmanTest.Podman(cmd)
|
session := podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.Out.Contents()).Should(BeEmpty())
|
Expect(session.Out.Contents()).Should(BeEmpty())
|
||||||
|
|
||||||
Expect(config.ReadCustomConfig()).Should(HaveActiveService("devl"))
|
Expect(config.ReadCustomConfig()).Should(HaveActiveService("devl"))
|
||||||
|
|
@ -285,13 +287,13 @@ var _ = Describe("podman system connection", func() {
|
||||||
cmd = []string{"system", "connection", "list"}
|
cmd = []string{"system", "connection", "list"}
|
||||||
session = podmanTest.Podman(cmd)
|
session = podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.Out).Should(Say("Name *URI *Identity *Default"))
|
Expect(session.Out).Should(Say("Name *URI *Identity *Default"))
|
||||||
|
|
||||||
cmd = []string{"system", "connection", "list", "--format", "{{.Name}}"}
|
cmd = []string{"system", "connection", "list", "--format", "{{.Name}}"}
|
||||||
session = podmanTest.Podman(cmd)
|
session = podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).Should(Equal("devl qe"))
|
Expect(session.OutputToString()).Should(Equal("devl qe"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -299,7 +301,7 @@ var _ = Describe("podman system connection", func() {
|
||||||
cmd := []string{"system", "connection", "default", "devl"}
|
cmd := []string{"system", "connection", "default", "devl"}
|
||||||
session := podmanTest.Podman(cmd)
|
session := podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).ShouldNot(Exit(0))
|
Expect(session).ShouldNot(ExitCleanly())
|
||||||
Expect(session.Err).Should(Say("destination is not defined"))
|
Expect(session.Err).Should(Say("destination is not defined"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -307,7 +309,7 @@ var _ = Describe("podman system connection", func() {
|
||||||
cmd := []string{"system", "connection", "rename", "devl", "QE"}
|
cmd := []string{"system", "connection", "rename", "devl", "QE"}
|
||||||
session := podmanTest.Podman(cmd)
|
session := podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).ShouldNot(Exit(0))
|
Expect(session).ShouldNot(ExitCleanly())
|
||||||
Expect(session.Err).Should(Say("destination is not defined"))
|
Expect(session.Err).Should(Say("destination is not defined"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -315,7 +317,7 @@ var _ = Describe("podman system connection", func() {
|
||||||
cmd := []string{"system", "connection", "list"}
|
cmd := []string{"system", "connection", "list"}
|
||||||
session := podmanTest.Podman(cmd)
|
session := podmanTest.Podman(cmd)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToStringArray()).Should(HaveLen(1))
|
Expect(session.OutputToStringArray()).Should(HaveLen(1))
|
||||||
Expect(session.Err.Contents()).Should(BeEmpty())
|
Expect(session.Err.Contents()).Should(BeEmpty())
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -85,14 +85,14 @@ var _ = Describe("Systemd activate", func() {
|
||||||
"create", "--tty", "--name", containerName, "--entrypoint", "top",
|
"create", "--tty", "--name", containerName, "--entrypoint", "top",
|
||||||
ALPINE,
|
ALPINE,
|
||||||
)
|
)
|
||||||
Expect(apiSession).Should(Exit(0))
|
Expect(apiSession).Should(testUtils.ExitCleanly())
|
||||||
defer podman("rm", "-f", containerName)
|
defer podman("rm", "-f", containerName)
|
||||||
|
|
||||||
apiSession = podmanRemote("start", containerName)
|
apiSession = podmanRemote("start", containerName)
|
||||||
Expect(apiSession).Should(Exit(0))
|
Expect(apiSession).Should(testUtils.ExitCleanly())
|
||||||
|
|
||||||
apiSession = podmanRemote("inspect", "--format={{.State.Running}}", containerName)
|
apiSession = podmanRemote("inspect", "--format={{.State.Running}}", containerName)
|
||||||
Expect(apiSession).Should(Exit(0))
|
Expect(apiSession).Should(testUtils.ExitCleanly())
|
||||||
Expect(apiSession.OutputToString()).To(Equal("true"))
|
Expect(apiSession.OutputToString()).To(Equal("true"))
|
||||||
|
|
||||||
// Emulate 'systemd stop podman.service'
|
// Emulate 'systemd stop podman.service'
|
||||||
|
|
@ -101,7 +101,7 @@ var _ = Describe("Systemd activate", func() {
|
||||||
Eventually(activateSession).Should(Exit(0))
|
Eventually(activateSession).Should(Exit(0))
|
||||||
|
|
||||||
abiSession := podman("inspect", "--format={{.State.Running}}", containerName)
|
abiSession := podman("inspect", "--format={{.State.Running}}", containerName)
|
||||||
Expect(abiSession).To(Exit(0))
|
Expect(abiSession).To(testUtils.ExitCleanly())
|
||||||
Expect(abiSession.OutputToString()).To(Equal("true"))
|
Expect(abiSession.OutputToString()).To(Equal("true"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,21 +51,21 @@ WantedBy=default.target
|
||||||
stop := SystemExec("systemctl", []string{dashWhat, "stop", serviceName})
|
stop := SystemExec("systemctl", []string{dashWhat, "stop", serviceName})
|
||||||
os.Remove(sysFilePath)
|
os.Remove(sysFilePath)
|
||||||
SystemExec("systemctl", []string{dashWhat, "daemon-reload"})
|
SystemExec("systemctl", []string{dashWhat, "daemon-reload"})
|
||||||
Expect(stop).Should(Exit(0))
|
Expect(stop).Should(ExitCleanly())
|
||||||
}()
|
}()
|
||||||
|
|
||||||
create := podmanTest.Podman([]string{"create", "--name", "redis", REDIS_IMAGE})
|
create := podmanTest.Podman([]string{"create", "--name", "redis", REDIS_IMAGE})
|
||||||
create.WaitWithDefaultTimeout()
|
create.WaitWithDefaultTimeout()
|
||||||
Expect(create).Should(Exit(0))
|
Expect(create).Should(ExitCleanly())
|
||||||
|
|
||||||
enable := SystemExec("systemctl", []string{dashWhat, "daemon-reload"})
|
enable := SystemExec("systemctl", []string{dashWhat, "daemon-reload"})
|
||||||
Expect(enable).Should(Exit(0))
|
Expect(enable).Should(ExitCleanly())
|
||||||
|
|
||||||
start := SystemExec("systemctl", []string{dashWhat, "start", serviceName})
|
start := SystemExec("systemctl", []string{dashWhat, "start", serviceName})
|
||||||
Expect(start).Should(Exit(0))
|
Expect(start).Should(ExitCleanly())
|
||||||
|
|
||||||
logs := SystemExec("journalctl", []string{dashWhat, "-n", "20", "-u", serviceName})
|
logs := SystemExec("journalctl", []string{dashWhat, "-n", "20", "-u", serviceName})
|
||||||
Expect(logs).Should(Exit(0))
|
Expect(logs).Should(ExitCleanly())
|
||||||
|
|
||||||
status := SystemExec("systemctl", []string{dashWhat, "status", serviceName})
|
status := SystemExec("systemctl", []string{dashWhat, "status", serviceName})
|
||||||
Expect(status.OutputToString()).To(ContainSubstring("active (running)"))
|
Expect(status.OutputToString()).To(ContainSubstring("active (running)"))
|
||||||
|
|
@ -79,7 +79,7 @@ WantedBy=default.target
|
||||||
|
|
||||||
logs := podmanTest.Podman([]string{"logs", ctrName})
|
logs := podmanTest.Podman([]string{"logs", ctrName})
|
||||||
logs.WaitWithDefaultTimeout()
|
logs.WaitWithDefaultTimeout()
|
||||||
Expect(logs).Should(Exit(0))
|
Expect(logs).Should(ExitCleanly())
|
||||||
|
|
||||||
// Give container 10 seconds to start
|
// Give container 10 seconds to start
|
||||||
started := podmanTest.WaitContainerReady(ctrName, "Reached target multi-user.target - Multi-User System.", 30, 1)
|
started := podmanTest.WaitContainerReady(ctrName, "Reached target multi-user.target - Multi-User System.", 30, 1)
|
||||||
|
|
@ -87,12 +87,12 @@ WantedBy=default.target
|
||||||
|
|
||||||
systemctl := podmanTest.Podman([]string{"exec", ctrName, "systemctl", "status", "--no-pager"})
|
systemctl := podmanTest.Podman([]string{"exec", ctrName, "systemctl", "status", "--no-pager"})
|
||||||
systemctl.WaitWithDefaultTimeout()
|
systemctl.WaitWithDefaultTimeout()
|
||||||
Expect(systemctl).Should(Exit(0))
|
Expect(systemctl).Should(ExitCleanly())
|
||||||
Expect(systemctl.OutputToString()).To(ContainSubstring("State:"))
|
Expect(systemctl.OutputToString()).To(ContainSubstring("State:"))
|
||||||
|
|
||||||
result := podmanTest.Podman([]string{"inspect", ctrName})
|
result := podmanTest.Podman([]string{"inspect", ctrName})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
conData := result.InspectContainerToJSON()
|
conData := result.InspectContainerToJSON()
|
||||||
Expect(conData).To(HaveLen(1))
|
Expect(conData).To(HaveLen(1))
|
||||||
Expect(conData[0].Config).To(HaveField("SystemdMode", true))
|
Expect(conData[0].Config).To(HaveField("SystemdMode", true))
|
||||||
|
|
@ -103,11 +103,11 @@ WantedBy=default.target
|
||||||
}
|
}
|
||||||
stats := podmanTest.Podman([]string{"stats", "--no-stream", ctrName})
|
stats := podmanTest.Podman([]string{"stats", "--no-stream", ctrName})
|
||||||
stats.WaitWithDefaultTimeout()
|
stats.WaitWithDefaultTimeout()
|
||||||
Expect(stats).Should(Exit(0))
|
Expect(stats).Should(ExitCleanly())
|
||||||
|
|
||||||
cgroupPath := podmanTest.Podman([]string{"inspect", "--format='{{.State.CgroupPath}}'", ctrName})
|
cgroupPath := podmanTest.Podman([]string{"inspect", "--format='{{.State.CgroupPath}}'", ctrName})
|
||||||
cgroupPath.WaitWithDefaultTimeout()
|
cgroupPath.WaitWithDefaultTimeout()
|
||||||
Expect(cgroupPath).Should(Exit(0))
|
Expect(cgroupPath).Should(ExitCleanly())
|
||||||
Expect(cgroupPath.OutputToString()).To(Not(ContainSubstring("init.scope")))
|
Expect(cgroupPath.OutputToString()).To(Not(ContainSubstring("init.scope")))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -115,11 +115,11 @@ WantedBy=default.target
|
||||||
ctrName := "testCtr"
|
ctrName := "testCtr"
|
||||||
run := podmanTest.Podman([]string{"create", "--name", ctrName, "--entrypoint", "/sbin/init", SYSTEMD_IMAGE})
|
run := podmanTest.Podman([]string{"create", "--name", ctrName, "--entrypoint", "/sbin/init", SYSTEMD_IMAGE})
|
||||||
run.WaitWithDefaultTimeout()
|
run.WaitWithDefaultTimeout()
|
||||||
Expect(run).Should(Exit(0))
|
Expect(run).Should(ExitCleanly())
|
||||||
|
|
||||||
result := podmanTest.Podman([]string{"inspect", ctrName})
|
result := podmanTest.Podman([]string{"inspect", ctrName})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
conData := result.InspectContainerToJSON()
|
conData := result.InspectContainerToJSON()
|
||||||
Expect(conData).To(HaveLen(1))
|
Expect(conData).To(HaveLen(1))
|
||||||
Expect(conData[0].Config).To(HaveField("SystemdMode", true))
|
Expect(conData[0].Config).To(HaveField("SystemdMode", true))
|
||||||
|
|
@ -135,16 +135,16 @@ CMD /usr/lib/systemd/systemd`, ALPINE)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
session := podmanTest.Podman([]string{"build", "-t", "systemd", "--file", containerfilePath, podmanTest.TempDir})
|
session := podmanTest.Podman([]string{"build", "-t", "systemd", "--file", containerfilePath, podmanTest.TempDir})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
ctrName := "testCtr"
|
ctrName := "testCtr"
|
||||||
run := podmanTest.Podman([]string{"create", "--name", ctrName, "systemd"})
|
run := podmanTest.Podman([]string{"create", "--name", ctrName, "systemd"})
|
||||||
run.WaitWithDefaultTimeout()
|
run.WaitWithDefaultTimeout()
|
||||||
Expect(run).Should(Exit(0))
|
Expect(run).Should(ExitCleanly())
|
||||||
|
|
||||||
result := podmanTest.Podman([]string{"inspect", ctrName})
|
result := podmanTest.Podman([]string{"inspect", ctrName})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
conData := result.InspectContainerToJSON()
|
conData := result.InspectContainerToJSON()
|
||||||
Expect(conData).To(HaveLen(1))
|
Expect(conData).To(HaveLen(1))
|
||||||
Expect(conData[0].Config).To(HaveField("SystemdMode", true))
|
Expect(conData[0].Config).To(HaveField("SystemdMode", true))
|
||||||
|
|
@ -154,11 +154,11 @@ CMD /usr/lib/systemd/systemd`, ALPINE)
|
||||||
ctrName := "testCtrUidMap"
|
ctrName := "testCtrUidMap"
|
||||||
run := podmanTest.Podman([]string{"run", "-d", "--uidmap=0:1:1000", "--name", ctrName, ALPINE, "top"})
|
run := podmanTest.Podman([]string{"run", "-d", "--uidmap=0:1:1000", "--name", ctrName, ALPINE, "top"})
|
||||||
run.WaitWithDefaultTimeout()
|
run.WaitWithDefaultTimeout()
|
||||||
Expect(run).Should(Exit(0))
|
Expect(run).Should(ExitCleanly())
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"inspect", "--format", "{{.ConmonPidFile}}", ctrName})
|
session := podmanTest.Podman([]string{"inspect", "--format", "{{.ConmonPidFile}}", ctrName})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
pidFile := strings.TrimSuffix(session.OutputToString(), "\n")
|
pidFile := strings.TrimSuffix(session.OutputToString(), "\n")
|
||||||
_, err := os.ReadFile(pidFile)
|
_, err := os.ReadFile(pidFile)
|
||||||
|
|
@ -169,11 +169,11 @@ CMD /usr/lib/systemd/systemd`, ALPINE)
|
||||||
ctrName := "testCtr"
|
ctrName := "testCtr"
|
||||||
run := podmanTest.Podman([]string{"create", "--name", ctrName, "--systemd", "always", ALPINE})
|
run := podmanTest.Podman([]string{"create", "--name", ctrName, "--systemd", "always", ALPINE})
|
||||||
run.WaitWithDefaultTimeout()
|
run.WaitWithDefaultTimeout()
|
||||||
Expect(run).Should(Exit(0))
|
Expect(run).Should(ExitCleanly())
|
||||||
|
|
||||||
result := podmanTest.Podman([]string{"inspect", ctrName})
|
result := podmanTest.Podman([]string{"inspect", ctrName})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(ExitCleanly())
|
||||||
conData := result.InspectContainerToJSON()
|
conData := result.InspectContainerToJSON()
|
||||||
Expect(conData).To(HaveLen(1))
|
Expect(conData).To(HaveLen(1))
|
||||||
Expect(conData[0].Config).To(HaveField("SystemdMode", true))
|
Expect(conData[0].Config).To(HaveField("SystemdMode", true))
|
||||||
|
|
@ -182,7 +182,7 @@ CMD /usr/lib/systemd/systemd`, ALPINE)
|
||||||
It("podman run --systemd container should NOT mount /run noexec", func() {
|
It("podman run --systemd container should NOT mount /run noexec", func() {
|
||||||
session := podmanTest.Podman([]string{"run", "--systemd", "always", ALPINE, "sh", "-c", "mount | grep \"/run \""})
|
session := podmanTest.Podman([]string{"run", "--systemd", "always", ALPINE, "sh", "-c", "mount | grep \"/run \""})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
Expect(session.OutputToString()).To(Not(ContainSubstring("noexec")))
|
Expect(session.OutputToString()).To(Not(ContainSubstring("noexec")))
|
||||||
})
|
})
|
||||||
|
|
@ -190,17 +190,17 @@ CMD /usr/lib/systemd/systemd`, ALPINE)
|
||||||
It("podman run --systemd arg is case insensitive", func() {
|
It("podman run --systemd arg is case insensitive", func() {
|
||||||
session := podmanTest.Podman([]string{"run", "--rm", "--systemd", "Always", ALPINE, "echo", "test"})
|
session := podmanTest.Podman([]string{"run", "--rm", "--systemd", "Always", ALPINE, "echo", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).Should(Equal("test"))
|
Expect(session.OutputToString()).Should(Equal("test"))
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"run", "--rm", "--systemd", "True", ALPINE, "echo", "test"})
|
session = podmanTest.Podman([]string{"run", "--rm", "--systemd", "True", ALPINE, "echo", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).Should(Equal("test"))
|
Expect(session.OutputToString()).Should(Equal("test"))
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"run", "--rm", "--systemd", "False", ALPINE, "echo", "test"})
|
session = podmanTest.Podman([]string{"run", "--rm", "--systemd", "False", ALPINE, "echo", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).Should(Equal("test"))
|
Expect(session.OutputToString()).Should(Equal("test"))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
session := podmanTest.Podman([]string{"run", "--dns", "none", ALPINE, "sh", "-c",
|
session := podmanTest.Podman([]string{"run", "--dns", "none", ALPINE, "sh", "-c",
|
||||||
"rm -f /etc/resolv.conf; touch -d '1970-01-01 00:02:03' /etc/resolv.conf; stat -c %s:%Y /etc/resolv.conf"})
|
"rm -f /etc/resolv.conf; touch -d '1970-01-01 00:02:03' /etc/resolv.conf; stat -c %s:%Y /etc/resolv.conf"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring("0:123"))
|
Expect(session.OutputToString()).To(ContainSubstring("0:123"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -55,7 +55,7 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
session := podmanTest.Podman([]string{"run", "--no-hosts", ALPINE, "sh", "-c",
|
session := podmanTest.Podman([]string{"run", "--no-hosts", ALPINE, "sh", "-c",
|
||||||
"rm -f /etc/hosts; touch -d '1970-01-01 00:02:03' /etc/hosts; stat -c %s:%Y /etc/hosts"})
|
"rm -f /etc/hosts; touch -d '1970-01-01 00:02:03' /etc/hosts; stat -c %s:%Y /etc/hosts"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring("0:123"))
|
Expect(session.OutputToString()).To(ContainSubstring("0:123"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -75,16 +75,16 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
session = podmanTest.Podman([]string{"create", "--name", "test", "--ulimit", "host", ALPINE,
|
session = podmanTest.Podman([]string{"create", "--name", "test", "--ulimit", "host", ALPINE,
|
||||||
"sleep", "1000"})
|
"sleep", "1000"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"start", "test"})
|
session = podmanTest.Podman([]string{"start", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"exec", "test", "sh", "-c",
|
session = podmanTest.Podman([]string{"exec", "test", "sh", "-c",
|
||||||
"ulimit -H -n"})
|
"ulimit -H -n"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
containerHardLimit, err = strconv.Atoi(strings.Trim(session.OutputToString(), "\n"))
|
containerHardLimit, err = strconv.Atoi(strings.Trim(session.OutputToString(), "\n"))
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(containerHardLimit).To(BeNumerically(">=", rlimit.Max))
|
Expect(containerHardLimit).To(BeNumerically(">=", rlimit.Max))
|
||||||
|
|
@ -116,16 +116,16 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
session = podmanTest.Podman([]string{"create", "--name", "test", "--ipc=host", "--pid=host", ALPINE,
|
session = podmanTest.Podman([]string{"create", "--name", "test", "--ipc=host", "--pid=host", ALPINE,
|
||||||
"sleep", "1000"})
|
"sleep", "1000"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"start", "test"})
|
session = podmanTest.Podman([]string{"start", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"exec", "test",
|
session = podmanTest.Podman([]string{"exec", "test",
|
||||||
"df", "/dev/shm"})
|
"df", "/dev/shm"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
lines = session.OutputToStringArray()
|
lines = session.OutputToStringArray()
|
||||||
fields = strings.Fields(lines[len(lines)-1])
|
fields = strings.Fields(lines[len(lines)-1])
|
||||||
containerShmSize, err = strconv.Atoi(fields[1])
|
containerShmSize, err = strconv.Atoi(fields[1])
|
||||||
|
|
@ -142,7 +142,7 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
session := podmanTest.Podman([]string{"run", "--userns=keep-id", "--user", "root:root", ALPINE,
|
session := podmanTest.Podman([]string{"run", "--userns=keep-id", "--user", "root:root", ALPINE,
|
||||||
"id"})
|
"id"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring("uid=0(root) gid=0(root)"))
|
Expect(session.OutputToString()).To(ContainSubstring("uid=0(root) gid=0(root)"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -160,12 +160,12 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
session = podmanTest.Podman([]string{"create", "--name", "test", "--userns=keep-id", ALPINE,
|
session = podmanTest.Podman([]string{"create", "--name", "test", "--userns=keep-id", ALPINE,
|
||||||
"sleep", "1000"})
|
"sleep", "1000"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"start", "test"})
|
session = podmanTest.Podman([]string{"start", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
expectedOutput := fmt.Sprintf("uid=%s(%s) gid=%s(%s)",
|
expectedOutput := fmt.Sprintf("uid=%s(%s) gid=%s(%s)",
|
||||||
currentUser.Uid, currentUser.Username,
|
currentUser.Uid, currentUser.Username,
|
||||||
|
|
@ -174,7 +174,7 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
session = podmanTest.Podman([]string{"exec", "test",
|
session = podmanTest.Podman([]string{"exec", "test",
|
||||||
"id"})
|
"id"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring(expectedOutput))
|
Expect(session.OutputToString()).To(ContainSubstring(expectedOutput))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -194,11 +194,11 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
session = podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test", "--userns=keep-id", "--user", "root:root", fedoraToolbox, "sh", "-c",
|
session = podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test", "--userns=keep-id", "--user", "root:root", fedoraToolbox, "sh", "-c",
|
||||||
fmt.Sprintf("%s; %s; echo READY; sleep 1000", useradd, passwd)})
|
fmt.Sprintf("%s; %s; echo READY; sleep 1000", useradd, passwd)})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"start", "test"})
|
session = podmanTest.Podman([]string{"start", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
Expect(WaitContainerReady(podmanTest, "test", "READY", 5, 1)).To(BeTrue())
|
Expect(WaitContainerReady(podmanTest, "test", "READY", 5, 1)).To(BeTrue())
|
||||||
|
|
||||||
|
|
@ -207,7 +207,7 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"exec", "test", "cat", "/etc/passwd"})
|
session = podmanTest.Podman([]string{"exec", "test", "cat", "/etc/passwd"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring(expectedOutput))
|
Expect(session.OutputToString()).To(ContainSubstring(expectedOutput))
|
||||||
|
|
||||||
expectedOutput = "passwd: Note: deleting a password also unlocks the password."
|
expectedOutput = "passwd: Note: deleting a password also unlocks the password."
|
||||||
|
|
@ -230,22 +230,22 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
session = podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test", "--userns=keep-id", "--user", "root:root", fedoraToolbox, "sh", "-c",
|
session = podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test", "--userns=keep-id", "--user", "root:root", fedoraToolbox, "sh", "-c",
|
||||||
fmt.Sprintf("%s; echo READY; sleep 1000", groupadd)})
|
fmt.Sprintf("%s; echo READY; sleep 1000", groupadd)})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"start", "test"})
|
session = podmanTest.Podman([]string{"start", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
Expect(WaitContainerReady(podmanTest, "test", "READY", 5, 1)).To(BeTrue())
|
Expect(WaitContainerReady(podmanTest, "test", "READY", 5, 1)).To(BeTrue())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"exec", "test", "cat", "/etc/group"})
|
session = podmanTest.Podman([]string{"exec", "test", "cat", "/etc/group"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring(groupName))
|
Expect(session.OutputToString()).To(ContainSubstring(groupName))
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"logs", "test"})
|
session = podmanTest.Podman([]string{"logs", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring("READY"))
|
Expect(session.OutputToString()).To(ContainSubstring("READY"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -275,11 +275,11 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
session = podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test", "--userns=keep-id", "--user", "root:root", fedoraToolbox, "sh", "-c",
|
session = podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test", "--userns=keep-id", "--user", "root:root", fedoraToolbox, "sh", "-c",
|
||||||
fmt.Sprintf("%s; %s; %s; echo READY; sleep 1000", useradd, groupadd, usermod)})
|
fmt.Sprintf("%s; %s; %s; echo READY; sleep 1000", useradd, groupadd, usermod)})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"start", "test"})
|
session = podmanTest.Podman([]string{"start", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
Expect(WaitContainerReady(podmanTest, "test", "READY", 5, 1)).To(BeTrue())
|
Expect(WaitContainerReady(podmanTest, "test", "READY", 5, 1)).To(BeTrue())
|
||||||
|
|
||||||
|
|
@ -288,12 +288,12 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"exec", "test", "cat", "/etc/passwd"})
|
session = podmanTest.Podman([]string{"exec", "test", "cat", "/etc/passwd"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring(expectedUser))
|
Expect(session.OutputToString()).To(ContainSubstring(expectedUser))
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"logs", "test"})
|
session = podmanTest.Podman([]string{"logs", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring("READY"))
|
Expect(session.OutputToString()).To(ContainSubstring("READY"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -304,12 +304,12 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
session = podmanTest.Podman([]string{"run", "--privileged", "--userns=keep-id", "--user", "root:root", ALPINE,
|
session = podmanTest.Podman([]string{"run", "--privileged", "--userns=keep-id", "--user", "root:root", ALPINE,
|
||||||
"mount", "-t", define.TypeTmpfs, define.TypeTmpfs, "/tmp"})
|
"mount", "-t", define.TypeTmpfs, define.TypeTmpfs, "/tmp"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"run", "--privileged", "--userns=keep-id", "--user", "root:root", ALPINE,
|
session = podmanTest.Podman([]string{"run", "--privileged", "--userns=keep-id", "--user", "root:root", ALPINE,
|
||||||
"mount", "--rbind", "/tmp", "/var/tmp"})
|
"mount", "--rbind", "/tmp", "/var/tmp"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman create + start - with all needed switches for create - sleep as entry-point", func() {
|
It("podman create + start - with all needed switches for create - sleep as entry-point", func() {
|
||||||
|
|
@ -335,17 +335,17 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
"--user", "root:root",
|
"--user", "root:root",
|
||||||
fedoraToolbox, "sh", "-c", "echo READY; sleep 1000"})
|
fedoraToolbox, "sh", "-c", "echo READY; sleep 1000"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"start", "test"})
|
session = podmanTest.Podman([]string{"start", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
Expect(WaitContainerReady(podmanTest, "test", "READY", 5, 1)).To(BeTrue())
|
Expect(WaitContainerReady(podmanTest, "test", "READY", 5, 1)).To(BeTrue())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"logs", "test"})
|
session = podmanTest.Podman([]string{"logs", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring("READY"))
|
Expect(session.OutputToString()).To(ContainSubstring("READY"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -357,7 +357,7 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"run", "-v", fmt.Sprintf("%s:%s", currentUser.HomeDir, currentUser.HomeDir), "--userns=keep-id", fedoraToolbox, "sh", "-c", "echo $HOME"})
|
session = podmanTest.Podman([]string{"run", "-v", fmt.Sprintf("%s:%s", currentUser.HomeDir, currentUser.HomeDir), "--userns=keep-id", fedoraToolbox, "sh", "-c", "echo $HOME"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring(currentUser.HomeDir))
|
Expect(session.OutputToString()).To(ContainSubstring(currentUser.HomeDir))
|
||||||
|
|
||||||
if isRootless() {
|
if isRootless() {
|
||||||
|
|
@ -368,7 +368,7 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||||
"--volume", volumeArg,
|
"--volume", volumeArg,
|
||||||
fedoraToolbox, "sh", "-c", "echo $HOME"})
|
fedoraToolbox, "sh", "-c", "echo $HOME"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(session.OutputToString()).To(ContainSubstring(currentUser.HomeDir))
|
Expect(session.OutputToString()).To(ContainSubstring(currentUser.HomeDir))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue