-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add app integeration test #23
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
==========================================
- Coverage 27.10% 27.08% -0.02%
==========================================
Files 81 81
Lines 6837 6844 +7
==========================================
+ Hits 1853 1854 +1
- Misses 4800 4806 +6
Partials 184 184
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
d1abc8f
to
86fa441
Compare
eb8b8d2
to
262dc24
Compare
test/integration/common.go
Outdated
func doKprobeCheck(t *testing.T, output *bytes.Buffer) bool { | ||
str := `Kprobe count: ([0-9]+)` | ||
if ok, count := doProbeCommonCheck(t, output, str); ok { | ||
t.Logf("counted %d application executions so far, BPF program is functioning", count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.Logf("counted %d application executions so far, BPF program is functioning", count) | |
t.Logf("counted %d kprobe executions so far, BPF program is functioning", count) |
test/integration/common.go
Outdated
func doAppKprobeCheck(t *testing.T, output *bytes.Buffer) bool { | ||
str := `Kprobe: count: ([0-9]+)` | ||
if ok, count := doProbeCommonCheck(t, output, str); ok { | ||
t.Logf("counted %d application executions so far, BPF program is functioning", count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.Logf("counted %d application executions so far, BPF program is functioning", count) | |
t.Logf("counted %d kprobe executions so far, BPF program is functioning", count) |
return false | ||
} | ||
|
||
func doAppKprobeCheck(t *testing.T, output *bytes.Buffer) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just an observation, but I changed the logs for the application example so they had a similar format and it was more clear to me that all the code was running. As a result we need separate checks here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just seeing kprobe, tracepoint and uprobe logs in the test output:
=== RUN TestApplicationGoCounter
app_test.go:26: deploying target required for uprobe counter program if its not already deployed
app_test.go:29: waiting for go target userspace daemon to be available
app_test.go:38: deploying application counter program
app_test.go:45: waiting for go application counter userspace daemon to be available
common.go:28: counted 139291 application executions so far, BPF program is functioning
common.go:73: counted 3 SIGUSR1 signals so far, BPF program is functioning
common.go:91: counted 12 uprobe executions so far, BPF program is functioning
--- PASS: TestApplicationGoCounter (46.87s)
What happened to the TC and XDP checks?
I see what's happening. The kprobe, tracepoint and uprobe checks have a log, but the TC and XDP checks don't. However, the other tests also dump the log, so you can still tell that it's functioning when looking at the test log. I think it would be good to have "BPF program is functioning" logs for TC and XDP too. |
|
||
func doTcCheck(t *testing.T, output *bytes.Buffer) bool { | ||
if strings.Contains(output.String(), "packets received") && strings.Contains(output.String(), "bytes received") { | ||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a "BPF program is functioning" log for the TC and XDP checks as is done for the other types.
I have a few minor requests for some log changes, but otherwise, this looks good to me. Thanks! |
262dc24
to
82cb08f
Compare
Signed-off-by: Mohamed Mahmoud <[email protected]>
82cb08f
to
40f93c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fix catalog for ocp4.17
depends on
#6
bpfman/bpfman#1154