Esempio n. 1
0
func restartGarden(client *runner.RunningGarden, argv ...string) {
	Expect(client.Ping()).To(Succeed(), "tried to restart garden while it was not running")
	Expect(client.Stop()).To(Succeed())
	client = startGarden(argv...)
}
Esempio n. 2
0
	JustBeforeEach(func() {
		client = startGarden(args...)
	})

	Describe("--iptables-bin flag", func() {
		Context("when the path is valid", func() {
			BeforeEach(func() {
				args = append(args, "--iptables-bin", "/sbin/iptables")
			})

			AfterEach(func() {
				Expect(client.DestroyAndStop()).To(Succeed())
			})

			It("should succeed to start the server", func() {
				Expect(client.Ping()).To(Succeed())
			})
		})

		Context("when the path is invalid", func() {
			BeforeEach(func() {
				args = append(args, "--iptables-bin", "/path/to/iptables/bin")
			})

			It("should fail to start the server", func() {
				Expect(client.Ping()).To(HaveOccurred())
			})
		})

		Context("when the path is valid but it's not iptables", func() {
			BeforeEach(func() {