add container network mode test

This commit is contained in:
nils måsén 2023-07-25 19:00:46 +02:00
parent e8b208e9ac
commit 3b750c2b27
8 changed files with 954 additions and 17 deletions

View file

@ -216,6 +216,19 @@ var _ = Describe("the client", func() {
Expect(containers).NotTo(ContainElement(havingRestartingState(true)))
})
})
When(`a container uses container network mode`, func() {
It("should return the container name instead of the ID", func() {
mockServer.AppendHandlers(mocks.GetContainerHandlers("net_consumer")...)
client := dockerClient{
api: docker,
ClientOptions: ClientOptions{PullImages: false},
}
container, err := client.GetContainer(mocks.NetConsumerID)
Expect(err).NotTo(HaveOccurred())
networkMode := container.ContainerInfo().HostConfig.NetworkMode
Expect(networkMode.ConnectedContainer()).To(Equal(mocks.NetProducerContainerName))
})
})
})
Describe(`ExecuteCommand`, func() {
When(`logging`, func() {