summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-23 15:33:46 -0400
committerGitHub <noreply@github.com>2020-06-23 15:33:46 -0400
commit81f4204e4e0c8074e2709bd7c4db3f1f61d1b351 (patch)
treea7f65f1d76341812e844920780b7f9ee7867559c
parent0d961a40ba40b3fbd69090c49ee3cec7151f8a8e (diff)
parent039eaccb5b27cedf39a0b8b84697300bf53a6335 (diff)
downloadpodman-81f4204e4e0c8074e2709bd7c4db3f1f61d1b351.tar.gz
podman-81f4204e4e0c8074e2709bd7c4db3f1f61d1b351.tar.bz2
podman-81f4204e4e0c8074e2709bd7c4db3f1f61d1b351.zip
Merge pull request #6728 from mheon/add_privileged_tests
Add tests for --privileged with other flags
-rw-r--r--test/e2e/run_selinux_test.go9
-rw-r--r--test/e2e/run_test.go8
2 files changed, 17 insertions, 0 deletions
diff --git a/test/e2e/run_selinux_test.go b/test/e2e/run_selinux_test.go
index 358137aa9..8b33a05b2 100644
--- a/test/e2e/run_selinux_test.go
+++ b/test/e2e/run_selinux_test.go
@@ -177,4 +177,13 @@ var _ = Describe("Podman run", func() {
Expect(session.OutputToString()).To(Equal(session1.OutputToString()))
})
+ It("podman run --privileged and --security-opt SELinux options", func() {
+ session := podmanTest.Podman([]string{"run", "-it", "--privileged", "--security-opt", "label=type:spc_t", "--security-opt", "label=level:s0:c1,c2", ALPINE, "cat", "/proc/self/attr/current"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ match, _ := session.GrepString("spc_t")
+ Expect(match).To(BeTrue())
+ match2, _ := session.GrepString("s0:c1,c2")
+ Expect(match2).To(BeTrue())
+ })
})
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 90179964d..42754bab4 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -1039,4 +1039,12 @@ USER mail`
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
+
+ It("podman run --privileged and --group-add", func() {
+ groupName := "kvm"
+ session := podmanTest.Podman([]string{"run", "-t", "-i", "--group-add", groupName, "--privileged", fedoraMinimal, "groups"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(strings.Contains(session.OutputToString(), groupName)).To(BeTrue())
+ })
})