diff options
author | Jhon Honce <jhonce@redhat.com> | 2018-02-21 16:54:24 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-02-22 12:39:08 +0000 |
commit | b8d1ce03a142d386e88ed505c1895d50b47448a5 (patch) | |
tree | df50d0e91ead7a280eba2ccd3d2b87bb3702a94a /test/e2e | |
parent | a58e9f7cee4c0b6060b91246ea4a007eebb30d7f (diff) | |
download | podman-b8d1ce03a142d386e88ed505c1895d50b47448a5.tar.gz podman-b8d1ce03a142d386e88ed505c1895d50b47448a5.tar.bz2 podman-b8d1ce03a142d386e88ed505c1895d50b47448a5.zip |
Add tests and cleanup
- Added run_cgroup_parent_test.go
- Cleaned up calls to logrus
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Closes: #370
Approved by: rhatdan
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/run_cgroup_parent_test.go | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/test/e2e/run_cgroup_parent_test.go b/test/e2e/run_cgroup_parent_test.go new file mode 100644 index 000000000..7647eb6d4 --- /dev/null +++ b/test/e2e/run_cgroup_parent_test.go @@ -0,0 +1,58 @@ +package integration + +import ( + "os" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +var _ = Describe("Podman run with --cgroup-parent", func() { + var ( + tempdir string + err error + podmanTest PodmanTest + ) + + BeforeEach(func() { + tempdir, err = CreateTempDirInTempDir() + if err != nil { + os.Exit(1) + } + podmanTest = PodmanCreate(tempdir) + podmanTest.RestoreAllArtifacts() + podmanTest.RestoreArtifact(fedoraMinimal) + }) + + AfterEach(func() { + podmanTest.Cleanup() + + }) + + Specify("valid --cgroup-parent using cgroupfs", func() { + cgroup := "/zzz" + run := podmanTest.Podman([]string{"run", "--cgroup-parent", cgroup, fedoraMinimal, "cat", "/proc/self/cgroup"}) + run.WaitWithDefaultTimeout() + Expect(run.ExitCode()).To(Equal(0)) + ok, _ := run.GrepString(cgroup) + Expect(ok).To(BeTrue()) + }) + + Specify("no --cgroup-parent", func() { + cgroup := "/libpod_parent" + run := podmanTest.Podman([]string{"run", fedoraMinimal, "cat", "/proc/self/cgroup"}) + run.WaitWithDefaultTimeout() + Expect(run.ExitCode()).To(Equal(0)) + ok, _ := run.GrepString(cgroup) + Expect(ok).To(BeTrue()) + }) + + Specify("valid --cgroup-parent using slice", func() { + cgroup := "aaaa.slice" + run := podmanTest.Podman([]string{"run", "--cgroup-parent", cgroup, fedoraMinimal, "cat", "/proc/1/cgroup"}) + run.WaitWithDefaultTimeout() + Expect(run.ExitCode()).To(Equal(0)) + ok, _ := run.GrepString(cgroup) + Expect(ok).To(BeTrue()) + }) +}) |