Skip to content

Commit

Permalink
Check the name/result/end-time for specific subtest
Browse files Browse the repository at this point in the history
  • Loading branch information
seberm committed Nov 13, 2024
1 parent 09baee7 commit 0403036
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/execute/result/special.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ rlJournalStart
RESULT_FILE_BASIC="$run/plan/execute/data/guest/default-0/test/0-7-special-characters-in-the-name-1/data/tmt-report-results.yaml"
rlRun "yq -e '.' $RESULT_FILE_BASIC" 0 "Check the YAML is valid"

rlAssertGrep 'name: "/0\.\.7 \\"special\\": \\" characters: \*\$@|&>< in: the: name"' "$RESULT_FILE_BASIC"
rlAssertGrep "result: \"pass\"" "$RESULT_FILE_BASIC"
rlAssertGrep "end-time: \".*\"" "$RESULT_FILE_BASIC"
# Get and test the concrete item from the list of subresults
rlRun "yq -ery '.[] | select(.name == \"/0..7 \\\"special\\\": \\\" characters: *\$@|&>< in: the: name\")' \"$RESULT_FILE_BASIC\" | tee subresult.out"
rlAssertGrep "name: '/0\.\.7 \\\"special\\\": \\\" characters: \\*\\\$@|&>< in: the: name'" "subresult.out"
rlAssertGrep "result: pass" "subresult.out"
rlAssertGrep "end-time: '.*'" "subresult.out"

# Beakerlib phase names with special chars
RESULT_FILE_BKRLIB="$run/plan/execute/data/guest/default-0/test/beakerlib-special-names-2/data/tmt-report-results.yaml"
Expand All @@ -27,14 +29,16 @@ rlJournalStart
'/02-so-me-phase-na-me' \
/{03..14}-some
do
rlAssertGrep "name: \"${phase_name}\"" "$RESULT_FILE_BKRLIB"
rlAssertGrep "result: \"pass\"" "$RESULT_FILE_BKRLIB"
rlAssertGrep "end-time: \".*\"" "$RESULT_FILE_BKRLIB"
rlRun "yq -ery '.[] | select(.name == \"${phase_name}\")' \"$RESULT_FILE_BKRLIB\" | tee subresult.out"
rlAssertGrep "name: ${phase_name}" "subresult.out"
rlAssertGrep "result: pass" "subresult.out"
rlAssertGrep "end-time: '.*'" "subresult.out"
done
rlPhaseEnd

rlPhaseStartCleanup
rlRun "popd"
rlRun "rm subresult.out" 0 "Remove subresult temporary file"
rlRun "rm -r ${run}" 0 "Remove run directory"
rlPhaseEnd
rlJournalEnd

0 comments on commit 0403036

Please sign in to comment.