summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-24 09:27:24 -0500
committerGitHub <noreply@github.com>2021-02-24 09:27:24 -0500
commitdec06b1c3fbfad3fc75702f73ea59891a64989ad (patch)
treea53b37d895c761c56f12794166a2e295796300dc /test/e2e
parent4846f877b83ea55b1d70155fd668c79a4a0f88f4 (diff)
parentfc32ec768df8a59a9c438f38cf2fd2c08a77f94b (diff)
downloadpodman-dec06b1c3fbfad3fc75702f73ea59891a64989ad.tar.gz
podman-dec06b1c3fbfad3fc75702f73ea59891a64989ad.tar.bz2
podman-dec06b1c3fbfad3fc75702f73ea59891a64989ad.zip
Merge pull request #9494 from mheon/sort_caps
Sort CapDrop in inspect to guarantee order
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/inspect_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/e2e/inspect_test.go b/test/e2e/inspect_test.go
index d417fc49d..772ebed05 100644
--- a/test/e2e/inspect_test.go
+++ b/test/e2e/inspect_test.go
@@ -490,4 +490,22 @@ var _ = Describe("Podman inspect", func() {
}
Expect(found).To(BeTrue())
})
+
+ It("Dropped capabilities are sorted", func() {
+ ctrName := "testCtr"
+ session := podmanTest.Podman([]string{"run", "-d", "--cap-drop", "CAP_AUDIT_WRITE", "--cap-drop", "CAP_MKNOD", "--cap-drop", "CAP_NET_RAW", "--name", ctrName, ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(BeZero())
+
+ inspect := podmanTest.Podman([]string{"inspect", ctrName})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect.ExitCode()).To(BeZero())
+
+ data := inspect.InspectContainerToJSON()
+ Expect(len(data)).To(Equal(1))
+ Expect(len(data[0].HostConfig.CapDrop)).To(Equal(3))
+ Expect(data[0].HostConfig.CapDrop[0]).To(Equal("CAP_AUDIT_WRITE"))
+ Expect(data[0].HostConfig.CapDrop[1]).To(Equal("CAP_MKNOD"))
+ Expect(data[0].HostConfig.CapDrop[2]).To(Equal("CAP_NET_RAW"))
+ })
})