|
@@ -67,10 +67,7 @@ func TestNetworkLoopbackNat(t *testing.T) {
|
|
client := request.NewAPIClient(t)
|
|
client := request.NewAPIClient(t)
|
|
ctx := context.Background()
|
|
ctx := context.Background()
|
|
|
|
|
|
- cID := container.Run(t, ctx, client, container.WithCmd("sh", "-c", fmt.Sprintf("stty raw && nc -w 5 %s 8080", endpoint.String())), func(c *container.TestContainerConfig) {
|
|
|
|
- c.Config.Tty = true
|
|
|
|
- c.HostConfig.NetworkMode = "container:server"
|
|
|
|
- })
|
|
|
|
|
|
+ cID := container.Run(t, ctx, client, container.WithCmd("sh", "-c", fmt.Sprintf("stty raw && nc -w 5 %s 8080", endpoint.String())), container.WithTty(true), container.WithNetworkMode("container:server"))
|
|
|
|
|
|
poll.WaitOn(t, containerIsStopped(ctx, client, cID), poll.WithDelay(100*time.Millisecond))
|
|
poll.WaitOn(t, containerIsStopped(ctx, client, cID), poll.WithDelay(100*time.Millisecond))
|
|
|
|
|
|
@@ -91,10 +88,7 @@ func startServerContainer(t *testing.T, msg string, port int) string {
|
|
client := request.NewAPIClient(t)
|
|
client := request.NewAPIClient(t)
|
|
ctx := context.Background()
|
|
ctx := context.Background()
|
|
|
|
|
|
- cID := container.Run(t, ctx, client, container.WithCmd("sh", "-c", fmt.Sprintf("echo %q | nc -lp %d", msg, port)), func(c *container.TestContainerConfig) {
|
|
|
|
- c.Config.ExposedPorts = map[nat.Port]struct{}{
|
|
|
|
- nat.Port(fmt.Sprintf("%d/tcp", port)): {},
|
|
|
|
- }
|
|
|
|
|
|
+ cID := container.Run(t, ctx, client, container.WithName("server"), container.WithCmd("sh", "-c", fmt.Sprintf("echo %q | nc -lp %d", msg, port)), container.WithExposedPorts(fmt.Sprintf("%d/tcp", port)), func(c *container.TestContainerConfig) {
|
|
c.HostConfig.PortBindings = nat.PortMap{
|
|
c.HostConfig.PortBindings = nat.PortMap{
|
|
nat.Port(fmt.Sprintf("%d/tcp", port)): []nat.PortBinding{
|
|
nat.Port(fmt.Sprintf("%d/tcp", port)): []nat.PortBinding{
|
|
{
|
|
{
|