From 7497c7d4323a054d1c06cd642f233e7086750927 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Tue, 16 May 2017 23:15:16 +0000 Subject: [PATCH 1/3] Let conntrack track non-NATed short-lived connections --- probe/endpoint/connection_tracker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/probe/endpoint/connection_tracker.go b/probe/endpoint/connection_tracker.go index 6b14de207..b1ed08662 100644 --- a/probe/endpoint/connection_tracker.go +++ b/probe/endpoint/connection_tracker.go @@ -37,7 +37,7 @@ func newProcfsConnectionTracker(conf connectionTrackerConfig) connectionTracker } return connectionTracker{ conf: conf, - flowWalker: newConntrackFlowWalker(conf.UseConntrack, conf.ProcRoot, conf.BufferSize, "--any-nat"), + flowWalker: newConntrackFlowWalker(conf.UseConntrack, conf.ProcRoot, conf.BufferSize), ebpfTracker: nil, reverseResolver: newReverseResolver(), } From 74910317695e2dda6f8ae25b2858e164a33f621c Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 18 May 2017 19:57:44 +0000 Subject: [PATCH 2/3] Add integration test --- ...ntainer_to_container_edge_no_weave_test.sh | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 integration/350_container_to_container_edge_no_weave_test.sh diff --git a/integration/350_container_to_container_edge_no_weave_test.sh b/integration/350_container_to_container_edge_no_weave_test.sh new file mode 100755 index 000000000..930a2d708 --- /dev/null +++ b/integration/350_container_to_container_edge_no_weave_test.sh @@ -0,0 +1,24 @@ +#! /bin/bash + +# shellcheck disable=SC1091 +. ./config.sh + +set -x + +start_suite "Test short lived connections between containers without Weave (no NAT)" + +scope_on "$HOST1" launch +docker_on "$HOST1" run -d --name nginx nginx +wait_for_containers "$HOST1" 60 nginx +nginx_ip="$(docker_on "$HOST1" inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx)" +docker_on "$HOST1" run -d --name client alpine /bin/sh -c "while true; do \ + wget $nginx_ip:80/ -O - >/dev/null || true; \ + sleep 1; \ +done" +wait_for_containers "$HOST1" 60 client + +has_container "$HOST1" nginx +has_container "$HOST1" client +has_connection containers "$HOST1" client nginx + +scope_end_suite From 1063a7bf39ffe7ae8b0daf7b0aea37ea712fd622 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 18 May 2017 20:31:56 +0000 Subject: [PATCH 3/3] Remove test debugging --- integration/350_container_to_container_edge_no_weave_test.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/integration/350_container_to_container_edge_no_weave_test.sh b/integration/350_container_to_container_edge_no_weave_test.sh index 930a2d708..c9b47f2b3 100755 --- a/integration/350_container_to_container_edge_no_weave_test.sh +++ b/integration/350_container_to_container_edge_no_weave_test.sh @@ -3,8 +3,6 @@ # shellcheck disable=SC1091 . ./config.sh -set -x - start_suite "Test short lived connections between containers without Weave (no NAT)" scope_on "$HOST1" launch