Skip to content

Commit

Permalink
Fix path to watchdog log (#2901)
Browse files Browse the repository at this point in the history
It needs to be relative to step workdir, and it belongs to the directory
dedicated to check logs.
  • Loading branch information
happz authored May 31, 2024
1 parent 763ab00 commit cf64718
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/test/check/test-watchdog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rlJournalStart
rlRun "test_dir=$run/plan/execute/data/guest/default-0/watchdog/ping-1"
rlRun "log=$run/log.txt"
rlRun "test_log=$test_dir/output.txt"
rlRun "watchdog_log=$test_dir/tmt-watchdog.txt"
rlRun "watchdog_log=$test_dir/checks/tmt-watchdog.txt"

if [ "$PROVISION_HOW" = "container" ]; then
rlRun "tmt -c provision_method=$PROVISION_HOW run --id $run --scratch -a -vv provision -h $PROVISION_HOW test -n /watchdog" 1
Expand Down
7 changes: 4 additions & 3 deletions tmt/checks/watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
def render_report_path(invocation: 'TestInvocation') -> Path:
""" Render path to a watchdog report file from necessary components """

return invocation.path / REPORT_FILENAME
return invocation.check_files_path / REPORT_FILENAME


def report_progress(
Expand Down Expand Up @@ -479,9 +479,10 @@ def after_test(

guest_context.thread = None

assert invocation.phase.step.workdir is not None # narrow type

return [
CheckResult(
name='watchdog',
result=ResultOutcome.PASS,
log=[render_report_path(invocation)]
)]
log=[render_report_path(invocation).relative_to(invocation.phase.step.workdir)])]

0 comments on commit cf64718

Please sign in to comment.