Skip to content

Commit

Permalink
Export freshclam.log as a tmt artifact
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Srb <[email protected]>
  • Loading branch information
msrb committed Jan 26, 2024
1 parent fafc667 commit 7954dd2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rpminspect_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ get_before_module_build() {
}


freshclam_log=${TMT_TEST_DATA:-.}/freshclam.log

update_clamav_database() {
# Update the virus dababase
config_file="freshclam.conf"
Expand All @@ -163,12 +165,12 @@ update_clamav_database() {
sed -i "s|^DatabaseMirror .*|DatabaseMirror $CLAMAV_DATABASE_MIRROR_URL|" "$config_file"
fi

freshclam --config-file="$config_file" > freshclam.log 2>&1 || :
freshclam --config-file="$config_file" > "$freshclam_log" 2>&1 || :
# freshclam returns 0 even if the update download fails
# https://github.com/Cisco-Talos/clamav/issues/965
# Let's check the log for the complaint about the outdated database
# and return non-zero if we find it there
! grep -q 'virus database is older' freshclam.log
! grep -q 'virus database is older' "$freshclam_log"
}


Expand Down

0 comments on commit 7954dd2

Please sign in to comment.