From 586bb86a2ac58056b0d0d23274fb98ec599b0908 Mon Sep 17 00:00:00 2001 From: baude Date: Thu, 15 Feb 2018 08:17:35 -0600 Subject: Run podman inside a podman container We should be able to run nested podman containers in particular for our testing environment. i.e. eat our own dog food. Some privileges had to be corrected in order for this to work correctly. Added a third papr target that runs podman tests inside podman. I marked the test as not required right now as we get more confident in the results Signed-off-by: baude Closes: #340 Approved by: rhatdan --- test/e2e/libpod_suite_test.go | 20 ++++++++++++++++++++ test/e2e/run_privileged_test.go | 7 +------ 2 files changed, 21 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index afe91134e..c479a6cef 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -460,3 +460,23 @@ func (p *PodmanTest) BuildImage(dockerfile, imageName string) { session.Wait(120) Expect(session.ExitCode()).To(Equal(0)) } + +//GetHostDistribution returns the dist in string format. If the +//distribution cannot be determined, an empty string will be returned. +func (p *PodmanTest) GetHostDistribution() string { + content, err := ioutil.ReadFile("/etc/os-release") + if err != nil { + return "" + } + for _, line := range content { + if strings.HasPrefix(fmt.Sprintf("%s", line), "ID") { + fields := strings.Split(fmt.Sprintf("%s", line), "=") + if len(fields) < 2 { + return "" + } + return strings.Trim(fields[1], "\"") + + } + } + return "" +} diff --git a/test/e2e/run_privileged_test.go b/test/e2e/run_privileged_test.go index b53be15f0..430698ba1 100644 --- a/test/e2e/run_privileged_test.go +++ b/test/e2e/run_privileged_test.go @@ -61,16 +61,11 @@ var _ = Describe("Podman privileged container tests", func() { }) It("podman cap-drop CapEff", func() { - cap := podmanTest.SystemExec("grep", []string{"CapAmb", "/proc/self/status"}) - cap.WaitWithDefaultTimeout() - Expect(cap.ExitCode()).To(Equal(0)) session := podmanTest.Podman([]string{"run", "--cap-drop", "all", "busybox", "grep", "CapEff", "/proc/self/status"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - - capAmp := strings.Split(cap.OutputToString(), " ") capEff := strings.Split(session.OutputToString(), " ") - Expect(capAmp[1]).To(Equal(capEff[1])) + Expect("0000000000000000").To(Equal(capEff[1])) }) It("podman non-privileged should have very few devices", func() { -- cgit v1.2.3-54-g00ecf