-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#! /bin/bash | ||
|
||
# shellcheck disable=SC1091 | ||
. ./config.sh | ||
|
||
start_suite "Test short lived connections from the Internet" | ||
|
||
weave_on "$HOST1" launch | ||
scope_on "$HOST1" launch --probe.ebpf.connections=true | ||
docker_on "$HOST1" run -d -p 80:80 --name nginx nginx | ||
|
||
do_connections() { | ||
while true; do | ||
curl -s "http://$HOST1:80/" >/dev/null || true | ||
sleep 1 | ||
done | ||
} | ||
do_connections & | ||
|
||
wait_for_containers "$HOST1" 60 nginx "The Internet" | ||
|
||
has_connection_by_id containers "$HOST1" "in-theinternet" "$(node_id containers "$HOST1" nginx)" | ||
|
||
endpoints_have_ebpf "$HOST1" | ||
|
||
kill %do_connections | ||
|
||
scope_end_suite |
24 changes: 24 additions & 0 deletions
24
integration/311_container_to_container_edge_with_ebpf_test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#! /bin/bash | ||
|
||
# shellcheck disable=SC1091 | ||
. ./config.sh | ||
|
||
start_suite "Test short lived connections between containers, with ebpf connection tracking enabled" | ||
|
||
weave_on "$HOST1" launch | ||
scope_on "$HOST1" launch --probe.ebpf.connections=true | ||
weave_on "$HOST1" run -d --name nginx nginx | ||
weave_on "$HOST1" run -d --name client alpine /bin/sh -c "while true; do \ | ||
wget http://nginx.weave.local:80/ -O - >/dev/null || true; \ | ||
sleep 1; \ | ||
done" | ||
|
||
wait_for_containers "$HOST1" 60 nginx client | ||
|
||
has_container "$HOST1" nginx | ||
has_container "$HOST1" client | ||
has_connection containers "$HOST1" client nginx | ||
|
||
endpoints_have_ebpf "$HOST1" | ||
|
||
scope_end_suite |
20 changes: 20 additions & 0 deletions
20
integration/312_container_to_container_edge_same_netns_with_ebpf_test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /bin/bash | ||
|
||
# shellcheck disable=SC1091 | ||
. ./config.sh | ||
|
||
start_suite "Test short lived connection between containers in same network namespace, with ebpf connection tracking enabled" | ||
|
||
scope_on "$HOST1" launch --probe.ebpf.connections=true | ||
docker_on "$HOST1" run -d --name nginx nginx | ||
docker_on "$HOST1" run -d --net=container:nginx --name client albanc/dialer /go/bin/dialer connectshortlived localhost:80 | ||
|
||
wait_for_containers "$HOST1" 60 nginx client | ||
|
||
has_container "$HOST1" nginx | ||
has_container "$HOST1" client | ||
has_connection containers "$HOST1" client nginx | ||
|
||
endpoints_have_ebpf "$HOST1" | ||
|
||
scope_end_suite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters