|
|
973099d |
From 4284be292d6a409f83952702e0a4f0f8cdd8d637 Mon Sep 17 00:00:00 2001
|
|
|
973099d |
From: Dalibor Pospisil <dapospis@redhat.com>
|
|
|
973099d |
Date: Thu, 17 Jul 2014 13:07:10 +0200
|
|
|
973099d |
Subject: [PATCH] reverting conditional phases support, except for common
|
|
|
973099d |
handling of phase start
|
|
|
973099d |
|
|
|
973099d |
---
|
|
|
973099d |
src/logging.sh | 64 ----------------------------------------------------------
|
|
|
973099d |
1 file changed, 64 deletions(-)
|
|
|
973099d |
|
|
|
973099d |
diff --git a/src/logging.sh b/src/logging.sh
|
|
|
973099d |
index d831ac8..b01b102 100644
|
|
|
973099d |
--- a/src/logging.sh
|
|
|
973099d |
+++ b/src/logging.sh
|
|
|
973099d |
@@ -756,21 +756,6 @@ rlShowRunningKernel() {
|
|
|
973099d |
}
|
|
|
973099d |
|
|
|
973099d |
|
|
|
973099d |
-__INTERNAL_conditional_phase_eval() {
|
|
|
973099d |
- # check phases black-list
|
|
|
973099d |
- [[ -n "$PHASES_BL" && "$1" =~ $PHASES_BL ]] && {
|
|
|
973099d |
- rlLogWarning "Phase '$1' should be skipped as it is defined in \$PHASES_BL='$PHASES_BL'"
|
|
|
973099d |
- return 2
|
|
|
973099d |
- }
|
|
|
973099d |
- # always execute Setup, Cleanup and if no PHASES (white-list) specified
|
|
|
973099d |
- [[ "$1" == "Setup" || "$1" == "Cleanup" || -z "$PHASES" ]] && return 0
|
|
|
973099d |
- [[ "$1" =~ $PHASES ]] && return 0 || {
|
|
|
973099d |
- rlLogWarning "Phase '$1' should be skipped as it is not defined in \$PHASES='$PHASES'"
|
|
|
973099d |
- return 1
|
|
|
973099d |
- }
|
|
|
973099d |
-}
|
|
|
973099d |
-
|
|
|
973099d |
-
|
|
|
973099d |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
973099d |
# rlPhaseStart
|
|
|
973099d |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
973099d |
@@ -813,14 +798,10 @@ Optional name of the phase (if not provided, one will be generated).
|
|
|
973099d |
|
|
|
973099d |
If all asserts included in the phase pass, phase reports PASS.
|
|
|
973099d |
|
|
|
973099d |
-Returns non-zero if something went wrong or if the phase is not supposed to be
|
|
|
973099d |
-executed (refer to B<Conditional phases> section) otherwise retun 0.
|
|
|
973099d |
-
|
|
|
973099d |
=cut
|
|
|
973099d |
|
|
|
973099d |
rlPhaseStart() {
|
|
|
973099d |
if [ "x$1" = "xFAIL" -o "x$1" = "xWARN" ] ; then
|
|
|
973099d |
- __INTERNAL_conditional_phase_eval "$2" && \
|
|
|
973099d |
rljAddPhase "$1" "$2"
|
|
|
973099d |
return $?
|
|
|
973099d |
else
|
|
|
973099d |
@@ -878,9 +859,6 @@ used.
|
|
|
973099d |
|
|
|
973099d |
If you do not want these shortcuts, use plain C<rlPhaseStart> function.
|
|
|
973099d |
|
|
|
973099d |
-Returns non-zero if something went wrong or if the phase is not supposed to be
|
|
|
973099d |
-executed (refer to B<Conditional phases> section) otherwise retun 0.
|
|
|
973099d |
-
|
|
|
973099d |
=cut
|
|
|
973099d |
|
|
|
973099d |
rlPhaseStartSetup() {
|
|
|
973099d |
@@ -893,48 +871,6 @@ rlPhaseStartCleanup() {
|
|
|
973099d |
rlPhaseStart "WARN" "${1:-Cleanup}"
|
|
|
973099d |
}
|
|
|
973099d |
|
|
|
973099d |
-: <<'=cut'
|
|
|
973099d |
-=pod
|
|
|
973099d |
-
|
|
|
973099d |
-=head2 Conditional phases
|
|
|
973099d |
-
|
|
|
973099d |
-Each test phase can be conditionally skipped based on bash regular expression
|
|
|
973099d |
-given in PHASES_BL and/or PHASES variables.
|
|
|
973099d |
-
|
|
|
973099d |
-=over
|
|
|
973099d |
-
|
|
|
973099d |
-=item PHASES_BL
|
|
|
973099d |
-
|
|
|
973099d |
-If match the phase name the respective phase should be skipped.
|
|
|
973099d |
-
|
|
|
973099d |
-=item PHASES
|
|
|
973099d |
-
|
|
|
973099d |
-If does B<not> match the phase name the respective phase should be skipped
|
|
|
973099d |
-excluding 'Setup' and 'Cleanup' phases.
|
|
|
973099d |
-
|
|
|
973099d |
-=back
|
|
|
973099d |
-
|
|
|
973099d |
-Actual skipping has to be done in the test case itself by using return code of
|
|
|
973099d |
-functions I<rlPhaseStart>, I<rlPhaseStartSetup>, I<rlPhaseStartTest> and
|
|
|
973099d |
-I<rlPhaseStartCleanup>.
|
|
|
973099d |
-
|
|
|
973099d |
-Example:
|
|
|
973099d |
-
|
|
|
973099d |
- rlPhaseStartTest "bz123456" && {
|
|
|
973099d |
- ...
|
|
|
973099d |
- rlPhaseEnd; }
|
|
|
973099d |
-
|
|
|
973099d |
-Evaluation of the phase relevancy works as follows:
|
|
|
973099d |
- 1. If PHASES_BL is non-empty and matches phase name => return 2.
|
|
|
973099d |
- 2. If phase name is 'Setup' or 'Cleanup' or PHASES is empty => return 0.
|
|
|
973099d |
- 3. If PHASES is non-empty and matches phase name => return 0 otherwise return 1.
|
|
|
973099d |
-
|
|
|
973099d |
-Normaly Setup and Cleanup phases are not skipped unless hey are B<explicitly>
|
|
|
973099d |
-black-listed.
|
|
|
973099d |
-
|
|
|
973099d |
-=cut
|
|
|
973099d |
-
|
|
|
973099d |
-
|
|
|
973099d |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
973099d |
# rlLogLowMetric
|
|
|
973099d |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
973099d |
--
|
|
|
973099d |
1.9.3
|
|
|
973099d |
|