Add regression/db-connection-leak-valgrind#981
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis pull request currently contains no functional or content changes; it appears to be a placeholder or test PR with an empty diff for plans/main.fmf. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
b8f9b08 to
51c968b
Compare
| @@ -0,0 +1,576 @@ | |||
| #!/bin/bash | |||
| # vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k | |||
| . /usr/share/beakerlib/beakerlib.sh || exit 1 | |||
Check warning
Code scanning / shellcheck
SC1091 Warning test
| rlRun "chown keylime:keylime '$log_dir'" | ||
|
|
||
| # Find keylime_verifier path (works for both RPM and upstream installs) | ||
| local verifier_path=$(command -v keylime_verifier) |
Check warning
Code scanning / shellcheck
SC2155 Warning test
| return 1 | ||
| fi | ||
|
|
||
| local log_files=$(find "$log_dir" -name "verifier-*.log" -type f) |
Check warning
Code scanning / shellcheck
SC2155 Warning test
|
|
||
| # Analyze each log file | ||
| for log_file in $log_files; do | ||
| local pid=$(basename "$log_file" | sed 's/verifier-\(.*\)\.log/\1/') |
Check warning
Code scanning / shellcheck
SC2155 Warning test
| rlLogInfo "Analyzing worker process $pid (worker #$num_workers)" | ||
|
|
||
| # Count open file descriptors at exit for this specific PID | ||
| local open_fds=$(grep "^==${pid}== Open file descriptor" "$log_file" | wc -l) |
Check warning
Code scanning / shellcheck
SC2155 Warning test
|
|
||
| # Check specifically for SQLite database FD leaks | ||
| local sqlite_fds=$(grep "^==${pid}== Open file descriptor.*cv_data.sqlite" "$log_file" | wc -l) | ||
| if [ $sqlite_fds -gt 0 ]; then |
Check warning
Code scanning / shellcheck
SC2086 Warning test
| rlLogWarning " Worker $pid: $sqlite_fds leaked SQLite database connections!" | ||
| leaked_sqlite_fds=$((leaked_sqlite_fds + sqlite_fds)) | ||
| workers_with_sqlite_leaks=$((workers_with_sqlite_leaks + 1)) | ||
| worker_sqlite_leaks[$pid]=$sqlite_fds |
Check warning
Code scanning / shellcheck
SC2034 Warning test
| leaked_sqlite_fds=$((leaked_sqlite_fds + sqlite_fds)) | ||
| workers_with_sqlite_leaks=$((workers_with_sqlite_leaks + 1)) | ||
| worker_sqlite_leaks[$pid]=$sqlite_fds | ||
| has_leaks=1 |
Check warning
Code scanning / shellcheck
SC2034 Warning test
| rlLogInfo "=== VALGRIND TEST COMPLETE ===" | ||
| rlLogInfo "All valgrind logs saved to: $VALGRIND_BASE_DIR" | ||
| rlLogInfo "Phases analyzed:" | ||
| find "$VALGRIND_BASE_DIR" -mindepth 1 -maxdepth 1 -type d | while read phase_dir; do |
Check warning
Code scanning / shellcheck
SC2162 Warning test
| rlLogInfo "All valgrind logs saved to: $VALGRIND_BASE_DIR" | ||
| rlLogInfo "Phases analyzed:" | ||
| find "$VALGRIND_BASE_DIR" -mindepth 1 -maxdepth 1 -type d | while read phase_dir; do | ||
| rlLogInfo " - $(basename $phase_dir)" |
Check warning
Code scanning / shellcheck
SC2086 Warning test
51c968b to
e29f503
Compare
e29f503 to
e1ac256
Compare
kkaarreell
left a comment
There was a problem hiding this comment.
I have just a few nitpicks.
However, it seems that the test reports various connection leaks even for the current upstream code and not consistently.
| - valgrind | ||
| recommend: | ||
| - keylime | ||
| - python3-tomli |
There was a problem hiding this comment.
this is not needed as we are not running a revocation script
There was a problem hiding this comment.
"This" here meaning the python3-tomli line?
There was a problem hiding this comment.
I removed the python3-tomli line there. Please let me know if it still needs adjusts.
e1ac256 to
8f148b4
Compare
This test uses valgrind and is based on the existing test regression/db-connection-leak-reproducer. It reproduces scenarios that would have caused connection leaks before the fix from PR keylime/keylime#1782. Signed-off-by: Sergio Correia <scorreia@redhat.com>
8f148b4 to
8c6959a
Compare
Also try to reduce the tests executed to the ones we care about. Signed-off-by: Sergio Correia <scorreia@redhat.com>
8c6959a to
e2a09b7
Compare
This test uses valgrind and is based on the existing test
regression/db-connection-leak-reproducer.