diff --git a/tests/status/base/test.sh b/tests/status/base/test.sh index 0f398f57d5..bfeb56bf87 100755 --- a/tests/status/base/test.sh +++ b/tests/status/base/test.sh @@ -38,7 +38,7 @@ rlJournalStart rlLog "There should be the heading and one run" rlAssertGrep "2" "lines" - rlRun "tmt status -i /not/a/valid/runid | tee output" 0 "Invalid ID" + rlRun "tmt status -i /not/a/valid/runid | tee output" 2 "Invalid ID" rlRun "wc -l output | tee lines" 0 "Get the number of lines" rlLog "There should only be the heading" rlAssertGrep "1" "lines" diff --git a/tmt/utils/__init__.py b/tmt/utils/__init__.py index 222a535aae..7b3e7e1b2d 100644 --- a/tmt/utils/__init__.py +++ b/tmt/utils/__init__.py @@ -4518,6 +4518,9 @@ def generate_runs( run_path = Path(id_name) if '/' not in id_name: run_path = path / run_path + if not run_path.exists(): + raise tmt.utils.GeneralError( + f"Directory '{run_path}' does not exist.") if run_path.is_absolute() and run_path.exists(): yield run_path else: