Exemple #1
0
				thePreparedCmd, theReturnedError = preparer.PrepareCmd(spec)
			})

			It("executes the proc_starter binary with the process path and args", func() {
				Expect(theReturnedError).To(BeNil())
				Expect(thePreparedCmd.Path).To(Equal("/path/to/proc/starter"))
				Expect(thePreparedCmd.Args[0]).To(Equal("/path/to/proc/starter"))
				Expect(thePreparedCmd.Args).To(ContainElement("fishfinger"))
				Expect(thePreparedCmd.Args).To(ContainElement("foo"))
				Expect(thePreparedCmd.Args).To(ContainElement("bar"))
			})

			Context("when configured to always drop capabilities", func() {
				BeforeEach(func() {
					preparer.AlwaysDropCapabilities = true
					spec.User = "******"
				})

				It("passes the -dropCapabilities flag as true", func() {
					Expect(thePreparedCmd.Args).To(ContainElement("-dropCapabilities=true"))
				})

				It("passes the -extendedWhitelist flag as false", func() {
					Expect(thePreparedCmd.Args).To(ContainElement("-extendedWhitelist=false"))
				})
			})

			Context("when configured not to always drop capabilities", func() {
				BeforeEach(func() {
					preparer.AlwaysDropCapabilities = false
				})
Exemple #2
0
func (container *gardenWorkerContainer) Run(spec garden.ProcessSpec, io garden.ProcessIO) (garden.Process, error) {
	spec.User = container.user
	return container.Container.Run(spec, io)
}