-
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.
Merge pull request #2518 from kinvolk/alban/fdinstall
handle fdinstall events from tcptracer-bpf (aka "accept before kretprobe" issue)
- Loading branch information
Showing
28 changed files
with
419 additions
and
92 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,39 @@ | ||
#! /bin/bash | ||
|
||
# shellcheck disable=SC1091 | ||
. ./config.sh | ||
|
||
start_suite "Test accept before kretprobe, see https://github.com/weaveworks/tcptracer-bpf/issues/10" | ||
|
||
weave_on "$HOST1" launch | ||
|
||
# Launch the server before Scope to make sure it calls accept() before Scope's | ||
# kretprobe on the accept function is installed. We use busybox' nc instead of | ||
# Alpine's nc so that it blocks on the accept() syscall. | ||
weave_on "$HOST1" run -d --name server busybox /bin/sh -c "while true; do \ | ||
date ; | ||
sleep 1 ; | ||
done | nc -l -p 8080" | ||
|
||
scope_on "$HOST1" launch --probe.ebpf.connections=true | ||
wait_for_containers "$HOST1" 60 server | ||
has_container "$HOST1" server | ||
|
||
weave_on "$HOST1" run -d --name client busybox /bin/sh -c "ping -c 5 server.weave.local; \ | ||
while true; do \ | ||
date ; | ||
sleep 1 ; | ||
done | nc server.weave.local 8080" | ||
|
||
wait_for_containers "$HOST1" 60 server client | ||
|
||
has_container "$HOST1" client | ||
|
||
list_containers "$HOST1" | ||
list_connections "$HOST1" | ||
|
||
has_connection containers "$HOST1" client server | ||
|
||
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
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
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
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
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,16 @@ | ||
package procspy | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
) | ||
|
||
// ReadTCPFiles reads the proc files tcp and tcp6 for a pid | ||
func ReadTCPFiles(pid int, buf *bytes.Buffer) (int64, error) { | ||
return 0, fmt.Errorf("not supported on non-Linux systems") | ||
} | ||
|
||
// ReadNetnsFromPID gets the netns inode of the specified pid | ||
func ReadNetnsFromPID(pid int) (uint64, error) { | ||
return 0, fmt.Errorf("not supported on non-Linux systems") | ||
} |
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
Oops, something went wrong.