Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Capability tests does not rely on interited zeroed caps
Browse files Browse the repository at this point in the history
Signed-off-by: Will Martin <wmartin@pivotal.io>
  • Loading branch information
pppepito86 authored and williammartin committed Aug 4, 2016
1 parent 0b6a67f commit 9660800
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions integration/helpers/capcheck/capcheck_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ var _ = Describe("capcheck", func() {
Describe("probe "+cap, func() {
Context("when a process does have "+cap, func() { // assumes tests are run as root
It("succeeds", func() {
session, err := gexec.Start(exec.Command("capsh", "--", "-c", fmt.Sprintf("%s %s", capabilityTestBin, cap)), GinkgoWriter, GinkgoWriter)
session, err := gexec.Start(exec.Command("capsh", "--inh="+cap, "--", "-c", fmt.Sprintf("%s %s", capabilityTestBin, cap)), GinkgoWriter, GinkgoWriter)
Expect(err).NotTo(HaveOccurred())
Eventually(session).Should(gexec.Exit(0))
})
})

Context("when a process does not have "+cap, func() {
It("logs an error and returns a bad exit status code", func() {
session, err := gexec.Start(exec.Command("capsh", "--drop="+cap, "--", "-c", fmt.Sprintf("%s %s", capabilityTestBin, cap)), GinkgoWriter, GinkgoWriter)
session, err := gexec.Start(exec.Command("capsh", "--inh=", "--drop="+cap, "--", "-c", fmt.Sprintf("%s %s", capabilityTestBin, cap)), GinkgoWriter, GinkgoWriter)
Expect(err).NotTo(HaveOccurred())
Eventually(session).Should(gbytes.Say(expectedError))
Eventually(session).Should(gexec.Exit(1))
Expand Down

0 comments on commit 9660800

Please sign in to comment.