summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/e2e/common_test.go5
-rw-r--r--test/e2e/container_inspect_test.go1
-rw-r--r--test/e2e/healthcheck_run_test.go1
-rw-r--r--test/e2e/manifest_test.go13
-rw-r--r--test/e2e/pause_test.go34
-rw-r--r--test/e2e/pod_create_test.go1
-rw-r--r--test/e2e/pod_inspect_test.go6
-rw-r--r--test/e2e/pod_kill_test.go1
-rw-r--r--test/e2e/pod_pause_test.go3
-rw-r--r--test/e2e/pod_prune_test.go1
-rw-r--r--test/e2e/pod_ps_test.go18
-rw-r--r--test/e2e/pod_restart_test.go1
-rw-r--r--test/e2e/pod_rm_test.go1
-rw-r--r--test/e2e/pod_stats_test.go1
-rw-r--r--test/e2e/pod_stop_test.go1
-rw-r--r--test/e2e/pod_top_test.go1
-rw-r--r--test/e2e/run_dns_test.go1
-rw-r--r--test/e2e/run_ns_test.go1
-rw-r--r--test/e2e/run_passwd_test.go1
-rw-r--r--test/e2e/run_restart_test.go1
-rw-r--r--test/e2e/run_signal_test.go1
21 files changed, 55 insertions, 39 deletions
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index d93ee8d3a..160af1bd5 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -14,7 +14,6 @@ import (
"testing"
"time"
- "github.com/containers/libpod/libpod"
"github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/pkg/inspect"
"github.com/containers/libpod/pkg/rootless"
@@ -501,8 +500,8 @@ func (s *PodmanSessionIntegration) InspectContainerToJSON() []define.InspectCont
}
// InspectPodToJSON takes the sessions output from a pod inspect and returns json
-func (s *PodmanSessionIntegration) InspectPodToJSON() libpod.PodInspect {
- var i libpod.PodInspect
+func (s *PodmanSessionIntegration) InspectPodToJSON() define.InspectPodData {
+ var i define.InspectPodData
err := json.Unmarshal(s.Out.Contents(), &i)
Expect(err).To(BeNil())
return i
diff --git a/test/e2e/container_inspect_test.go b/test/e2e/container_inspect_test.go
index cc986f1a8..91c025197 100644
--- a/test/e2e/container_inspect_test.go
+++ b/test/e2e/container_inspect_test.go
@@ -17,7 +17,6 @@ var _ = Describe("Podman container inspect", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go
index 58d473ca8..19a8658ac 100644
--- a/test/e2e/healthcheck_run_test.go
+++ b/test/e2e/healthcheck_run_test.go
@@ -18,7 +18,6 @@ var _ = Describe("Podman healthcheck run", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/manifest_test.go b/test/e2e/manifest_test.go
index a52916e87..9b5a24771 100644
--- a/test/e2e/manifest_test.go
+++ b/test/e2e/manifest_test.go
@@ -85,4 +85,17 @@ var _ = Describe("Podman manifest", func() {
Expect(session.OutputToString()).To(ContainSubstring(imageListPPC64LEInstanceDigest))
Expect(session.OutputToString()).To(ContainSubstring(imageListS390XInstanceDigest))
})
+
+ It("podman manifest add --os", func() {
+ session := podmanTest.Podman([]string{"manifest", "create", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session = podmanTest.Podman([]string{"manifest", "add", "--os", "bar", "foo", imageList})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring(`"os": "bar"`))
+ })
})
diff --git a/test/e2e/pause_test.go b/test/e2e/pause_test.go
index 66b888803..149a2e28a 100644
--- a/test/e2e/pause_test.go
+++ b/test/e2e/pause_test.go
@@ -2,7 +2,10 @@ package integration
import (
"fmt"
+ "io/ioutil"
"os"
+ "path/filepath"
+ "strings"
"github.com/containers/libpod/pkg/cgroups"
. "github.com/containers/libpod/test/utils"
@@ -17,11 +20,10 @@ var _ = Describe("Podman pause", func() {
podmanTest *PodmanTestIntegration
)
- pausedState := "Paused"
- createdState := "Created"
+ pausedState := "paused"
+ createdState := "created"
BeforeEach(func() {
- Skip(v2fail)
SkipIfRootless()
tempdir, err = CreateTempDirInTempDir()
if err != nil {
@@ -32,7 +34,13 @@ var _ = Describe("Podman pause", func() {
Expect(err).To(BeNil())
if cgroupsv2 {
- _, err := os.Stat("/sys/fs/cgroup/cgroup.freeze")
+ b, err := ioutil.ReadFile("/proc/self/cgroup")
+ if err != nil {
+ Skip("cannot read self cgroup")
+ }
+
+ path := filepath.Join("/sys/fs/cgroup", strings.TrimSuffix(strings.Replace(string(b), "0::", "", 1), "\n"), "cgroup.freeze")
+ _, err = os.Stat(path)
if err != nil {
Skip("freezer controller not available on the current kernel")
}
@@ -73,7 +81,7 @@ var _ = Describe("Podman pause", func() {
Expect(result).To(ExitWithError())
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
- Expect(podmanTest.GetContainerStatus()).To(ContainSubstring(createdState))
+ Expect(strings.ToLower(podmanTest.GetContainerStatus())).To(ContainSubstring(createdState))
})
It("podman pause a running container by id", func() {
@@ -86,7 +94,7 @@ var _ = Describe("Podman pause", func() {
Expect(result.ExitCode()).To(Equal(0))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
- Expect(podmanTest.GetContainerStatus()).To(ContainSubstring(pausedState))
+ Expect(strings.ToLower(podmanTest.GetContainerStatus())).To(ContainSubstring(pausedState))
result = podmanTest.Podman([]string{"unpause", cid})
result.WaitWithDefaultTimeout()
@@ -103,7 +111,7 @@ var _ = Describe("Podman pause", func() {
Expect(result.ExitCode()).To(Equal(0))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
- Expect(podmanTest.GetContainerStatus()).To(ContainSubstring(pausedState))
+ Expect(strings.ToLower(podmanTest.GetContainerStatus())).To(ContainSubstring(pausedState))
result = podmanTest.Podman([]string{"container", "unpause", cid})
result.WaitWithDefaultTimeout()
@@ -134,14 +142,14 @@ var _ = Describe("Podman pause", func() {
Expect(result.ExitCode()).To(Equal(0))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
- Expect(podmanTest.GetContainerStatus()).To(ContainSubstring(pausedState))
+ Expect(strings.ToLower(podmanTest.GetContainerStatus())).To(ContainSubstring(pausedState))
result = podmanTest.Podman([]string{"rm", cid})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(2))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
- Expect(podmanTest.GetContainerStatus()).To(ContainSubstring(pausedState))
+ Expect(strings.ToLower(podmanTest.GetContainerStatus())).To(ContainSubstring(pausedState))
})
@@ -156,7 +164,7 @@ var _ = Describe("Podman pause", func() {
Expect(result.ExitCode()).To(Equal(0))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
- Expect(podmanTest.GetContainerStatus()).To(ContainSubstring(pausedState))
+ Expect(strings.ToLower(podmanTest.GetContainerStatus())).To(ContainSubstring(pausedState))
result = podmanTest.Podman([]string{"rm", "--force", cid})
result.WaitWithDefaultTimeout()
@@ -176,14 +184,14 @@ var _ = Describe("Podman pause", func() {
Expect(result.ExitCode()).To(Equal(0))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
- Expect(podmanTest.GetContainerStatus()).To(ContainSubstring(pausedState))
+ Expect(strings.ToLower(podmanTest.GetContainerStatus())).To(ContainSubstring(pausedState))
result = podmanTest.Podman([]string{"stop", cid})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(125))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
- Expect(podmanTest.GetContainerStatus()).To(ContainSubstring(pausedState))
+ Expect(strings.ToLower(podmanTest.GetContainerStatus())).To(ContainSubstring(pausedState))
result = podmanTest.Podman([]string{"unpause", cid})
result.WaitWithDefaultTimeout()
@@ -212,7 +220,7 @@ var _ = Describe("Podman pause", func() {
Expect(result.ExitCode()).To(Equal(0))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
- Expect(podmanTest.GetContainerStatus()).To(Equal(pausedState))
+ Expect(strings.ToLower(podmanTest.GetContainerStatus())).To(Equal(pausedState))
result = podmanTest.Podman([]string{"unpause", "test1"})
result.WaitWithDefaultTimeout()
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go
index 30abe2be2..e0a10c202 100644
--- a/test/e2e/pod_create_test.go
+++ b/test/e2e/pod_create_test.go
@@ -18,7 +18,6 @@ var _ = Describe("Podman pod create", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/pod_inspect_test.go b/test/e2e/pod_inspect_test.go
index 06f36c751..f87bbe047 100644
--- a/test/e2e/pod_inspect_test.go
+++ b/test/e2e/pod_inspect_test.go
@@ -16,7 +16,6 @@ var _ = Describe("Podman pod inspect", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
@@ -55,8 +54,7 @@ var _ = Describe("Podman pod inspect", func() {
inspect.WaitWithDefaultTimeout()
Expect(inspect.ExitCode()).To(Equal(0))
Expect(inspect.IsJSONOutputValid()).To(BeTrue())
- // FIXME sujil, disabled for now
- //podData := inspect.InspectPodToJSON()
- //Expect(podData.Config.ID).To(Equal(podid))
+ podData := inspect.InspectPodToJSON()
+ Expect(podData.ID).To(Equal(podid))
})
})
diff --git a/test/e2e/pod_kill_test.go b/test/e2e/pod_kill_test.go
index 29d7664df..a3efec46c 100644
--- a/test/e2e/pod_kill_test.go
+++ b/test/e2e/pod_kill_test.go
@@ -17,7 +17,6 @@ var _ = Describe("Podman pod kill", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/pod_pause_test.go b/test/e2e/pod_pause_test.go
index bb1719203..7067c9a87 100644
--- a/test/e2e/pod_pause_test.go
+++ b/test/e2e/pod_pause_test.go
@@ -15,10 +15,9 @@ var _ = Describe("Podman pod pause", func() {
podmanTest *PodmanTestIntegration
)
- pausedState := "Paused"
+ pausedState := "paused"
BeforeEach(func() {
- Skip(v2fail)
SkipIfRootless()
tempdir, err = CreateTempDirInTempDir()
if err != nil {
diff --git a/test/e2e/pod_prune_test.go b/test/e2e/pod_prune_test.go
index d0725883c..d98383331 100644
--- a/test/e2e/pod_prune_test.go
+++ b/test/e2e/pod_prune_test.go
@@ -16,7 +16,6 @@ var _ = Describe("Podman pod prune", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go
index ea9118f37..5f8712a7a 100644
--- a/test/e2e/pod_ps_test.go
+++ b/test/e2e/pod_ps_test.go
@@ -18,7 +18,6 @@ var _ = Describe("Podman ps", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
@@ -96,6 +95,7 @@ var _ = Describe("Podman ps", func() {
Expect(result.OutputToString()).To(ContainSubstring(podid2))
Expect(result.OutputToString()).To(Not(ContainSubstring(podid1)))
})
+
It("podman pod ps id filter flag", func() {
_, ec, podid := podmanTest.CreatePod("")
Expect(ec).To(Equal(0))
@@ -143,7 +143,7 @@ var _ = Describe("Podman ps", func() {
_, ec, _ = podmanTest.RunLsContainerInPod("test2", podid)
Expect(ec).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "ps", "--format={{.ContainerInfo}}", "--ctr-names"})
+ session = podmanTest.Podman([]string{"pod", "ps", "--format={{.ContainerNames}}", "--ctr-names"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(ContainSubstring("test1"))
@@ -228,4 +228,18 @@ var _ = Describe("Podman ps", func() {
Expect(session.OutputToString()).To(ContainSubstring(podid2))
Expect(session.OutputToString()).To(Not(ContainSubstring(podid3)))
})
+
+ It("pod no infra should ps", func() {
+ session := podmanTest.Podman([]string{"pod", "create", "--infra=false"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ ps := podmanTest.Podman([]string{"pod", "ps"})
+ ps.WaitWithDefaultTimeout()
+ Expect(ps.ExitCode()).To(Equal(0))
+
+ infra := podmanTest.Podman([]string{"pod", "ps", "--format", "{{.InfraId}}"})
+ infra.WaitWithDefaultTimeout()
+ Expect(len(infra.OutputToString())).To(BeZero())
+ })
})
diff --git a/test/e2e/pod_restart_test.go b/test/e2e/pod_restart_test.go
index 9938c70b8..691fe5f0c 100644
--- a/test/e2e/pod_restart_test.go
+++ b/test/e2e/pod_restart_test.go
@@ -16,7 +16,6 @@ var _ = Describe("Podman pod restart", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/pod_rm_test.go b/test/e2e/pod_rm_test.go
index 117b54987..90f178be6 100644
--- a/test/e2e/pod_rm_test.go
+++ b/test/e2e/pod_rm_test.go
@@ -19,7 +19,6 @@ var _ = Describe("Podman pod rm", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/pod_stats_test.go b/test/e2e/pod_stats_test.go
index bb3610a27..347f33e62 100644
--- a/test/e2e/pod_stats_test.go
+++ b/test/e2e/pod_stats_test.go
@@ -18,7 +18,6 @@ var _ = Describe("Podman pod stats", func() {
)
BeforeEach(func() {
- Skip(v2fail)
cgroupsv2, err := cgroups.IsCgroup2UnifiedMode()
Expect(err).To(BeNil())
diff --git a/test/e2e/pod_stop_test.go b/test/e2e/pod_stop_test.go
index 0c0085b82..a61917adb 100644
--- a/test/e2e/pod_stop_test.go
+++ b/test/e2e/pod_stop_test.go
@@ -16,7 +16,6 @@ var _ = Describe("Podman pod stop", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/pod_top_test.go b/test/e2e/pod_top_test.go
index 2f75aaf30..c313b0675 100644
--- a/test/e2e/pod_top_test.go
+++ b/test/e2e/pod_top_test.go
@@ -20,7 +20,6 @@ var _ = Describe("Podman top", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/run_dns_test.go b/test/e2e/run_dns_test.go
index 749047b76..02b9ff8d1 100644
--- a/test/e2e/run_dns_test.go
+++ b/test/e2e/run_dns_test.go
@@ -18,7 +18,6 @@ var _ = Describe("Podman run dns", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/run_ns_test.go b/test/e2e/run_ns_test.go
index 9c914188a..c8ba68efc 100644
--- a/test/e2e/run_ns_test.go
+++ b/test/e2e/run_ns_test.go
@@ -19,7 +19,6 @@ var _ = Describe("Podman run ns", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/run_passwd_test.go b/test/e2e/run_passwd_test.go
index 0868bce4f..bd6a0e036 100644
--- a/test/e2e/run_passwd_test.go
+++ b/test/e2e/run_passwd_test.go
@@ -18,7 +18,6 @@ var _ = Describe("Podman run passwd", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/run_restart_test.go b/test/e2e/run_restart_test.go
index 28ab23ab0..8bbdf2056 100644
--- a/test/e2e/run_restart_test.go
+++ b/test/e2e/run_restart_test.go
@@ -18,7 +18,6 @@ var _ = Describe("Podman run restart containers", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
diff --git a/test/e2e/run_signal_test.go b/test/e2e/run_signal_test.go
index 58dde62da..fbdd3acec 100644
--- a/test/e2e/run_signal_test.go
+++ b/test/e2e/run_signal_test.go
@@ -29,7 +29,6 @@ var _ = Describe("Podman run with --sig-proxy", func() {
)
BeforeEach(func() {
- Skip(v2fail)
tmpdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)