Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 871048 Details for
Bug 508650
[RFE] Conditional phases
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
conditional phases
0001-conditional-phases-support.patch (text/plain), 3.63 KB, created by
Dalibor Pospíšil
on 2014-03-05 16:03:56 UTC
(
hide
)
Description:
conditional phases
Filename:
MIME Type:
Creator:
Dalibor Pospíšil
Created:
2014-03-05 16:03:56 UTC
Size:
3.63 KB
patch
obsolete
>From 6aea33b222033f248c5cd674e455ea78a7f5da5f Mon Sep 17 00:00:00 2001 >From: Dalibor Pospisil <dapospis@redhat.com> >Date: Wed, 5 Mar 2014 16:47:16 +0100 >Subject: [PATCH] conditional phases support > >This patch add logic at the beginning of the phase so functions rlPhaseStart* return non-zero code if the phase is not supposed to be executed. >--- > src/logging.sh | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 67 insertions(+), 3 deletions(-) > >diff --git a/src/logging.sh b/src/logging.sh >index 887c286..c46706c 100644 >--- a/src/logging.sh >+++ b/src/logging.sh >@@ -545,6 +545,21 @@ rlShowRunningKernel() { > } > > >+__INTERNAL_conditional_phase_eval() { >+ # check phases black-list >+ [[ -n "$PHASES_BL" && "$1" =~ $PHASES_BL ]] && { >+ rlLogWarning "Phase '$1' should be skipped as it is defined in \$PHASES_BL='$PHASES_BL'" >+ return 2 >+ } >+ # always execute Setup, Cleanup and if no PHASES (white-list) specified >+ [[ "$1" == "Setup" || "$1" == "Cleanup" || -z "$PHASES" ]] && return 0 >+ [[ "$1" =~ $PHASES ]] && return 0 || { >+ rlLogWarning "Phase '$1' should be skipped as it is not defined in \$PHASES='$PHASES'" >+ return 1 >+ } >+} >+ >+ > # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > # rlPhaseStart > # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >@@ -587,10 +602,14 @@ Optional name of the phase (if not provided, one will be generated). > > If all asserts included in the phase pass, phase reports PASS. > >+Returns non-zero if something went wrong or if the phase is not supposed to be >+executed (refer to B<Conditional phases> section) otherwise retun 0. >+ > =cut > > rlPhaseStart() { > if [ "x$1" = "xFAIL" -o "x$1" = "xWARN" ] ; then >+ __INTERNAL_conditional_phase_eval "$2" && \ > rljAddPhase "$1" "$2" > return $? > else >@@ -648,18 +667,63 @@ used. > > If you do not want these shortcuts, use plain C<rlPhaseStart> function. > >+Returns non-zero if something went wrong or if the phase is not supposed to be >+executed (refer to B<Conditional phases> section) otherwise retun 0. >+ > =cut > > rlPhaseStartSetup() { >- rljAddPhase "WARN" "${1:-Setup}" >+ rlPhaseStart "WARN" "${1:-Setup}" > } > rlPhaseStartTest() { >- rljAddPhase "FAIL" "${1:-Test}" >+ rlPhaseStart "FAIL" "${1:-Test}" > } > rlPhaseStartCleanup() { >- rljAddPhase "WARN" "${1:-Cleanup}" >+ rlPhaseStart "WARN" "${1:-Cleanup}" > } > >+: <<'=cut' >+=pod >+ >+=head2 Conditional phases >+ >+Each test phase can be conditionally skipped based on bash regular expression >+given in PHASES_BL and/or PHASES variables. >+ >+=over >+ >+=item PHASES_BL >+ >+If match the phase name the respective phase should be skipped. >+ >+=item PHASES >+ >+If does B<not> match the phase name the respective phase should be skipped >+excluding 'Setup' and 'Cleanup' phases. >+ >+=back >+ >+Actual skipping has to be done in the test case itself by using return code of >+functions I<rlPhaseStart>, I<rlPhaseStartSetup>, I<rlPhaseStartTest> and >+I<rlPhaseStartCleanup>. >+ >+Example: >+ >+ rlPhaseStartTest "bz123456" && { >+ ... >+ rlPhaseEnd; } >+ >+Evaluation of the phase relevancy works as follows: >+ 1. If PHASES_BL is non-empty and matches phase name => return 2. >+ 2. If phase name is 'Setup' or 'Cleanup' or PHASES is empty => return 0. >+ 3. If PHASES is non-empty and matches phase name => return 0 otherwise return 1. >+ >+Normaly Setup and Cleanup phases are not skipped unless hey are B<explicitly> >+black-listed. >+ >+=cut >+ >+ > # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > # rlLogLowMetric > # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >-- >1.8.5.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 508650
: 871048