-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
tmt run --follow
, add test coverage for it
Wrong indent in `Run.follow()` introduced in c105887 caused the `--follow` option to trigger a traceback. Fix the indent and add basic test coverage to prevent similar regressions in the future.
- Loading branch information
Showing
5 changed files
with
43 additions
and
6 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 @@ | ||
1 |
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,10 @@ | ||
/plan: | ||
discover: | ||
how: fmf | ||
provision: | ||
how: local | ||
execute: | ||
how: tmt | ||
|
||
/test: | ||
test: for i in {00..05}; do echo step-$i; sleep 1; done |
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 @@ | ||
summary: Ensure that following debug log works |
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,25 @@ | ||
#!/bin/bash | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
rlJournalStart | ||
rlPhaseStartSetup | ||
rlRun "run=\$(mktemp -d)" 0 "Create run directory" | ||
rlRun "pushd data" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest | ||
rlRun "tmt run --id $run &>/dev/null &" 0 "Start a tmt run in background" | ||
rlRun "sleep 1" 0 "Ignore logging during the first second" | ||
rlRun -s "timeout -s INT 3 tmt run --id $run --follow" 124 "Follow logs for 3 seconds" | ||
rlAssertGrep "step-01" $rlRun_LOG | ||
rlAssertGrep "step-02" $rlRun_LOG | ||
rlAssertNotGrep "step-04" $rlRun_LOG | ||
rlAssertNotGrep "step-05" $rlRun_LOG | ||
rlRun "wait $!" 0 "Wait until the run is finished" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
rlRun "popd" | ||
rlRun "rm -r $run" 0 "Remove run directory" | ||
rlPhaseEnd | ||
rlJournalEnd |
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