From 757ab522452b4422e2e6d6ab15dd95600343b660 Mon Sep 17 00:00:00 2001 From: Dalibor Pospisil Date: Jul 17 2014 13:30:41 +0000 Subject: reverted conditional phases support --- diff --git a/0001-reverting-conditional-phases-support-except-for-comm.patch b/0001-reverting-conditional-phases-support-except-for-comm.patch new file mode 100644 index 0000000..f85f5bc --- /dev/null +++ b/0001-reverting-conditional-phases-support-except-for-comm.patch @@ -0,0 +1,113 @@ +From 4284be292d6a409f83952702e0a4f0f8cdd8d637 Mon Sep 17 00:00:00 2001 +From: Dalibor Pospisil +Date: Thu, 17 Jul 2014 13:07:10 +0200 +Subject: [PATCH] reverting conditional phases support, except for common + handling of phase start + +--- + src/logging.sh | 64 ---------------------------------------------------------- + 1 file changed, 64 deletions(-) + +diff --git a/src/logging.sh b/src/logging.sh +index d831ac8..b01b102 100644 +--- a/src/logging.sh ++++ b/src/logging.sh +@@ -756,21 +756,6 @@ 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 + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@@ -813,14 +798,10 @@ 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 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 +@@ -878,9 +859,6 @@ used. + + If you do not want these shortcuts, use plain C function. + +-Returns non-zero if something went wrong or if the phase is not supposed to be +-executed (refer to B section) otherwise retun 0. +- + =cut + + rlPhaseStartSetup() { +@@ -893,48 +871,6 @@ rlPhaseStartCleanup() { + 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 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, I, I and +-I. +- +-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 +-black-listed. +- +-=cut +- +- + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # rlLogLowMetric + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- +1.9.3 + diff --git a/beakerlib.spec b/beakerlib.spec index 1d69671..45ca0b9 100644 --- a/beakerlib.spec +++ b/beakerlib.spec @@ -1,7 +1,7 @@ Name: beakerlib Summary: A shell-level integration testing library Version: 1.9 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-root @@ -28,6 +28,7 @@ Patch10: 0011-log-rpm-package-also-in-non-asserted-rpm-checks.patch Patch11: 0012-rlCheckRequirements-completely-supress-output-of-rlC.patch Patch12: 0013-add-srpm-info-to-journal-bz1071693.patch Patch13: 0014-supress-storage-data-in-non-debug-mode.patch +Patch14: 0001-reverting-conditional-phases-support-except-for-comm.patch %description @@ -61,6 +62,7 @@ Files for syntax highlighting BeakerLib tests in VIM editor %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 %build make build @@ -101,6 +103,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/vim/vimfiles/after/syntax/beakerlib.vim %changelog +* Tue Jul 17 2014 Dalibor Pospisil - 1.9-3 +- reverted conditional phases support + * Tue Jul 2 2014 Dalibor Pospisil - 1.9-2 - bunch of fixes