Exemple #1
0
				_, err := container.Attach(42)
				Ω(err).ShouldNot(HaveOccurred())

				err = container.Stop(false)
				Ω(err).ShouldNot(HaveOccurred())

				Ω(fakeConnection.Stopped("some-handle")).Should(BeEmpty())
				Ω(otherFakeConnection.Stopped("some-handle")).ShouldNot(BeEmpty())
			})
		})
	})

	Describe("NetIn", func() {
		It("sends a net in request", func() {
			fakeConnection.WhenNetInning = func(handle string, hostPort, containerPort uint32) (uint32, uint32, error) {
				return 111, 222, nil
			}

			hostPort, containerPort, err := container.NetIn(123, 456)
			Ω(err).ShouldNot(HaveOccurred())
			Ω(hostPort).Should(Equal(uint32(111)))
			Ω(containerPort).Should(Equal(uint32(222)))

			Ω(fakeConnection.NetInned("some-handle")).Should(ContainElement(
				fake_connection.NetInSpec{
					HostPort:      123,
					ContainerPort: 456,
				},
			))
		})