commit e4d6dcdb257ff03ee9969289deb554f0b791dffc Author: CentOS Sources Date: Tue May 7 08:19:09 2019 -0400 import beakerlib-1.17-19.el8 diff --git a/.beakerlib.metadata b/.beakerlib.metadata new file mode 100644 index 0000000..137020c --- /dev/null +++ b/.beakerlib.metadata @@ -0,0 +1 @@ +1f0a6b45d9eb6173b9526ea6b5184a3f6a8612ed SOURCES/beakerlib-1.17.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..949696f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/beakerlib-1.17.tar.gz diff --git a/SOURCES/beakerlib-tmpfiles.conf b/SOURCES/beakerlib-tmpfiles.conf new file mode 100644 index 0000000..39ad78b --- /dev/null +++ b/SOURCES/beakerlib-tmpfiles.conf @@ -0,0 +1 @@ +x /var/tmp/beakerlib-* diff --git a/SOURCES/bugzilla-links.patch b/SOURCES/bugzilla-links.patch new file mode 100644 index 0000000..0053eb3 --- /dev/null +++ b/SOURCES/bugzilla-links.patch @@ -0,0 +1,19 @@ +diff --git a/src/beakerlib.sh b/src/beakerlib.sh +index 3355fa4..ceafc44 100644 +--- a/src/beakerlib.sh ++++ b/src/beakerlib.sh +@@ -274,10 +274,14 @@ https://github.com/beakerlib/beakerlib/wiki/man + + =item Issues list + ++https://bugzilla.redhat.com/buglist.cgi?component=beakerlib&&order=bug_status%2Cassigned_to%2Cpriority ++ + https://github.com/beakerlib/beakerlib/issues + + =item Reporting issues + ++https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=beakerlib ++ + https://github.com/beakerlib/beakerlib/issues/new + + =back diff --git a/SOURCES/debug-to-console.patch b/SOURCES/debug-to-console.patch new file mode 100644 index 0000000..fa863a1 --- /dev/null +++ b/SOURCES/debug-to-console.patch @@ -0,0 +1,18 @@ +diff --git a/src/logging.sh b/src/logging.sh +index 95604c1..083d6d0 100644 +--- a/src/logging.sh ++++ b/src/logging.sh +@@ -237,7 +238,12 @@ DEBUG=${DEBUG:-""} + + rlLogDebug() { + if [ "$DEBUG" == 'true' -o "$DEBUG" == '1' -o "$LOG_LEVEL" == "DEBUG" ]; then +- rlLog "$1" "$2" "DEBUG" && rljAddMessage "$1" "DEBUG" ++ if [[ -n "$DEBUG_TO_CONSOLE_ONLY" ]]; then ++ local __INTERNAL_LogText_no_file=1 ++ __INTERNAL_LogText "$1" "DEBUG" ++ else ++ rlLog "$1" "$2" "DEBUG" ++ fi + fi + } + rlLogInfo() { rlLog "$1" "$2" "INFO"; } diff --git a/SOURCES/enable-nested-phases.patch b/SOURCES/enable-nested-phases.patch new file mode 100644 index 0000000..1e6ef9c --- /dev/null +++ b/SOURCES/enable-nested-phases.patch @@ -0,0 +1,35 @@ +From 7381fd558e64559029980def31faf6661909eeb8 Mon Sep 17 00:00:00 2001 +From: Dalibor Pospisil +Date: Tue, 12 Dec 2017 16:04:01 +0100 +Subject: [PATCH 16/18] nested phases enabled by default + +this prevents some yet undocumented and officily unsupported behavoiur regression +--- + src/journal.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/journal.sh b/src/journal.sh +index 374ddfc..516f292 100644 +--- a/src/journal.sh ++++ b/src/journal.sh +@@ -539,7 +539,7 @@ rljAddPhase(){ + # Printing + __INTERNAL_PrintHeadLog "$MSG" + +- if [[ -z "$BEAKERLIB_NESTED_PHASES" ]]; then ++ if [[ "$BEAKERLIB_NESTED_PHASES" == "0" ]]; then + __INTERNAL_METAFILE_INDENT_LEVEL=2 + __INTERNAL_PHASE_TYPE=( "$1" ) + __INTERNAL_PHASE_NAME=( "$MSG" ) +@@ -612,7 +612,7 @@ rljClosePhase(){ + rm -f $logfile + + # Reset of state variables +- if [[ -z "$BEAKERLIB_NESTED_PHASES" ]]; then ++ if [[ "$BEAKERLIB_NESTED_PHASES" == "0" ]]; then + __INTERNAL_METAFILE_INDENT_LEVEL=1 + __INTERNAL_PHASE_TYPE=() + __INTERNAL_PHASE_NAME=() +-- +2.14.3 + diff --git a/SOURCES/extended-coloring-capabilities.patch b/SOURCES/extended-coloring-capabilities.patch new file mode 100644 index 0000000..ebb1eb5 --- /dev/null +++ b/SOURCES/extended-coloring-capabilities.patch @@ -0,0 +1,106 @@ +From 44221b0c9970f11451016f4566602932861458e6 Mon Sep 17 00:00:00 2001 +From: Dalibor Pospisil +Date: Fri, 2 Feb 2018 15:06:58 +0100 +Subject: [PATCH 4/5] extended coloring capabilities + +this change allow to color result from other placed +--- + src/logging.sh | 72 ++++++++++++++++++++++++++++++++++++++-------------------- + 1 file changed, 48 insertions(+), 24 deletions(-) + +diff --git a/src/logging.sh b/src/logging.sh +index 38a0466..59709df 100644 +--- a/src/logging.sh ++++ b/src/logging.sh +@@ -57,41 +57,65 @@ __INTERNAL_PrintText() { + __INTERNAL_LogText "$@" + } + ++# $1 - text to color ++# $2 - variable to put the color sequence to ++# $3 - variable to put the uncolor sequence to ++__INTERNAL_get_prio_colors() { ++ local prio="$1" var_color="$2" var_uncolor="$3" ++ local ____COLOR='' ____UNCOLOR='' ++ if [[ -t 2 ]]; then ++ ____UNCOLOR="$__INTERNAL_color_reset" ++ case ${prio^^} in ++ DEBUG*) ++ ____COLOR="$__INTERNAL_color_purple" ++ ;; ++ PASS) ++ ____COLOR="$__INTERNAL_color_green" ++ ;; ++ FAIL|FATAL) ++ ____COLOR="$__INTERNAL_color_light_red" ++ ;; ++ LOG) ++ ____COLOR="$__INTERNAL_color_cyan" ++ ;; ++ LOG|INFO|BEGIN) ++ ____COLOR="$__INTERNAL_color_blue" ++ ;; ++ WARN*|SKIP*) ++ ____COLOR="$__INTERNAL_color_yellow" ++ ;; ++ esac ++ fi ++ eval "$var_color=\"${____COLOR}\"" ++ eval "$var_uncolor=\"${____UNCOLOR}\"" ++} ++ ++# $1 - text to color ++# $2 - variable to put the result to ++__INTERNAL_colorize_prio() { ++ local prio="$1" var="$2" ++ local COLOR='' UNCOLOR='' ++ __INTERNAL_get_prio_colors "$prio" COLOR UNCOLOR ++ eval "$var=\"$COLOR$prio$UNCOLOR\"" ++} ++ ++# $1 - MESSAGE ++# $2 - prio ++# $3 - LOGFILE ++# $4 - MESSAGE_COLORED, if empty MESSAGE is used + __INTERNAL_LogText() { + local MESSAGE="$1" +- local MESSAGE_COLORED="${MESSAGE}" ++ local MESSAGE_COLORED="${4:-"$MESSAGE"}" + local prio="$2" + local LOGFILE=${3:-$OUTPUTFILE} + local res=0 + local COLOR='' UNCOLOR='' +- if [[ -t 2 ]]; then +- UNCOLOR="$__INTERNAL_color_reset" +- case ${prio^^} in +- DEBUG*) +- COLOR="$__INTERNAL_color_purple" +- ;; +- PASS) +- COLOR="$__INTERNAL_color_green" +- ;; +- FAIL|FATAL) +- COLOR="$__INTERNAL_color_light_red" +- ;; +- LOG) +- COLOR="$__INTERNAL_color_cyan" +- ;; +- LOG|INFO|BEGIN) +- COLOR="$__INTERNAL_color_blue" +- ;; +- WARN*|SKIP*) +- COLOR="$__INTERNAL_color_yellow" +- ;; +- esac +- fi + [[ -n "$prio" ]] && { + local left=$(( (10+${#prio})/2 )) + local prefix prefix_colored timestamp + __INTERNAL_SET_TIMESTAMP + printf -v timestamp "%($__INTERNAL_TIMEFORMAT_SHORT)T" "$__INTERNAL_TIMESTAMP" ++ __INTERNAL_get_prio_colors "$prio" COLOR UNCOLOR + printf -v prefix_colored ":: [ %s ] :: [%s%*s%*s%s] ::" "$timestamp" "$COLOR" "$left" "${prio}" "$(( 10-$left ))" '' "$UNCOLOR" + printf -v prefix ":: [ %s ] :: [%*s%*s] ::" "$timestamp" "$left" "${prio}" "$(( 10-$left ))" + MESSAGE="$prefix $MESSAGE" +-- +2.14.3 diff --git a/SOURCES/final-summary-in-rlJournalEnd.patch b/SOURCES/final-summary-in-rlJournalEnd.patch new file mode 100644 index 0000000..8821d05 --- /dev/null +++ b/SOURCES/final-summary-in-rlJournalEnd.patch @@ -0,0 +1,49 @@ +From 94c83310182228dcb959f390c6a513cbdebe4976 Mon Sep 17 00:00:00 2001 +From: Dalibor Pospisil +Date: Fri, 2 Feb 2018 15:13:46 +0100 +Subject: [PATCH 3/5] move final summary printing to rlJournalEnd + +also put the text to journal.txt +this will ensure the summary is always printed at the end and is also present in the text file +--- + src/journal.sh | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/journal.sh b/src/journal.sh +index 04e4a10..867d08f 100644 +--- a/src/journal.sh ++++ b/src/journal.sh +@@ -242,6 +242,8 @@ rlJournalEnd(){ + __INTERNAL_ENDTIME=$__INTERNAL_TIMESTAMP + __INTERNAL_update_journal_txt + ++ __INTERNAL_PrintHeadLog "${__INTERNAL_TEST_NAME}" 2>&1 ++ + if [ -n "$TESTID" ] ; then + __INTERNAL_JournalXMLCreate + $BEAKERLIB_COMMAND_SUBMIT_LOG -T $TESTID -l $__INTERNAL_BEAKERLIB_JOURNAL \ +@@ -252,6 +254,10 @@ rlJournalEnd(){ + fi + + echo "#End of metafile" >> $__INTERNAL_BEAKERLIB_METAFILE ++ ++ __INTERNAL_LogText "Phases: $__INTERNAL_PHASES_PASSED good, $__INTERNAL_PHASES_FAILED bad" LOG 2>&1 ++ __INTERNAL_LogText "RESULT: $__INTERNAL_TEST_NAME" $__INTERNAL_PHASES_WORST_RESULT 2>&1 ++ + __INTERNAL_JournalXMLCreate + __INTERNAL_TestResultsSave + } +@@ -434,11 +440,6 @@ rlJournalPrintText(){ + [[ -t 1 ]] && textfile="$__INTERNAL_BEAKERLIB_JOURNAL_COLORED" || textfile="$__INTERNAL_BEAKERLIB_JOURNAL_TXT" + cat "$textfile" + +- local __INTERNAL_LogText_no_file=1 +- __INTERNAL_PrintHeadLog "${__INTERNAL_TEST_NAME}" 2>&1 +- __INTERNAL_LogText "Phases: $__INTERNAL_PHASES_PASSED good, $__INTERNAL_PHASES_FAILED bad" LOG 2>&1 +- __INTERNAL_LogText "RESULT: $__INTERNAL_TEST_NAME" $__INTERNAL_PHASES_WORST_RESULT 2>&1 +- + return 0 + } + +-- +2.14.3 diff --git a/SOURCES/get-text-journal-size.patch b/SOURCES/get-text-journal-size.patch new file mode 100644 index 0000000..0d2ac4f --- /dev/null +++ b/SOURCES/get-text-journal-size.patch @@ -0,0 +1,21 @@ +diff -u b/src/journal.sh b/src/journal.sh +--- b/src/journal.sh ++++ b/src/journal.sh +@@ -531,7 +531,7 @@ + rljAddPhase(){ + __INTERNAL_PersistentDataLoad + local MSG=${2:-"Phase of $1 type"} +- local TXTLOG_START=$(wc -l $__INTERNAL_BEAKERLIB_JOURNAL_TXT) ++ local TXTLOG_START=$(cat $__INTERNAL_BEAKERLIB_JOURNAL_TXT | wc -l) + rlLogDebug "rljAddPhase: Phase $MSG started" + __INTERNAL_WriteToMetafile phase --name "$MSG" --type "$1" >&2 + # Printing +@@ -546,7 +546,7 @@ + __INTERNAL_PHASE_FAILED=( 0 ) + __INTERNAL_PHASE_PASSED=( 0 ) + __INTERNAL_PHASE_STARTTIME=( $__INTERNAL_TIMESTAMP ) +- __INTERNAL_PHASE_TXTLOG_START=( $(wc -l $__INTERNAL_BEAKERLIB_JOURNAL_TXT) ) ++ __INTERNAL_PHASE_TXTLOG_START=( $TXTLOG_START ) + __INTERNAL_PHASE_OPEN=${#__INTERNAL_PHASE_NAME[@]} + __INTERNAL_PHASE_METRICS=( "" ) + else diff --git a/SOURCES/handle-missing-python.patch b/SOURCES/handle-missing-python.patch new file mode 100644 index 0000000..01f67b2 --- /dev/null +++ b/SOURCES/handle-missing-python.patch @@ -0,0 +1,52 @@ +diff -u b/src/journal.sh b/src/journal.sh +--- b/src/journal.sh ++++ b/src/journal.sh +@@ -283,8 +297,25 @@ + #=cut + + __INTERNAL_JournalXMLCreate() { +- [[ "$BEAKERLIB_JOURNAL" == "0" ]] || $__INTERNAL_JOURNALIST $__INTERNAL_XSLT --metafile \ +- "$__INTERNAL_BEAKERLIB_METAFILE" --journal "$__INTERNAL_BEAKERLIB_JOURNAL" ++ local res=0 ++ [[ "$BEAKERLIB_JOURNAL" == "0" ]] || { ++ if which python &> /dev/null; then ++ $__INTERNAL_JOURNALIST $__INTERNAL_XSLT --metafile \ ++ "$__INTERNAL_BEAKERLIB_METAFILE" --journal "$__INTERNAL_BEAKERLIB_JOURNAL" ++ res=$? ++ if [[ $res -eq 2 ]]; then ++ rlLogError "cannot create journal.xml due to missing some python module" ++ elif [[ $res -eq 3 ]]; then ++ rlLogError "cannot create journal.xml due to missing python lxml module" ++ elif [[ $res -ne 0 ]]; then ++ rlLogError "journal.xml creation failed!" ++ fi ++ else ++ rlLogError "cannot create journal.xml due to missing python interpreter" ++ let res++ ++ fi ++ } ++ return $res + } + + +diff -u b/src/python/journalling.py b/src/python/journalling.py +--- b/src/python/journalling.py ++++ b/src/python/journalling.py +@@ -30,11 +30,15 @@ + import six + import time + import base64 +- from lxml import etree + from optparse import OptionParser + except ImportError as e: + sys.stderr.write("Python ImportError: " + str(e) + "\nExiting unsuccessfully.\n") +- exit(1) ++ exit(2) ++try: ++ from lxml import etree ++except ImportError as e: ++ sys.stderr.write("Python ImportError: " + str(e) + "\nExiting unsuccessfully.\n") ++ exit(3) + + + xmlForbidden = [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 15, 16, 17, 18, 19, 20, diff --git a/SOURCES/ifs-issue.patch b/SOURCES/ifs-issue.patch new file mode 100644 index 0000000..0d483f5 --- /dev/null +++ b/SOURCES/ifs-issue.patch @@ -0,0 +1,128 @@ +diff -u b/src/journal.sh b/src/journal.sh +--- b/src/journal.sh ++++ b/src/journal.sh +@@ -431,12 +431,10 @@ + [[ -t 1 ]] && textfile="$__INTERNAL_BEAKERLIB_JOURNAL_COLORED" || textfile="$__INTERNAL_BEAKERLIB_JOURNAL_TXT" + cat "$textfile" + +- local tmp="$__INTERNAL_LogText_no_file" +- __INTERNAL_LogText_no_file=1 ++ local __INTERNAL_LogText_no_file=1 + __INTERNAL_PrintHeadLog "${TEST}" 2>&1 + __INTERNAL_LogText "Phases: $__INTERNAL_PHASES_PASSED good, $__INTERNAL_PHASES_FAILED bad" LOG 2>&1 + __INTERNAL_LogText "RESULT: $TEST" $__INTERNAL_PHASES_WORST_RESULT 2>&1 +- __INTERNAL_LogText_no_file=$tmp + + return 0 + } +@@ -645,6 +643,7 @@ + # $2 result + # $3 command + rljAddTest(){ ++ local IFS + __INTERNAL_PersistentDataLoad + if [ $__INTERNAL_PHASE_OPEN -eq 0 ]; then + rlPhaseStart "FAIL" "Asserts collected outside of a phase" +@@ -723,6 +722,7 @@ + + # Creates header + __INTERNAL_CreateHeader(){ ++ local IFS + + __INTERNAL_PrintHeadLog "TEST PROTOCOL" 2> /dev/null + +@@ -816,7 +816,7 @@ + local count=0 + local type="unknown" + local cpu_regex="^model\sname.*: (.*)$" +- while read line; do ++ while read -r line; do + if [[ "$line" =~ $cpu_regex ]]; then + type="${BASH_REMATCH[1]}" + let count++ +@@ -830,7 +830,7 @@ + if [[ -f "/proc/meminfo" ]]; then + size=0 + local ram_regex="^MemTotal: *(.*) kB$" +- while read line; do ++ while read -r line; do + if [[ "$line" =~ $ram_regex ]]; then + size=`expr ${BASH_REMATCH[1]} / 1024` + break +diff -u b/src/logging.sh b/src/logging.sh +--- b/src/logging.sh ++++ b/src/logging.sh +@@ -53,10 +53,8 @@ + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + __INTERNAL_PrintText() { +- local tmp="$__INTERNAL_LogText_no_file" +- __INTERNAL_LogText_no_file=1 ++ local __INTERNAL_LogText_no_file=1 + __INTERNAL_LogText "$@" +- __INTERNAL_LogText_no_file=$tmp + } + + __INTERNAL_LogText() { +@@ -531,6 +529,7 @@ + rlShowPackageVersion() + { + local score=0 ++ local IFS + if [ $# -eq 0 ]; then + rlLogWarning "rlShowPackageVersion: Too few options" + return 1 +only in patch2: +unchanged: +--- a/src/analyze.sh ++++ b/src/analyze.sh +@@ -76,6 +76,7 @@ Return 0 if... TODO + =cut + + rlDejaSum(){ ++ local IFS + rlLog "Summarizing files: $1 $2" + rlLogDebug "Calling beakerlib-deja-summarize routine" + beakerlib-deja-summarize $1 $2 | while read line +only in patch2: +unchanged: +--- a/src/libraries.sh ++++ b/src/libraries.sh +@@ -268,9 +268,10 @@ __INTERNAL_envdebugget() { + __INTERNAL_envdebugdiff() { + rlLogDebug "rlImport: library $1 changes following environment; changed functions are marked with asterisk (*)" + diff -U0 <(echo "$__INTERNAL_envdebugvariables") <(__INTERNAL_envdebugget 1) | tail -n +3 | grep -E -v '^@@' +- local line fn print='' print2 LF=" +-" +- while IFS= read line; do ++ local line fn print='' print2 LF=$'\n' ++ local IFS ++ ++ while read -r line; do + [[ "$line" =~ ^(.)([^[:space:]]+)[[:space:]]\(\) ]] && { + [[ -n "$print" ]] && { + echo "$fn" +only in patch2: +unchanged: +--- a/src/rpms.sh ++++ b/src/rpms.sh +@@ -56,6 +56,7 @@ __INTERNAL_RpmPresent() { + local version=$3 + local release=$4 + local arch=$5 ++ local IFS + + local package=$name-$version-$release.$arch + [ "$arch" == "" ] && package=$name-$version-$release +only in patch2: +unchanged: +--- a/src/testing.sh ++++ b/src/testing.sh +@@ -749,6 +749,7 @@ rlRun() { + local __INTERNAL_rlRun_TAG_OUT='' + local __INTERNAL_rlRun_TAG_ERR='' + local __INTERNAL_rlRun_LOG_FILE='' ++ local IFS + + while true ; do + case "$1" in diff --git a/SOURCES/journaling-fixes.patch b/SOURCES/journaling-fixes.patch new file mode 100644 index 0000000..fb38309 --- /dev/null +++ b/SOURCES/journaling-fixes.patch @@ -0,0 +1,64 @@ +diff -u b/src/python/journalling.py b/src/python/journalling.py +--- b/src/python/journalling.py ++++ b/src/python/journalling.py +@@ -27,7 +27,6 @@ + import re + from optparse import OptionParser + from lxml import etree +-import shlex + import base64 + + # TODO fix xml pretty print +@@ -100,8 +99,8 @@ + # Count number of leading spaces + indent = len(line) - len(line.lstrip()) + +- # using shlex to get rid of the quotes +- splitted = shlex.split(line) ++ # splitting the line into list ++ splitted = line.split() + + # if the line is not empty + if splitted: +@@ -118,7 +117,9 @@ + for part in splitted: + # if flag is set, string is an elements content + if CONTENT_FLAG == 1: +- content = base64.b64decode(part) ++ # First and last characters(quotes) stripped and ++ # string is decoded from base64 ++ content = base64.b64decode(part[1:-1]) + # end parsing after content is stored + break + # test if string is an elements content indicator +@@ -128,13 +129,15 @@ + # test if string is an elements time attribute + if re.match(r'^--timestamp=', part): + attribute_name = "timestamp" +- attribute_value = part.split('=', 1)[1] ++ # Value is string after '=' sign and without first abd last char(quotes) ++ attribute_value = part.split('=', 1)[1][1:-1] + attributes[attribute_name] = time.strftime(TIME_FORMAT, time.localtime(int(attribute_value))) + continue + # test if string is an elements regular attribute + if re.match(r'^--[a-zA-Z0-9]+=', part): + attribute_name = part.split('=', 1)[0][2:] +- attribute_value = part.split('=', 1)[1] ++ # Value is string after '=' sign and without first abd last char(quotes) ++ attribute_value = part.split('=', 1)[1][1:-1] + attributes[attribute_name] = base64.b64decode(attribute_value) + continue + +@@ -145,7 +148,11 @@ + # information given as parameters + def createElement(element, attributes, content): + element = unicode(element, 'utf-8', errors='replace').translate(xmlTrans) +- new_el = etree.Element(element) ++ try: ++ new_el = etree.Element(element) ++ except ValueError, e: ++ sys.stderr.write('Failed to create element with name %s\nError: %s\nExiting unsuccessfully.\n' % (element, e)) ++ exit(1) + + content = unicode(content, 'utf-8', errors='replace').translate(xmlTrans) + new_el.text = content diff --git a/SOURCES/journalling-import-check.patch b/SOURCES/journalling-import-check.patch new file mode 100644 index 0000000..520e305 --- /dev/null +++ b/SOURCES/journalling-import-check.patch @@ -0,0 +1,44 @@ +From 59f7e0b123fc9789538f610a89d350d76c35106b Mon Sep 17 00:00:00 2001 +From: Jakub Heger +Date: Wed, 22 Aug 2018 12:37:49 +0200 +Subject: [PATCH 2/4] journalling: try import + +imports are now in try block, exceptions cause unsuccessful exit with +error message printed +--- + src/python/journalling.py | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +diff --git a/src/python/journalling.py b/src/python/journalling.py +index 220d5d2..7a65d78 100755 +--- a/src/python/journalling.py ++++ b/src/python/journalling.py +@@ -23,14 +23,18 @@ + # TODO fix xml pretty print + + +-import os +-import re +-import sys +-import six +-import time +-import base64 +-from lxml import etree +-from optparse import OptionParser ++try: ++ import os ++ import re ++ import sys ++ import six ++ import time ++ import base64 ++ from lxml import etree ++ from optparse import OptionParser ++except ImportError as e: ++ sys.stderr.write("Python ImportError: " + str(e) + "\nExiting unsuccessfully.\n") ++ exit(1) + + + xmlForbidden = [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 15, 16, 17, 18, 19, 20, +-- +2.17.1 diff --git a/SOURCES/meta-format-fix.patch b/SOURCES/meta-format-fix.patch new file mode 100644 index 0000000..83da732 --- /dev/null +++ b/SOURCES/meta-format-fix.patch @@ -0,0 +1,30 @@ +diff -u a/src/journal.sh b/src/journal.sh +--- a/src/journal.sh ++++ b/src/journal.sh +@@ -918,13 +918,13 @@ + while [[ $# -gt 0 ]]; do + case $1 in + --) +- line+=" -- \"$(echo -n "$2" | base64 -w 0)\"" ++ line+=" -- $(echo -n "$2" | base64 -w 0)" + printf -v lineraw "%s -- %q" "$lineraw" "$2" + shift 2 + break + ;; + --*) +- line+=" $1=\"$(echo -n "$2" | base64 -w 0)\"" ++ line+=" $1=$(echo -n "$2" | base64 -w 0)" + printf -v lineraw "%s %s=%q" "$lineraw" "$1" "$2" + shift + ;; +@@ -944,8 +944,8 @@ + + printf -v indent '%*s' $__INTERNAL_METAFILE_INDENT_LEVEL + +- line="$indent${element:+$element }--timestamp=\"${__INTERNAL_TIMESTAMP}\"$line" +- lineraw="$indent${element:+$element }--timestamp=\"${__INTERNAL_TIMESTAMP}\"$lineraw" ++ line="$indent${element:+$element }--timestamp=${__INTERNAL_TIMESTAMP}$line" ++ lineraw="$indent${element:+$element }--timestamp=${__INTERNAL_TIMESTAMP}$lineraw" + [[ -n "$DEBUG" ]] && echo "#${lineraw:1}" >> $__INTERNAL_BEAKERLIB_METAFILE + echo "$line" >> $__INTERNAL_BEAKERLIB_METAFILE + } diff --git a/SOURCES/persistent-data-load.patch b/SOURCES/persistent-data-load.patch new file mode 100644 index 0000000..e701b92 --- /dev/null +++ b/SOURCES/persistent-data-load.patch @@ -0,0 +1,76 @@ +From e866044b7d2050c5558de8e8e2cc7f7d7f34e715 Mon Sep 17 00:00:00 2001 +From: Dalibor Pospisil +Date: Fri, 2 Feb 2018 11:41:00 +0100 +Subject: [PATCH 2/5] fixed persistent data load for bash <= 4.1.2 + +there's no '-g' option to declare in bash <= 4.1.2 +therefore declare cannot be used for this purpose +--- + src/journal.sh | 51 +++++++++++++++++++++++++++------------------------ + 1 file changed, 27 insertions(+), 24 deletions(-) + +diff --git a/src/journal.sh b/src/journal.sh +index f35d03b..04e4a10 100644 +--- a/src/journal.sh ++++ b/src/journal.sh +@@ -937,31 +937,34 @@ __INTERNAL_PrintHeadLog() { + # functions __INTERNAL_PersistentDataLoad and __INTERNAL_PersistentDataSave + # should be called before and after that respectively. + ++__INTERNAL_PersistentDataSave_sed='s/^declare/\0 -g/' ++# ugly workaround for bash-4.1.2 and older, where -g does not exist ++# there might be an issue when there's a line break in the variables and there's ++# "")'" or "()'" at the end of the line. This should not never happen, the worst ++# case might happen in the phase name but is is not expected to contain line ++# breaks ++declare -g &> /dev/null || __INTERNAL_PersistentDataSave_sed="s/(^declare -a[^=]+=)'\(/\1(/;s/([\"(]\))'$/\1/;s/declare\s+\S+\s+([^=]+=)/\1/" ++ + __INTERNAL_PersistentDataSave() { +- local var +- ( +- for var in \ +- __INTERNAL_STARTTIME \ +- __INTERNAL_TEST_STATE \ +- __INTERNAL_PHASES_PASSED \ +- __INTERNAL_PHASES_FAILED \ +- __INTERNAL_PHASES_SKIPPED \ +- __INTERNAL_JOURNAL_OPEN \ +- __INTERNAL_PHASE_OPEN \ +- __INTERNAL_PHASES_WORST_RESULT \ +- __INTERNAL_METAFILE_INDENT_LEVEL \ +- __INTERNAL_PHASE_TYPE \ +- __INTERNAL_PHASE_NAME \ +- __INTERNAL_PHASE_FAILED \ +- __INTERNAL_PHASE_PASSED \ +- __INTERNAL_PHASE_STARTTIME \ +- __INTERNAL_PHASE_TXTLOG_START \ +- __INTERNAL_PHASE_METRICS \ +- ; +- do +- declare -p $var +- done +- ) | sed -r 's/declare/\0 -g/' > "$__INTERNAL_PERSISTENT_DATA" ++ declare -p \ ++ __INTERNAL_STARTTIME \ ++ __INTERNAL_TEST_STATE \ ++ __INTERNAL_PHASES_PASSED \ ++ __INTERNAL_PHASES_FAILED \ ++ __INTERNAL_PHASES_SKIPPED \ ++ __INTERNAL_JOURNAL_OPEN \ ++ __INTERNAL_PHASE_OPEN \ ++ __INTERNAL_PHASES_WORST_RESULT \ ++ __INTERNAL_METAFILE_INDENT_LEVEL \ ++ __INTERNAL_PHASE_TYPE \ ++ __INTERNAL_PHASE_NAME \ ++ __INTERNAL_PHASE_FAILED \ ++ __INTERNAL_PHASE_PASSED \ ++ __INTERNAL_PHASE_STARTTIME \ ++ __INTERNAL_PHASE_TXTLOG_START \ ++ __INTERNAL_PHASE_METRICS \ ++ __INTERNAL_TEST_NAME \ ++ | sed -r "$__INTERNAL_PersistentDataSave_sed" > "$__INTERNAL_PERSISTENT_DATA" + } + + __INTERNAL_PersistentDataLoad() { +-- +2.14.3 diff --git a/SOURCES/phase-names-sanitization.patch b/SOURCES/phase-names-sanitization.patch new file mode 100644 index 0000000..b9af0d7 --- /dev/null +++ b/SOURCES/phase-names-sanitization.patch @@ -0,0 +1,13 @@ +diff --git a/src/journal.sh b/src/journal.sh +index 516f292..0ad9913 100644 +--- a/src/journal.sh ++++ b/src/journal.sh +@@ -608,7 +625,7 @@ rljClosePhase(){ + __INTERNAL_LogText '' + local logfile="$(mktemp)" + tail -n +$((__INTERNAL_PHASE_TXTLOG_START+1)) $__INTERNAL_BEAKERLIB_JOURNAL_TXT > $logfile +- rlReport "$(echo "$name" | sed 's/[^[:alnum:]]\+/-/g')" "$result" "$score" "$logfile" ++ rlReport "$(echo "${name//[^[:alnum:]]/-}" | tr -s '-')" "$result" "$score" "$logfile" + rm -f $logfile + + # Reset of state variables diff --git a/SOURCES/platform-python.patch b/SOURCES/platform-python.patch new file mode 100644 index 0000000..06f8d27 --- /dev/null +++ b/SOURCES/platform-python.patch @@ -0,0 +1,66 @@ +diff -u a/src/python/daemonize.py b/src/python/daemonize.py +--- a/src/python/daemonize.py ++++ b/src/python/daemonize.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python3 ++#!/usr/libexec/platform-python + + # Authors: Jiri Jaburek + # +diff -u a/src/python/journal-compare.py b/src/python/journal-compare.py +--- a/src/python/journal-compare.py ++++ b/src/python/journal-compare.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python3 ++#!/usr/libexec/platform-python + + # Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material + # is made available to anyone wishing to use, modify, copy, or +diff -u a/src/python/journalling.py b/src/python/journalling.py +--- a/src/python/journalling.py ++++ b/src/python/journalling.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python3 ++#!/usr/libexec/platform-python + + # Authors: Jakub Heger + # Dalibor Pospisil +diff -u a/src/python/rlMemAvg.py b/src/python/rlMemAvg.py +--- a/src/python/rlMemAvg.py ++++ b/src/python/rlMemAvg.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python3 ++#!/usr/libexec/platform-python + + # Authors: Petr Muller + # +diff -u a/src/python/rlMemPeak.py b/src/python/rlMemPeak.py +--- a/src/python/rlMemPeak.py ++++ b/src/python/rlMemPeak.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python3 ++#!/usr/libexec/platform-python + + # Authors: Petr Muller + # +diff -u a/src/python/testwatcher.py b/src/python/testwatcher.py +--- a/src/python/testwatcher.py ++++ b/src/python/testwatcher.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python3 ++#!/usr/libexec/platform-python + # + # Authors: Jiri Jaburek + # +diff -u a/src/journal.sh b/src/journal.sh +--- a/src/journal.sh ++++ b/src/journal.sh +@@ -285,7 +285,7 @@ + __INTERNAL_JournalXMLCreate() { + local res=0 + [[ "$BEAKERLIB_JOURNAL" == "0" ]] || { +- if which python &> /dev/null; then ++ if which /usr/libexec/platform-python &> /dev/null; then + $__INTERNAL_JOURNALIST $__INTERNAL_XSLT --metafile \ + "$__INTERNAL_BEAKERLIB_METAFILE" --journal "$__INTERNAL_BEAKERLIB_JOURNAL" + res=$? diff --git a/SOURCES/python2.patch b/SOURCES/python2.patch new file mode 100644 index 0000000..4a70c15 --- /dev/null +++ b/SOURCES/python2.patch @@ -0,0 +1,45 @@ +diff -u a/src/python/journal-compare.py b/python/journal-compare.py +--- a/src/python/journal-compare.py 2018-05-15 16:16:15.198835559 +0200 ++++ b/src/python/journal-compare.py 2017-10-17 23:11:48.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python2 + + # Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material + # is made available to anyone wishing to use, modify, copy, or +diff -u a/src/python/journalling.py b/src/python/journalling.py +--- a/src/python/journalling.py 2018-05-15 16:16:21.517818632 +0200 ++++ b/src/python/journalling.py 2017-10-17 23:11:48.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python2 + + # Authors: Jakub Heger + # Dalibor Pospisil +diff -u a/src/python/rlMemAvg.py b/src/python/rlMemAvg.py +--- a/src/python/rlMemAvg.py 2018-05-15 16:16:24.976809367 +0200 ++++ b/src/python/rlMemAvg.py 2017-10-17 23:11:48.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python2 + + # Authors: Petr Muller + # +diff -u a/src/python/rlMemPeak.py b/src/python/rlMemPeak.py +--- a/src/python/rlMemPeak.py 2018-05-15 16:16:29.153798179 +0200 ++++ b/src/python/rlMemPeak.py 2017-10-17 23:11:48.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python2 + + # Authors: Petr Muller + # +diff -u a/src/python/testwatcher.py b/beakerlib-1.17/src/python/testwatcher.py +--- a/src/python/testwatcher.py 2018-05-15 16:16:35.369781528 +0200 ++++ b/src/python/testwatcher.py 2017-10-17 23:11:48.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python -u ++#!/usr/bin/python2 -u + # + # Authors: Jiri Jaburek + # diff --git a/SOURCES/python3.patch b/SOURCES/python3.patch new file mode 100644 index 0000000..0c49d0e --- /dev/null +++ b/SOURCES/python3.patch @@ -0,0 +1,510 @@ +diff -u a/src/python/daemonize.py b/src/python/new/daemonize.py +--- a/src/python/daemonize.py 2017-10-17 23:11:48.000000000 +0200 ++++ b/src/python/new/daemonize.py 2018-06-25 21:06:09.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + + # Authors: Jiri Jaburek + # +@@ -18,6 +18,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ++from __future__ import print_function + import os, sys + + from pwd import getpwnam +@@ -96,8 +97,8 @@ + # with original stderr (in case of errors), but with new uid/gid + if ioredir: + os.open(ioredir[0], os.O_RDWR) +- os.open(ioredir[1], os.O_RDWR | os.O_CREAT | os.O_TRUNC, 0666) +- os.open(ioredir[2], os.O_RDWR | os.O_CREAT | os.O_TRUNC, 0666) ++ os.open(ioredir[1], os.O_RDWR | os.O_CREAT | os.O_TRUNC, 0o666) ++ os.open(ioredir[2], os.O_RDWR | os.O_CREAT | os.O_TRUNC, 0o666) + + os.umask(0) + +@@ -116,7 +117,7 @@ + + # argument parsing + def error(msg): +- print >> sys.stderr, "error: " + str(msg) ++ print("error: " + str(msg), file=sys.stderr) + sys.exit(1) + + parser = OptionParser(usage='%prog [options] COMMAND') +diff -u a/src/python/journal-compare.py b/src/python/new/journal-compare.py +--- a/src/python/journal-compare.py 2018-06-25 21:01:54.490910141 +0200 ++++ b/src/python/new/journal-compare.py 2018-06-25 21:06:13.000000000 +0200 +@@ -1,6 +1,6 @@ +-#!/usr/bin/python2 ++#!/usr/bin/python3 + +-# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material ++# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material + # is made available to anyone wishing to use, modify, copy, or + # redistribute it subject to the terms and conditions of the GNU General + # Public License v.2. +@@ -15,6 +15,7 @@ + # + # Author: Petr Muller + ++from __future__ import print_function + import xml.dom.minidom + import sys + +@@ -125,9 +126,9 @@ + self.results = {} + + def addTestResult(self, name, result): +- if not self.results.has_key(name): +- self.results[name] = Test(name) +- self.results[name].addResult(result) ++ if name not in self.results: ++ self.results[name] = Test(name) ++ self.results[name].addResult(result) + + def compare(self, other): + result_list = [] +@@ -135,7 +136,7 @@ + try: + result_list.append(self.results[key].compare(other.results[key])) + except KeyError: +- print "[WARN] Could not find corresponding test for: %s" % key ++ print("[WARN] Could not find corresponding test for: %s" % key) + return result_list + + try: +@@ -161,7 +162,7 @@ + new_type, new_name = new_phases[i].getAttribute("type"), new_phases[i].getAttribute("name") + + if old_type == new_type and old_name == new_name: +- print "Types match, so we are comparing phase %s of type %s" % (old_type, new_type) ++ print( "Types match, so we are comparing phase %s of type %s" % (old_type, new_type)) + old_tests = TestSet() + new_tests = TestSet() + old_metrics = {} +@@ -179,20 +180,20 @@ + tolerance = float(metric.getAttribute("tolerance")) + metrics[key] = Metric(key, value, metric.getAttribute("type"), tolerance) + +- print "==== Actual compare ====" +- print " * Metrics * " ++ print("==== Actual compare ====") ++ print(" * Metrics * ") + metric_results = [] + for key in old_metrics.keys(): + metric_results.append(old_metrics[key].compare(new_metrics[key])) + for metric in metric_results: + for message in metric.messages: +- print "[%s] %s (%s)" % (metric.result, metric.name, message) +- print " * Tests * " ++ print("[%s] %s (%s)" % (metric.result, metric.name, message)) ++ print(" * Tests * ") + test_results = old_tests.compare(new_tests) + for test in test_results: +- print "[%s] %s" % (test.result, test.name) ++ print("[%s] %s" % (test.result, test.name)) + for message in test.messages: +- print "\t - %s" % message ++ print("\t - %s" % message) + + else: +- print "We are not doing any compare, types dont match" ++ print("We are not doing any compare, types dont match") +diff -u a/src/python/journalling.py b/src/python/new/journalling.py +--- a/src/python/journalling.py 2018-06-25 21:01:54.490910141 +0200 ++++ b/src/python/new/journalling.py 2018-06-25 21:06:19.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2 ++#!/usr/bin/python3 + + # Authors: Jakub Heger + # Dalibor Pospisil +@@ -20,16 +20,17 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ++# TODO fix xml pretty print ++ + +-import sys + import os +-import time + import re +-from optparse import OptionParser +-from lxml import etree ++import sys ++import six ++import time + import base64 +- +-# TODO fix xml pretty print ++from lxml import etree ++from optparse import OptionParser + + + xmlForbidden = [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 15, 16, 17, 18, 19, 20, +@@ -51,18 +52,19 @@ + return self.items[-1] + + ++# Saves the XML journal to a file. + def saveJournal(journal, journal_path): + try: + output = open(journal_path, 'wb') + output.write(etree.tostring(journal, xml_declaration=True, encoding='utf-8', pretty_print=True)) + output.close() + return 0 +- except IOError, e: ++ except IOError as e: + sys.stderr.write('Failed to save journal to %s: %s' % (journal_path, str(e))) + return 1 + + +-# Adds attributes starttime and endtime to a element ++# Adds attributes starttime and endtime to a element. + def addStartEndTime(element, starttime, endtime): + element.set("starttime", starttime) + element.set("endtime", endtime) +@@ -72,7 +74,7 @@ + return 0 + + +-# Find first and last timestamp to fill in starttime and endtime elements of given element ++# Find first and last timestamp to fill in starttime and endtime attributes of given element. + def getStartEndTime(element): + starttime = "" + endtime = "" +@@ -87,7 +89,7 @@ + + # Parses and decodes lines given to it + # Returns number of spaces before element, name of the element, +-# its attributes in a dictionary, and content of the element ++# its attributes in a dictionary, and content of the element. + def parseLine(line): + TIME_FORMAT = "%Y-%m-%d %H:%M:%S %Z" + CONTENT_FLAG = 0 +@@ -99,12 +101,12 @@ + # Count number of leading spaces + indent = len(line) - len(line.lstrip()) + +- # splitting the line into list ++ # Splitting the line into a list + splitted = line.split() + +- # if the line is not empty ++ # If the line is not empty + if splitted: +- # if first 2 characters are '-', it is not new element, but ending of pair element ++ # If first 2 characters are '-', it is not new element, but ending of pair element + if splitted[0][0] == '-' and splitted[0][1] == '-': + element = "" + else: +@@ -113,53 +115,82 @@ + else: + return 0, "", {}, "" + +- # parsing the rest of the line ++ # Parsing the rest of the line + for part in splitted: +- # if flag is set, string is an elements content ++ # If flag is set, string is an elements content + if CONTENT_FLAG == 1: +- # First and last characters(quotes) stripped and +- # string is decoded from base64 +- content = base64.b64decode(part[1:-1]) +- # end parsing after content is stored ++ # String is decoded from base64 ++ try: ++ content = base64.b64decode(part) ++ except TypeError as e: ++ sys.stderr.write('Failed to decode string \'%s\' from base64.\ ++ \nError: %s\nExiting unsuccessfully.\n' % (part[1:-1], e)) ++ exit(1) ++ # End parsing after content is stored + break +- # test if string is an elements content indicator ++ # Test if string is an elements content indicator + if part == '--': + CONTENT_FLAG = 1 + continue +- # test if string is an elements time attribute ++ ++ # Test if string is the elements time attribute + if re.match(r'^--timestamp=', part): + attribute_name = "timestamp" +- # Value is string after '=' sign and without first abd last char(quotes) +- attribute_value = part.split('=', 1)[1][1:-1] +- attributes[attribute_name] = time.strftime(TIME_FORMAT, time.localtime(int(attribute_value))) ++ # Value is string after '=' sign ++ attribute_value = part.split('=', 1)[1] ++ try: ++ attributes[attribute_name] = time.strftime(TIME_FORMAT, time.localtime(int(attribute_value))) ++ except ValueError as e: ++ sys.stderr.write('Failed to convert timestamp attribute to int.\ ++ \nError: %s\nExiting unsuccessfully.\n' % (e)) ++ exit(1) + continue +- # test if string is an elements regular attribute ++ ++ # Test if string is the elements regular attribute + if re.match(r'^--[a-zA-Z0-9]+=', part): + attribute_name = part.split('=', 1)[0][2:] +- # Value is string after '=' sign and without first abd last char(quotes) +- attribute_value = part.split('=', 1)[1][1:-1] +- attributes[attribute_name] = base64.b64decode(attribute_value) ++ # Value is string after '=' sign ++ attribute_value = part.split('=', 1)[1] ++ try: ++ attributes[attribute_name] = base64.b64decode(attribute_value) ++ except TypeError as e: ++ sys.stderr.write('Failed to decode string \'%s\' from base64.\ ++ \nError: %s\nExiting unsuccessfully.\n' % (attribute_value, e)) ++ exit(1) + continue + + return indent, element, attributes, content + + +-# Returns xml element created with ++# Returns XML element created with + # information given as parameters + def createElement(element, attributes, content): +- element = unicode(element, 'utf-8', errors='replace').translate(xmlTrans) ++ # In python 3 decoding from base64 causes retyping into bytes. ++ if isinstance(element, bytes): ++ # First bytes are decoded from utf8. ++ element = element.decode('utf8', 'replace') ++ # And then retyped to string, using 'six' module which adds python 2/3 compatible methods. ++ # XML not compatible characters are then also stripped from the string. ++ element = six.text_type(element).translate(xmlTrans) ++ + try: + new_el = etree.Element(element) +- except ValueError, e: ++ except ValueError as e: + sys.stderr.write('Failed to create element with name %s\nError: %s\nExiting unsuccessfully.\n' % (element, e)) + exit(1) + +- content = unicode(content, 'utf-8', errors='replace').translate(xmlTrans) +- new_el.text = content +- +- for key, value in attributes.iteritems(): +- key = unicode(key, 'utf-8', errors='replace').translate(xmlTrans) +- value = unicode(value, 'utf-8', errors='replace').translate(xmlTrans) ++ if isinstance(content, bytes): ++ content = content.decode('utf8', 'replace') ++ new_el.text = six.text_type(content).translate(xmlTrans) ++ ++ for key, value in attributes.items(): ++ if isinstance(key, bytes): ++ key = key.decode('utf8', 'replace') ++ key = six.text_type(key).translate(xmlTrans) ++ ++ if isinstance(value, bytes): ++ value = value.decode('utf8', 'replace') ++ value = six.text_type(value).translate(xmlTrans) + new_el.set(key, value) + return new_el + +@@ -172,7 +203,7 @@ + if options.metafile: + try: + fh = open(options.metafile, 'r+') +- except IOError, e: ++ except IOError as e: + sys.stderr.write('Failed to open queue file with' + str(e), 'FAIL') + return 1 + +@@ -205,8 +236,8 @@ + previous_el = new_el + + elif indent == old_indent: +- # Closing element with updates to it with no elements inside it + # TODO refactor ++ # Closing element with updates to it with no elements inside it + if element == "": + # Updating start and end time + starttime, endtime = getStartEndTime(previous_el) +@@ -214,9 +245,9 @@ + if "timestamp" in attributes: + endtime = attributes["timestamp"] + # Updating attributes found on closing line +- for key, value in attributes.iteritems(): ++ for key, value in attributes.items(): + previous_el.set(key, value) +- # add start/end time and remove timestamp attribute ++ # Add start/end time and remove timestamp attribute + addStartEndTime(previous_el, starttime, endtime) + # New element is on the same level as previous one + else: +@@ -231,7 +262,7 @@ + elif indent < old_indent: + # Difference between indent levels = how many paired elements will be closed + indent_diff = old_indent - indent +- for _ in xrange(indent_diff): ++ for _ in range(indent_diff): + el_stack.peek().append(previous_el) + previous_el = el_stack.pop() + +@@ -243,9 +274,9 @@ + if "timestamp" in attributes: + endtime = attributes["timestamp"] + # Updating attributes found on closing line +- for key, value in attributes.iteritems(): ++ for key, value in attributes.items(): + previous_el.set(key, value) +- # add start/end time and remove timestamp attribute ++ # Add start/end time and remove timestamp attribute + addStartEndTime(previous_el, starttime, endtime) + + # Ending paired element and creating new one on the same level as the paired one that just ended +@@ -285,9 +316,9 @@ + xslt = etree.parse(options.xslt) + transform = etree.XSLT(xslt) + journal = transform(journal) +- except etree.LxmlError: +- sys.stderr.write("\nTransformation template file " + options.xslt + +- " could not be parsed.\nAborting journal creation.") ++ except etree.LxmlError as e: ++ sys.stderr.write("\nTransformation template file \'" + options.xslt + ++ "\' could not be parsed.\nError: %s\nAborting journal creation.") % (e) + return 1 + + if options.journal: +diff -u a/src/python/rlMemAvg.py b/src/python/new/rlMemAvg.py +--- a/src/python/rlMemAvg.py 2018-06-25 21:01:54.490910141 +0200 ++++ b/src/python/new/rlMemAvg.py 2018-06-25 21:06:24.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2 ++#!/usr/bin/python3 + + # Authors: Petr Muller + # +@@ -18,6 +18,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ++from __future__ import print_function + import sys, time, re + + use_sub = False +@@ -31,7 +32,7 @@ + use_popen = True + + if len(sys.argv) < 2: +- print 'syntax: rlMemAvg ' ++ print('syntax: rlMemAvg ') + sys.exit(1) + + proglist = sys.argv[1:] +@@ -59,4 +60,4 @@ + if (use_sub and finish != None) or (use_popen and finish != -1): + break + +-print "%d" % (memsum/tick) ++print("%d" % (memsum/tick)) +diff -u a/src/python/rlMemPeak.py b/src/python/new/rlMemPeak.py +--- a/src/python/rlMemPeak.py 2018-06-25 21:01:54.491910137 +0200 ++++ b/src/python/new/rlMemPeak.py 2018-06-25 21:06:28.000000000 +0200 +@@ -1,6 +1,6 @@ +-#!/usr/bin/python2 ++#!/usr/bin/python3 + +-# Authors: Petr Muller ++# Authors: Petr Muller + # + # Description: Prints a memory consumption peak of an executed program + # +@@ -18,6 +18,7 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ++from __future__ import print_function + import sys, time, re + + use_sub = False +@@ -31,7 +32,7 @@ + use_popen = True + + if len(sys.argv) < 2: +- print 'syntax: rlMemPeak ' ++ print('syntax: rlMemPeak ') + sys.exit(1) + + proglist = sys.argv[1:] +@@ -57,4 +58,4 @@ + if (use_sub and finish != None) or (use_popen and finish != -1): + break + +-print "%d" % (maxmem) ++print("%d" % (maxmem)) +diff -u a/src/python/testwatcher.py b/src/python/new/testwatcher.py +--- a/src/python/testwatcher.py 2018-06-25 21:01:54.491910137 +0200 ++++ b/src/python/new/testwatcher.py 2018-06-25 21:06:32.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2 -u ++#!/usr/bin/python3 + # + # Authors: Jiri Jaburek + # +@@ -54,6 +54,7 @@ + # and the test sends the cleanup path to the watcher again + + ++from __future__ import print_function + import os + import sys + import signal +@@ -105,12 +106,12 @@ + ### HELPERS + # + def debug(msg): +- print 'TESTWATCHER: '+msg ++ print('TESTWATCHER: '+msg) + sys.stdout.flush() + + + def fatal(msg): +- print >> sys.stderr, 'TESTWATCHER fatal: '+msg ++ print('TESTWATCHER fatal: '+msg, file=sys.stderr) + sys.stderr.flush() + sys.exit(1) + +@@ -153,13 +154,13 @@ + debug('hooking beah LWD') + try: + os.makedirs(os.path.dirname(lwd_guard_file)) +- except OSError, e: ++ except OSError as e: + if e.errno == errno.EEXIST: + pass + f = open(lwd_guard_file, 'w') + f.write(watchdog_guard_cont) + f.close() +- os.chmod(lwd_guard_file, 0755) ++ os.chmod(lwd_guard_file, 0o755) + + + # called when EWD (external watchdog) is about to expire +@@ -234,7 +235,7 @@ + try: + os.waitpid(cleanuppid, 0) + cleanuppid = 0 +- except OSError, e: ++ except OSError as e: + if e.errno == errno.EINTR: + pass + if e.errno == errno.ECHILD: +@@ -291,7 +292,7 @@ + # wait for entire process group + os.waitpid(testpid, 0) + testpid = 0 +- except OSError, e: ++ except OSError as e: + # no traceback if interrupted by a signal + if e.errno == errno.EINTR: + pass diff --git a/SOURCES/reboot-in-phase.patch b/SOURCES/reboot-in-phase.patch new file mode 100644 index 0000000..95da958 --- /dev/null +++ b/SOURCES/reboot-in-phase.patch @@ -0,0 +1,82 @@ +diff --git a/src/journal.sh b/src/journal.sh +index 516f292..0ad9913 100644 +--- a/src/journal.sh ++++ b/src/journal.sh +@@ -118,7 +131,6 @@ rlJournalStart(){ + export __INTERNAL_PERSISTENT_DATA="$BEAKERLIB_DIR/PersistentData" + export __INTERNAL_TEST_RESULTS="$BEAKERLIB_DIR/TestResults" + export __INTERNAL_JOURNAL_OPEN='' +- __INTERNAL_PersistentDataLoad + export __INTERNAL_PHASES_FAILED=0 + export __INTERNAL_PHASES_PASSED=0 + export __INTERNAL_PHASES_SKIPPED=0 +@@ -130,16 +142,20 @@ rlJournalStart(){ + __INTERNAL_PHASE_STARTTIME=() + __INTERNAL_PHASE_METRICS=() + export __INTERNAL_PHASE_OPEN=0 ++ __INTERNAL_PersistentDataLoad + + if [[ -z "$__INTERNAL_JOURNAL_OPEN" ]]; then + # Create Header for XML journal + __INTERNAL_CreateHeader + # Create log element for XML journal +- __INTERNAL_WriteToMetafile log ++ __INTERNAL_WriteToMetafile log || { ++ __INTERNAL_LogText "could not write to metafile" FATAL ++ exit 1 ++ } ++ __INTERNAL_JOURNAL_OPEN=1 ++ # Increase level of indent ++ __INTERNAL_METAFILE_INDENT_LEVEL=1 + fi +- __INTERNAL_JOURNAL_OPEN=1 +- # Increase level of indent +- __INTERNAL_METAFILE_INDENT_LEVEL=1 + + # display a warning message if run in POSIX mode + if [ $POSIXFIXED == "YES" ] ; then +@@ -938,20 +957,30 @@ __INTERNAL_PrintHeadLog() { + # should be called before and after that respectively. + + __INTERNAL_PersistentDataSave() { +- cat > "$__INTERNAL_PERSISTENT_DATA" <> $__INTERNAL_PERSISTENT_DATA +-declare -p __INTERNAL_PHASE_PASSED >> $__INTERNAL_PERSISTENT_DATA +-declare -p __INTERNAL_PHASE_STARTTIME >> $__INTERNAL_PERSISTENT_DATA +-declare -p __INTERNAL_PHASE_TXTLOG_START >> $__INTERNAL_PERSISTENT_DATA +-declare -p __INTERNAL_PHASE_METRICS >> $__INTERNAL_PERSISTENT_DATA ++ local var ++ ( ++ for var in \ ++ __INTERNAL_STARTTIME \ ++ __INTERNAL_TEST_STATE \ ++ __INTERNAL_PHASES_PASSED \ ++ __INTERNAL_PHASES_FAILED \ ++ __INTERNAL_PHASES_SKIPPED \ ++ __INTERNAL_JOURNAL_OPEN \ ++ __INTERNAL_PHASE_OPEN \ ++ __INTERNAL_PHASES_WORST_RESULT \ ++ __INTERNAL_METAFILE_INDENT_LEVEL \ ++ __INTERNAL_PHASE_TYPE \ ++ __INTERNAL_PHASE_NAME \ ++ __INTERNAL_PHASE_FAILED \ ++ __INTERNAL_PHASE_PASSED \ ++ __INTERNAL_PHASE_STARTTIME \ ++ __INTERNAL_PHASE_TXTLOG_START \ ++ __INTERNAL_PHASE_METRICS \ ++ ; ++ do ++ declare -p $var ++ done ++ ) | sed -r 's/declare/\0 -g/' > "$__INTERNAL_PERSISTENT_DATA" + } + + __INTERNAL_PersistentDataLoad() { diff --git a/SOURCES/reduce-meta.patch b/SOURCES/reduce-meta.patch new file mode 100644 index 0000000..b7ecbbf --- /dev/null +++ b/SOURCES/reduce-meta.patch @@ -0,0 +1,25 @@ +unchanged: +--- a/src/journal.sh ++++ b/src/journal.sh +@@ -922,7 +922,7 @@ __INTERNAL_WriteToMetafile(){ + + line="$indent${element:+$element }--timestamp=\"${__INTERNAL_TIMESTAMP}\"$line" + lineraw="$indent${element:+$element }--timestamp=\"${__INTERNAL_TIMESTAMP}\"$lineraw" +- echo "#${lineraw:1}" >> $__INTERNAL_BEAKERLIB_METAFILE ++ [[ -n "$DEBUG" ]] && echo "#${lineraw:1}" >> $__INTERNAL_BEAKERLIB_METAFILE + echo "$line" >> $__INTERNAL_BEAKERLIB_METAFILE + } + +only in patch2: +unchanged: +--- a/src/test/journalTest.sh ++++ b/src/test/journalTest.sh +@@ -26,7 +26,7 @@ test_rlJournalStart(){ + assertTrue "journal is well-formed XML" "xmllint $__INTERNAL_BEAKERLIB_JOURNAL >/dev/null" + + # existing journal is not overwritten +- silentIfNotDebug 'rlLog "I am"' ++ silentIfNotDebug 'DEBUG=1 rlLog "I am"' + rlJournalStart + assertTrue "existing meta not overwritten" \ + "grep 'I\\\ am' $__INTERNAL_BEAKERLIB_METAFILE" diff --git a/SOURCES/result-file.patch b/SOURCES/result-file.patch new file mode 100644 index 0000000..76267a0 --- /dev/null +++ b/SOURCES/result-file.patch @@ -0,0 +1,177 @@ +diff -u b/src/journal.sh b/src/journal.sh +--- b/src/journal.sh ++++ b/src/journal.sh +@@ -115,12 +115,13 @@ + export __INTERNAL_METAFILE_INDENT_LEVEL=0 + __INTERNAL_PHASE_TYPE=() + __INTERNAL_PHASE_NAME=() +- export __INTERNAL_PRESISTENT_DATA="$BEAKERLIB_DIR/PersistentData" ++ export __INTERNAL_PERSISTENT_DATA="$BEAKERLIB_DIR/PersistentData" ++ export __INTERNAL_TEST_RESULTS="$BEAKERLIB_DIR/TestResults" + export __INTERNAL_JOURNAL_OPEN='' + __INTERNAL_PersistentDataLoad + export __INTERNAL_PHASES_FAILED=0 + export __INTERNAL_PHASES_PASSED=0 +- export __INTERNAL_PHASES_SKIPED=0 ++ export __INTERNAL_PHASES_SKIPPED=0 + export __INTERNAL_PHASES_WORST_RESULT='PASS' + export __INTERNAL_TEST_STATE=0 + __INTERNAL_PHASE_TXTLOG_START=() +@@ -249,6 +250,7 @@ + + echo "#End of metafile" >> $__INTERNAL_BEAKERLIB_METAFILE + __INTERNAL_JournalXMLCreate ++ __INTERNAL_TestResultsSave + } + + +@@ -346,11 +348,11 @@ + + __INTERNAL_update_journal_txt() { + local textfile +- local duration=$(($__INTERNAL_TIMESTAMP - $__INTERNAL_STARTTIME)) + local endtime ++ __INTERNAL_DURATION=$(($__INTERNAL_TIMESTAMP - $__INTERNAL_STARTTIME)) + printf -v endtime "%($__INTERNAL_TIMEFORMAT_LONG)T %s" $__INTERNAL_TIMESTAMP "(still running)" + [[ -n "$__INTERNAL_ENDTIME" ]] && printf -v endtime "%($__INTERNAL_TIMEFORMAT_LONG)T" $__INTERNAL_ENDTIME +- local sed_patterns="0,/ Test finished : /s/^( Test finished : ).*\$/\1$endtime/;0,/ Test duration : /s/^( Test duration : ).*\$/\1$duration seconds/" ++ local sed_patterns="0,/ Test finished : /s/^( Test finished : ).*\$/\1$endtime/;0,/ Test duration : /s/^( Test duration : ).*\$/\1$__INTERNAL_DURATION seconds/" + for textfile in "$__INTERNAL_BEAKERLIB_JOURNAL_COLORED" "$__INTERNAL_BEAKERLIB_JOURNAL_TXT"; do + sed -r -i "$sed_patterns" "$textfile" + done +@@ -439,6 +441,43 @@ + return 0 + } + ++ ++# Creation of TestResults file ++# Each line of the file contains TESTRESULT_VAR=$RESULT_VALUE ++# so the file can be sourced afterwards ++__INTERNAL_TestResultsSave(){ ++ # Set exit code of the test according to worst phase result ++ case "$__INTERNAL_PHASES_WORST_RESULT" in ++ PASS) ++ __TESTRESULT_RESULT_ECODE="0" ++ ;; ++ WARN) ++ __TESTRESULT_RESULT_ECODE="10" ++ ;; ++ FAIL) ++ __TESTRESULT_RESULT_ECODE="20" ++ ;; ++ *) ++ __TESTRESULT_RESULT_ECODE="30" ++ ;; ++ esac ++ ++ cat > "$__INTERNAL_TEST_RESULTS" < "$__INTERNAL_PRESISTENT_DATA" < "$__INTERNAL_PERSISTENT_DATA" <> $__INTERNAL_PRESISTENT_DATA +-declare -p __INTERNAL_PHASE_PASSED >> $__INTERNAL_PRESISTENT_DATA +-declare -p __INTERNAL_PHASE_STARTTIME >> $__INTERNAL_PRESISTENT_DATA +-declare -p __INTERNAL_PHASE_TXTLOG_START >> $__INTERNAL_PRESISTENT_DATA +-declare -p __INTERNAL_PHASE_METRICS >> $__INTERNAL_PRESISTENT_DATA ++declare -p __INTERNAL_PHASE_FAILED >> $__INTERNAL_PERSISTENT_DATA ++declare -p __INTERNAL_PHASE_PASSED >> $__INTERNAL_PERSISTENT_DATA ++declare -p __INTERNAL_PHASE_STARTTIME >> $__INTERNAL_PERSISTENT_DATA ++declare -p __INTERNAL_PHASE_TXTLOG_START >> $__INTERNAL_PERSISTENT_DATA ++declare -p __INTERNAL_PHASE_METRICS >> $__INTERNAL_PERSISTENT_DATA + } + + __INTERNAL_PersistentDataLoad() { +- [[ -r "$__INTERNAL_PRESISTENT_DATA" ]] && . "$__INTERNAL_PRESISTENT_DATA" ++ [[ -r "$__INTERNAL_PERSISTENT_DATA" ]] && . "$__INTERNAL_PERSISTENT_DATA" + } + + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +only in patch2: +unchanged: +--- a/src/beakerlib.sh ++++ b/src/beakerlib.sh +@@ -96,6 +96,48 @@ See the BKRDOC section for more information about Automated documentation genera + + =for comment beakerlib-manual-footer + ++=head1 OUTPUT FILES ++ ++Location of test results related output files can be configured by setting BEAKERLIB_DIR variable before running the test. If it is not set, temporary directory is created. ++ ++=head2 journal.txt ++ ++Journal in human readable form. ++ ++=head2 journal.xml ++ ++Journal in XML format, requires python. This dependency can be avoided if the test is run with variable BEAKERLIB_JOURNAL set to 0 in which case journal.xml is not created. ++ ++=head3 XSLT ++ ++XML journal can be transformed through XSLT template. Which template is used is configurable by setting BEAKERLIB_JOURNAL variable. Value can be either filename in which case beakerlib will try to use $INSTALL_DIR/xslt-template/$filename (e.g.: /usr/share/beakerlib/xstl-templates/xunit.xsl) or it can be path to a template anywhere on the system. ++ ++=head2 TestResults ++ ++Overall results of the test in a 'sourceable' form. Each line contains a pair VAR=VALUE. All variable names have 'TESTRESULT_' prefix. ++ ++=head3 List of variables: ++ ++TESTRESULT_RESULT_STRING - Result of the test in a string, e.g.: PASS, FAIL, WARN. ++ ++TESTRESULT_RESULT_ECODE - Result of the test as an integer, 0 equals to PASS. ++ ++TESTRESULT_PHASES_PASSED - Number of phases that ended with PASS. ++ ++TESTRESULT_PHASES_FAILED - Number of phases that ended with non-PASS result. ++ ++TESTRESULT_PHASES_SKIPPED - Number of skipped phases. ++ ++TESTRESULT_ASSERTS_FAILED - Number of asserts that ended with non-PASS result in the whole test. ++ ++TESTRESULT_STARTTIME - Time when test started in seconds since epoch. ++ ++TESTRESULT_ENDTIME - Time when test ended in seconds since epoch. ++ ++TESTRESULT_DURATION - Duration of the test run in seconds. ++ ++TESTRESULT_BEAKERLIB_DIR - Directory with test results files. ++ + =head1 EXAMPLES + + =head2 Simple diff --git a/SOURCES/rlRun-output.patch b/SOURCES/rlRun-output.patch new file mode 100644 index 0000000..71d8e31 --- /dev/null +++ b/SOURCES/rlRun-output.patch @@ -0,0 +1,46 @@ +--- a/src/testing.sh 2018-02-24 14:44:24.213182846 +0100 ++++ b/src/testing.sh 2018-02-24 14:44:58.046031444 +0100 +@@ -731,6 +731,12 @@ + Be aware that there are some variables which can collide with your code executed + within rlRun. You should avoid using __INTERNAL_rlRun_* variables. + ++=item ++ ++When any of C<-t> C<-l>, C<-c>, or C<-s> option is used, special file ++descriptors 111 and 112 are used to avoid the issue with incomplete log file, ++bz1361246. ++ + =back + + B using C tool is now disabled because of bug 547686. +@@ -848,9 +854,28 @@ + __INTERNAL_PrintText "$__INTERNAL_rlRun_comment_begin" "BEGIN" + + if $__INTERNAL_rlRun_DO_LOG || $__INTERNAL_rlRun_DO_TAG || $__INTERNAL_rlRun_DO_KEEP; then +- eval "$__INTERNAL_rlRun_command" 2> >(sed -u -e "s/^/$__INTERNAL_rlRun_TAG_ERR/g" | +- tee -a $__INTERNAL_rlRun_LOG_FILE) 1> >(sed -u -e "s/^/$__INTERNAL_rlRun_TAG_OUT/g" | tee -a $__INTERNAL_rlRun_LOG_FILE) ++ # handle issue with incomplete logs (bz1361246), this could be improved using coproc ++ # in RHEL-6 and higher ++ # open file descriptors to parsing processes ++ exec 111> >(sed -u -e "s/^/$__INTERNAL_rlRun_TAG_OUT/g" | tee -a $__INTERNAL_rlRun_LOG_FILE) ++ local __INTERNAL_rlRun_OUTpid=$! ++ exec 112> >(sed -u -e "s/^/$__INTERNAL_rlRun_TAG_ERR/g" | tee -a $__INTERNAL_rlRun_LOG_FILE) ++ local __INTERNAL_rlRun_ERRpid=$! ++ eval "$__INTERNAL_rlRun_command" 2>&112 1>&111 + local __INTERNAL_rlRun_exitcode=$? ++ # close parsing processes ++ exec 111>&- ++ exec 112>&- ++ # wait for parsing processes to finish their job ++ local __INTERNAL_rlRun_counter=0 ++ while kill -0 $__INTERNAL_rlRun_OUTpid 2>/dev/null || kill -0 $__INTERNAL_rlRun_ERRpid 2>/dev/null; do ++ [[ $((__INTERNAL_rlRun_counter++)) -gt 12000 ]] && { ++ rlLogError "waiting for flushing the output timed out, there might be some data missing in the output file" ++ break ++ } ++ sleep 0.01; ++ done ++ rlLogDebug "waiting for parsing processes took $__INTERNAL_rlRun_counter cycles" + else + eval "$__INTERNAL_rlRun_command" + local __INTERNAL_rlRun_exitcode=$? diff --git a/SOURCES/rxvt-terminals-coloring.patch b/SOURCES/rxvt-terminals-coloring.patch new file mode 100644 index 0000000..d8faf6c --- /dev/null +++ b/SOURCES/rxvt-terminals-coloring.patch @@ -0,0 +1,26 @@ +From e6a98ff289c0c085767c2e910e0a3fb983d8b273 Mon Sep 17 00:00:00 2001 +From: Alois Mahdal +Date: Thu, 1 Feb 2018 15:12:12 +0100 +Subject: [PATCH 1/5] Enable colors on rxvt terminals + +rxvt-unicode sets TERM to 'rxvt-unicode'. plain old rxvt sets it to +`rxvt`. +--- + src/logging.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/logging.sh b/src/logging.sh +index 2d3972a..38a0466 100644 +--- a/src/logging.sh ++++ b/src/logging.sh +@@ -175,7 +175,7 @@ __INTERNAL_color_set() { + [[ -t 1 ]] || T="" + [[ -t 2 ]] || T="" + case $T in +- xterm*|screen|linux) ++ xterm*|screen|linux|rxvt*) + __INTERNAL_color_black="\e[0;30m" + __INTERNAL_color_dark_gray="\e[1;30m" + __INTERNAL_color_red="\e[0;31m" +-- +2.14.3 diff --git a/SOURCES/srpm-fetch.patch b/SOURCES/srpm-fetch.patch new file mode 100644 index 0000000..1176d0d --- /dev/null +++ b/SOURCES/srpm-fetch.patch @@ -0,0 +1,29 @@ +From 24d774fb27375f0848d56603be873937d23209cc Mon Sep 17 00:00:00 2001 +From: Zdenek Zambersky +Date: Thu, 2 Aug 2018 16:50:35 +0200 +Subject: [PATCH 1/4] rpms.sh: fixed search url for src rpms + +--- + src/rpms.sh | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/rpms.sh b/src/rpms.sh +index 66d9aa8..878abba 100644 +--- a/src/rpms.sh ++++ b/src/rpms.sh +@@ -671,7 +671,12 @@ __INTERNAL_rpmGetNextUrl() { + ;; + koji,nvra.rpm) + rlLogDebug "$FUNCNAME(): get rpm info" +- local rpm_info=$($__INTERNAL_WGET -O - "$base_url/search?match=exact&type=rpm&terms=$N-$V-$R.$A.rpm") ++ local rpm_info ++ if [[ -n "$source" ]]; then ++ rpm_info=$($__INTERNAL_WGET -O - "$base_url/search?match=exact&type=rpm&terms=$N-$V-$R.src.rpm") ++ else ++ rpm_info=$($__INTERNAL_WGET -O - "$base_url/search?match=exact&type=rpm&terms=$N-$V-$R.$A.rpm") ++ fi + [[ $? -ne 0 || -z "$rpm_info" ]] && { + rlLogError "could not download rpm information" + let res++ +-- +2.17.1 diff --git a/SOURCES/test-built-time.patch b/SOURCES/test-built-time.patch new file mode 100644 index 0000000..5c47f35 --- /dev/null +++ b/SOURCES/test-built-time.patch @@ -0,0 +1,25 @@ +From 41cd84632aa1e5d4a5876a780f10864e87580e41 Mon Sep 17 00:00:00 2001 +From: Dalibor Pospisil +Date: Wed, 18 Oct 2017 10:52:23 +0200 +Subject: [PATCH] fixed typo + +--- + src/journal.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/journal.sh b/src/journal.sh +index 03d4fad..e7d65f2 100644 +--- a/src/journal.sh ++++ b/src/journal.sh +@@ -722,7 +722,7 @@ __INTERNAL_CreateHeader(){ + package="${packagename:-$test_version}" + local test_built + [[ -n "$package" ]] && test_built=$(rpm -q --qf '%{BUILDTIME}\n' $package) && { +- test_built="$(ehco "$test_built" | head -n 1 )" ++ test_built="$(echo "$test_built" | head -n 1 )" + printf -v test_built "%($__INTERNAL_TIMEFORMAT_LONG)T" "$test_built" + __INTERNAL_WriteToMetafile testversion -- "$test_built" + __INTERNAL_LogText " Test built : $test_built" 2> /dev/null +-- +2.13.6 + diff --git a/SOURCES/unified-footer.patch b/SOURCES/unified-footer.patch new file mode 100644 index 0000000..93e1de9 --- /dev/null +++ b/SOURCES/unified-footer.patch @@ -0,0 +1,85 @@ +From c8b0fdde74b7cb1717454992772ab63e6cffd234 Mon Sep 17 00:00:00 2001 +From: Dalibor Pospisil +Date: Fri, 2 Feb 2018 15:16:58 +0100 +Subject: [PATCH 5/5] unify footer printing + +make footer of the phase and also the footer of whole test formated the same +it also removes controversary strong splitter of footer +--- + src/journal.sh | 47 ++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 40 insertions(+), 7 deletions(-) + +diff --git a/src/journal.sh b/src/journal.sh +index 867d08f..f3f2b78 100644 +--- a/src/journal.sh ++++ b/src/journal.sh +@@ -255,8 +255,13 @@ rlJournalEnd(){ + + echo "#End of metafile" >> $__INTERNAL_BEAKERLIB_METAFILE + +- __INTERNAL_LogText "Phases: $__INTERNAL_PHASES_PASSED good, $__INTERNAL_PHASES_FAILED bad" LOG 2>&1 +- __INTERNAL_LogText "RESULT: $__INTERNAL_TEST_NAME" $__INTERNAL_PHASES_WORST_RESULT 2>&1 ++ __INTERNAL_PrintFootLog $__INTERNAL_STARTTIME \ ++ $__INTERNAL_ENDTIME \ ++ Phases \ ++ $__INTERNAL_PHASES_PASSED \ ++ $__INTERNAL_PHASES_FAILED \ ++ $__INTERNAL_PHASES_WORST_RESULT \ ++ "OVERALL" + + __INTERNAL_JournalXMLCreate + __INTERNAL_TestResultsSave +@@ -603,11 +608,12 @@ rljClosePhase(){ + rlLogDebug "rljClosePhase: Phase $name closed" + __INTERNAL_SET_TIMESTAMP + local endtime="$__INTERNAL_TIMESTAMP" +- __INTERNAL_LogText "________________________________________________________________________________" +- __INTERNAL_LogText "Duration: $((endtime - __INTERNAL_PHASE_STARTTIME))s" LOG +- __INTERNAL_LogText "Assertions: $__INTERNAL_PHASE_PASSED good, $__INTERNAL_PHASE_FAILED bad" LOG +- __INTERNAL_LogText "RESULT: $name" $result +- __INTERNAL_LogText '' ++ __INTERNAL_PrintFootLog $__INTERNAL_PHASE_STARTTIME \ ++ $endtime \ ++ Assertions \ ++ $__INTERNAL_PHASE_PASSED \ ++ $__INTERNAL_PHASE_FAILED \ ++ $result + local logfile="$(mktemp)" + tail -n +$((__INTERNAL_PHASE_TXTLOG_START+1)) $__INTERNAL_BEAKERLIB_JOURNAL_TXT > $logfile + rlReport "$(echo "${name//[^[:alnum:]]/-}" | tr -s '-')" "$result" "$score" "$logfile" +@@ -934,6 +940,33 @@ __INTERNAL_PrintHeadLog() { + } + + ++# $1 - start time ++# $2 - end time ++# $3 - stat name ++# $4 - stat good ++# $5 - stat bad ++# $6 - result ++# $7 - result prefix ' RESULT: ' ++__INTERNAL_PrintFootLog(){ ++ local result_colored ++ local starttime="$1" ++ local endtime="$2" ++ local stat_name="$3" ++ local stat_good="$4" ++ local stat_bad="$5" ++ local result="$6" ++ local result_pref="$7" ++ [[ -n "$result_pref" ]] && result_pref+=" " ++ __INTERNAL_colorize_prio "$result" result_colored ++ __INTERNAL_LogText "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" ++ __INTERNAL_LogText ":: Duration: $((endtime - starttime))s" ++ __INTERNAL_LogText ":: $stat_name: $stat_good good, $stat_bad bad" ++ __INTERNAL_LogText ":: ${result_pref}RESULT: $result" '' '' \ ++ ":: ${result_pref}RESULT: $result_colored" ++ __INTERNAL_LogText '' ++} ++ ++ + # whenever any of the persistent variable is touched, + # functions __INTERNAL_PersistentDataLoad and __INTERNAL_PersistentDataSave + # should be called before and after that respectively. +-- +2.14.3 diff --git a/SOURCES/var-TEST.patch b/SOURCES/var-TEST.patch new file mode 100644 index 0000000..8e29ab8 --- /dev/null +++ b/SOURCES/var-TEST.patch @@ -0,0 +1,41 @@ +From 30c5a9b8982e6342cfff28871083f36efc80f52b Mon Sep 17 00:00:00 2001 +From: Dalibor Pospisil +Date: Tue, 12 Dec 2017 14:34:35 +0100 +Subject: [PATCH 14/18] leave variable TEST intact + +--- + src/journal.sh | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/journal.sh b/src/journal.sh +index 092de14..8e68fb3 100644 +--- a/src/journal.sh ++++ b/src/journal.sh +@@ -432,9 +432,9 @@ rlJournalPrintText(){ + cat "$textfile" + + local __INTERNAL_LogText_no_file=1 +- __INTERNAL_PrintHeadLog "${TEST}" 2>&1 ++ __INTERNAL_PrintHeadLog "${__INTERNAL_TEST_NAME}" 2>&1 + __INTERNAL_LogText "Phases: $__INTERNAL_PHASES_PASSED good, $__INTERNAL_PHASES_FAILED bad" LOG 2>&1 +- __INTERNAL_LogText "RESULT: $TEST" $__INTERNAL_PHASES_WORST_RESULT 2>&1 ++ __INTERNAL_LogText "RESULT: $__INTERNAL_TEST_NAME" $__INTERNAL_PHASES_WORST_RESULT 2>&1 + + return 0 + } +@@ -779,9 +779,9 @@ __INTERNAL_CreateHeader(){ + __INTERNAL_LogText " Test duration : " 2> /dev/null + + # Test name +- TEST="${TEST:-unknown}" +- __INTERNAL_WriteToMetafile testname -- "${TEST}" +- __INTERNAL_LogText " Test name : ${TEST}" 2> /dev/null ++ __INTERNAL_TEST_NAME="${TEST:-unknown}" ++ __INTERNAL_WriteToMetafile testname -- "${__INTERNAL_TEST_NAME}" ++ __INTERNAL_LogText " Test name : ${__INTERNAL_TEST_NAME}" 2> /dev/null + + # OS release + local release=$(cat /etc/redhat-release) +-- +2.14.3 + diff --git a/SOURCES/wget2curl-fallback.patch b/SOURCES/wget2curl-fallback.patch new file mode 100644 index 0000000..4846026 --- /dev/null +++ b/SOURCES/wget2curl-fallback.patch @@ -0,0 +1,77 @@ +From 10520de65d10d2ab34329e24144aa922a430b229 Mon Sep 17 00:00:00 2001 +From: Dalibor Pospisil +Date: Wed, 22 Aug 2018 13:09:47 +0200 +Subject: [PATCH 4/4] use wget or curl for web download + +Now there's a fallback to curl if wget is not available. +Wget has still a preference as it has got better progress printing while +the output is redirected to a file. +--- + src/rpms.sh | 32 +++++++++++++++++++++++++++----- + 1 file changed, 27 insertions(+), 5 deletions(-) + +diff --git a/src/rpms.sh b/src/rpms.sh +index 878abba..e51dd4f 100644 +--- a/src/rpms.sh ++++ b/src/rpms.sh +@@ -630,7 +630,27 @@ __INTERNAL_rpmInitUrl() { + } + + +-__INTERNAL_WGET="wget -t 3 -T 180 -w 20 --waitretry=30 --no-check-certificate --progress=dot:giga" ++__INTERNAL_WGET() { ++ local QUIET ++ [[ "$1" == "--quiet" ]] && { QUIET=1; shift; } ++ local URL="$2" ++ local FILE="$1" ++ local res=0 ++ if which wget &> /dev/null; then ++ rlLogDebug "$FUNCNAME(): using wget for download" ++ QUIET="${QUIET:+--quiet}" ++ wget $QUIET -t 3 -T 180 -w 20 --waitretry=30 --no-check-certificate --progress=dot:giga -O $FILE $URL || let res++ ++ elif which curl &> /dev/null; then ++ rlLogDebug "$FUNCNAME(): using curl for download" ++ QUIET="${QUIET:+--silent}" ++ [[ -t 2 ]] || QUIET="${QUIET:---silent --show-error}" ++ curl $QUIET --location --retry-connrefused --retry-delay 3 --retry-max-time 3600 --retry 3 --connect-timeout 180 --max-time 1800 --insecure -o $FILE "$URL" || let res++ ++ else ++ rlLogError "$FUNCNAME(): no tool for downloading web content is available" ++ let res++ ++ fi ++ return $res ++} + + # __INTERNAL_rpmGetNextUrl N V R A | --source N V R + __INTERNAL_rpmGetNextUrl() { +@@ -673,9 +695,9 @@ __INTERNAL_rpmGetNextUrl() { + rlLogDebug "$FUNCNAME(): get rpm info" + local rpm_info + if [[ -n "$source" ]]; then +- rpm_info=$($__INTERNAL_WGET -O - "$base_url/search?match=exact&type=rpm&terms=$N-$V-$R.src.rpm") ++ rpm_info=$(__INTERNAL_WGET - "$base_url/search?match=exact&type=rpm&terms=$N-$V-$R.src.rpm") + else +- rpm_info=$($__INTERNAL_WGET -O - "$base_url/search?match=exact&type=rpm&terms=$N-$V-$R.$A.rpm") ++ rpm_info=$(__INTERNAL_WGET - "$base_url/search?match=exact&type=rpm&terms=$N-$V-$R.$A.rpm") + fi + [[ $? -ne 0 || -z "$rpm_info" ]] && { + rlLogError "could not download rpm information" +@@ -692,7 +714,7 @@ __INTERNAL_rpmGetNextUrl() { + rlLogDebug "$FUNCNAME(): extracted buildurl='$buildurl'" + [[ "$buildurl" =~ http ]] || buildurl="$base_url/$buildurl" + rlLogDebug "$FUNCNAME(): using buildurl='$buildurl'" +- local buildinfo=$($__INTERNAL_WGET -O - "$buildurl") ++ local buildinfo=$(__INTERNAL_WGET - "$buildurl") + [[ $? -ne 0 || -z "$buildinfo" ]] && { + rlLogError "could not download build information" + let res++ +@@ -752,7 +774,7 @@ __INTERNAL_rpmDirectDownload() { + url="$__INTERNAL_RETURN_VALUE"; unset __INTERNAL_RETURN_VALUE + local pkg=$(basename "$url") + rlLog "trying download from '$url'" +- if $__INTERNAL_WGET $quiet -O $pkg "$url"; then ++ if __INTERNAL_WGET $quiet $pkg "$url"; then + rlLogDebug "$FUNCNAME(): package '$pkg' was successfully downloaded" + echo "$pkg" + return 0 +-- +2.17.1 diff --git a/SPECS/beakerlib.spec b/SPECS/beakerlib.spec new file mode 100644 index 0000000..999248c --- /dev/null +++ b/SPECS/beakerlib.spec @@ -0,0 +1,366 @@ +Name: beakerlib +Summary: A shell-level integration testing library +Version: 1.17 +Release: 19%{?dist} +License: GPLv2 +Group: Development/Libraries +BuildArch: noarch +URL: https://github.com/%{name} +Autoreq: 0 +Requires: nfs-utils +Requires: /bin/bash +Requires: /bin/sh +Recommends: /usr/libexec/platform-python +Recommends: /usr/bin/perl +Requires: grep +Requires: sed +Requires: net-tools +Requires: coreutils +Requires: tar +Requires: gzip +Requires: util-linux +Requires: which +Requires: (wget or curl) +Suggests: wget +Recommends: python3-lxml +Recommends: xmllint +Obsoletes: rhtslib beaker-lib +Provides: rhtslib beaker-lib +Conflicts: beakerlib-redhat < 1-30 + +BuildRequires: /usr/bin/pod2man +BuildRequires: perl-generators +BuildRequires: util-linux + +Source0: https://github.com/beakerlib/beakerlib/archive/%{name}-%{version}.tar.gz +Source1: %{name}-tmpfiles.conf + +Patch0: bugzilla-links.patch +Patch1: test-built-time.patch +Patch2: result-file.patch +Patch3: ifs-issue.patch +Patch4: journaling-fixes.patch +Patch5: get-text-journal-size.patch +Patch6: var-TEST.patch +Patch7: reduce-meta.patch +Patch8: enable-nested-phases.patch +Patch9: debug-to-console.patch +Patch10: phase-names-sanitization.patch +Patch11: reboot-in-phase.patch +Patch12: rxvt-terminals-coloring.patch +Patch13: persistent-data-load.patch +Patch14: final-summary-in-rlJournalEnd.patch +Patch15: extended-coloring-capabilities.patch +Patch16: unified-footer.patch +Patch17: rlRun-output.patch +Patch18: python2.patch +Patch19: python3.patch +Patch20: srpm-fetch.patch +Patch21: journalling-import-check.patch +Patch22: handle-missing-python.patch +Patch23: wget2curl-fallback.patch +Patch24: platform-python.patch +Patch25: meta-format-fix.patch + +%prep +%autosetup -p1 + +%build +make build + +%install +%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} +%{!?_tmpfilesdir: %global _tmpfilesdir %{_prefix}/lib/tmpfiles.d/} +rm -rf $RPM_BUILD_ROOT +make PKGDOCDIR=%{_pkgdocdir} DESTDIR=$RPM_BUILD_ROOT install +mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir} +install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT/%{_tmpfilesdir}/%{name}.conf + +%description +The BeakerLib project means to provide a library of various helpers, which +could be used when writing operating system level integration tests. + +%files +%defattr(-,root,root,-) +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/xslt-templates +%dir %{_pkgdocdir} +%dir %{_pkgdocdir}/examples +%dir %{_pkgdocdir}/examples/* +%{_datadir}/%{name}/dictionary.vim +%{_datadir}/%{name}/*.sh +%{_datadir}/%{name}/xslt-templates/* +%{_bindir}/%{name}-* +%{_mandir}/man1/%{name}*1* +%doc %{_pkgdocdir}/* +%config %{_tmpfilesdir}/%{name}.conf + +%package vim-syntax +Summary: Files for syntax highlighting BeakerLib tests in VIM editor +Group: Development/Libraries +Requires: vim-common +BuildRequires: vim-common + +%description vim-syntax +Files for syntax highlighting BeakerLib tests in VIM editor + +%files vim-syntax +%{_datadir}/vim/vimfiles/after/ftdetect/beakerlib.vim +%{_datadir}/vim/vimfiles/after/syntax/beakerlib.vim + +%changelog +* Thu Sep 7 2018 Dalibor Pospisil - 1.17-19 +- fixed meta file generation +- follow url redirection when using curl +- fixed checking for python interpreter + +* Wed Aug 22 2018 Dalibor Pospisil - 1.17-16 +- weak dependency on platform-python +- handling of missing python +- fixed srpm fetching +- fallback to curl if wget is not available +- changed requirements structure + +* Mon Jun 25 2018 Dalibor Pospisil - 1.17-15 +- migrated to python3 +- weak dependency of python3-lxml - without this the journal.xml just will not be generated + +* Tue May 15 2018 Dalibor Pospisil - 1.17-14 +- use python2 as an interpreter of python scripts + +* Sat Feb 24 2018 Dalibor Pospisil - 1.17-13 +- rlRun -s now waits for output logs to be flushed, bz1361246 + bz1416796 + +* Wed Feb 14 2018 Iryna Shcherbina - 1.17-12 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Fri Feb 09 2018 Igor Gnatenko - 1.17-11 +- Escape macros in %%changelog + +* Sat Feb 3 2018 Dalibor Pospisil - 1.17-9 +- support rxvt terminal colors +- fixed persistent data load for bash version <= 4.1.2 +- moved printing of final summray to rlJournalEnd +- extended coloring capabilities +- unified footer format + +* Fri Jan 26 2018 Dalibor Pospisil - 1.17-7 +- phase name sanitization (remove all weird characters) +- allow debug message to to only to console (speeds execution up in debug) +- allow to reboot inside of phase and continue there +- fixed persistent data loading + +* Mon Dec 18 2017 Dalibor Pospisil - 1.17-6 +- added missing dependecy + +* Wed Dec 13 2017 Dalibor Pospisil - 1.17-5 +- result file tweaks +- fixed ifs issue +- improved performance of journaling.py +- fixed computing the length of text text journal per phase +- use internal test name and do not touch TEST variable if empty +- omit human readable meta file comments in non-debug mode +- enable nested phases by default + + +* Fri Oct 20 2017 Dalibor Pospisil - 1.17-4 +- updated dependecies set + +* Wed Oct 18 2017 Dalibor Pospisil - 1.17-2 +- completely reworked getting rpms +- bstor.py rewritten in pure bash +- some doc fixes +- completely rewritten journal +- extended test suite +- support for XSL transformation of journal.xml +- provided xunit.xsl +- libraries are now searched also in /usr/share/beakerlib-libraries + +* Wed May 17 2017 Dalibor Pospisil - 1.16-3 +- reworked rpm download function and fallbacks, bz1448510 +- added links to bugzilla + +* Fri Apr 21 2017 Dalibor Pospisil - 1.16-2 +- added missing dependency +- updated links to beakerlib's new home, bz1436810 +- added rlAssertLesser and rlAssertLesserOrEqual, bz1423488 +- added rpm-handling functions rlFetchSrcForInstalled, rlRpmDownload, and rlRpmInstall + +* Thu Jan 26 2017 Dalibor Pospisil - 1.15-1 +- added rlIsCentOS similar to rlIsRHEL, bz1214190 +- added missing dependencies, bz1391969 +- make rlRun use internal variables with more unique name, bz1285804 +- fix rlRun exitcodes while using various switches, bz1303900 +- rlFileRestore now better distinquish betwwen various errorneous situations, bz1370453 +- rlService* won't be blocked be less(1) while systemctl redirection is in place, bz1383303 +- variable LibraryDir variable is created for all imported libraries, holding the path to the library source, bz1074487 +- all logging messages are now printed to stderr, bz1171881 +- wildcard %%doc inclusion in spec, bz1206173 +- prevent unbound variables, bz1228264 +- new functions rlServiceEnabled/rlServiceDisable for enabling/disabling services, bz1234804 +- updated documentation for rlImport -all, bz1246061 +- rlAssertNotEquals now accept empty argument, bz1303618 +- rlRun now uses better filename for output log, bz1314700 +- fixed cosmetic discrepancy in log output, bz1374256 +- added documentation reference for bkrdoc, bz843823 +- added documentation of the testwatcher feature, bz1218169 +- rlServiceRestore can restore all saved services in no parameter provided, bz494318 +- rlCheckMount take mount options (ro/rw) into consideration, bz1191627 +- added documentation for LOG_LEVEL variable, bz581816 + +* Thu Oct 29 2015 Dalibor Pospisil - 1.11-1 +- fixed bugs 971347, 1076471, 1262888, 1216177, 1184414, 1192535, 1224345, + 1211269, 1224362, 1205330, 1175513, 1211617, 1221352 + +* Wed Feb 4 2015 Dalibor Pospisil - 1.10-2 +- remount if mounting already mounted mount point with options, + fixes bug 1173623 + +* Mon Dec 1 2014 Dalibor Pospisil - 1.10-1 +- dropped support for rlSEBoolean functions +- fixed bugs 554280, 1003433, 1103137, 1105299, 1124440, 1124454, 1131934, + 1131963, 1136206, 1155158, 1155234, 1158464, 1159191, and 1165265 + +* Thu Jul 17 2014 Dalibor Pospisil - 1.9-3 +- reverted conditional phases support + +* Wed Jul 2 2014 Dalibor Pospisil - 1.9-2 +- bunch of fixes + +* Tue Jun 17 2014 Dalibor Pospisil - 1.9-1 +- rebase to upstream 1.9 + +* Mon Jul 15 2013 Petr Muller - 1.8-2 +- Syntax highlighting in VIM (Filip Holec) + +* Fri Jun 07 2013 Petr Muller - 1.8-1 +- Robustify journal against non-ascii in release names (Petr Muller) +- Make PURPOSE file optional (Nikolai Kondrashov) +- Fix doc paths to /usr/share (Petr Muller) +- Fix corner cases of library discovery (Petr Muller) +- Robustify /dev/null usage in rlRun (Petr Muller) +- Provide more information in passed tests' messages (Petr Muller) +- rlService* functions provide more debugging information (Filip Holec) +- fix rlBundleLogs (Filip Holec) +- fix rlAssertGrep parameter processing (Miroslav Franc) + +* Thu Apr 25 2013 Petr Muller - 1.7-1 +- rebase to latest upstream +- fix padding around message timestamps (Dalibor Pospisil) + +* Wed Apr 10 2013 Petr Muller - 1.6.99.3-1 +- third attempt for upstream release +- show more package information in the header (Petr Muller) +- journal unicode robustifications (Petr Muller) +- fix crashes when /etc/redhat-release is not present (Petr Muller) +- fix searching of library paths in rlImport (Dalibor Pospisil) +- rlImport --all (Dalibor Pospisil) +- rlImport support for RhtsRequires: Library(foo/bar) (Dalibor Pospisil) +- Improved bookkeeping on already imported libraries (Dalibor Pospisil) +- rewritten rlImport to run also on old bash (Dalibor Pospisil) +- fix rlImport for libs with weird characters in name (Dalibor Pospisil) +- rlLogDebug: fix return code (Dalibor Pospisil) +- several more small fixes + +* Tue Mar 05 2013 Petr Muller - 1.6.99.2-1 +- use only distro Python, not the SCL one +- fix pipefail detection for older RHELs +- rlAssertRpm --all +- rlAssertBinaryOrigin +- journal can be used as a Python module now + +* Mon Jan 21 2013 Petr Muller - 1.6.99.1-1 +- installation machinery fix + +* Thu Jan 10 2013 Petr Muller - 1.6.99-1 +- testing the rebase to potential 1.7 +- journal storage cleanups and fixes (Jiri Jaburek) +- fixes in rlMount functions (Petr Muller) +- code cleanups +- use non-tmpfs-backed storage where needed (Petr Muller) +- rlFileBackup namespace support (Jiri Jaburek) +- rlImport implementation + +* Thu Jul 26 2012 Petr Muller - 1.6-2 +- packaging tweaks + +* Thu Jul 26 2012 Petr Muller - 1.6-1 +- update to upstream version +- code clean-up +- fix rlFileBackup behavior with symlinks (Karel Srot) +- fix rlGetDistroRelease for RHEL7 Alphas +- fix journal tracebacks related to time operations + +* Mon Jun 11 2012 Petr Muller - 1.5-2 +- extended rlIs{RHEL/Fedora} syntax allowing intervals (Jiri Jaburek) + +* Tue May 15 2012 Petr Muller - 1.5-1 +- fix bz754180 (Matej Kollar) +- fork lsb_release and remove dep on lsb_redhat + +* Thu Mar 08 2012 Petr Muller - 1.4.2 +- fix rlGetDistro* functions for RHEL7 (Petr Muller) +- fix SELinux detection in rlFileBackup/Restore (Petr Muller) + +* Fri Mar 02 2012 Petr Muller - 1.4-1 +- merge upstream changes and bump the version +- added rlIsXXXX functions from RH internal (Petr Muller) +- added COBBLER_SERVER function export if available (Marian Ganisin) +- unified bash syntax (Roman Rakus) +- INFO logs are now shown by default (Petr Splichal) +- rlFileBackup of symlinks improvements (Petr Splichal) +- added a dep on redhat-lsb to accomodate rlIsXXXX +- log colorizing (Petr Splichal) +- fix rlFileRestore problems with symlinks (Filip Skola) +- added timezone information to start/end time (Pavel Holica) +- deprecate the ABORT state (Brano Nater) +- fix rlWatchdog (Mirek Franc) +- rlCheckMount improvements (Brano Nater) +- add a summary of phase results to logfile (Ales Zelinka) +- config option for more verbose journal printing (Jan Hutar) +- Testsuite improvements (Jan Hutar) +- add John Lockhart's deja-summarize) + +* Tue Feb 21 2012 Petr Muller - 1.3-5 +- rebuild for RHEL7 + +* Fri Oct 01 2010 Petr Muller - 1.3-4 +- fixed bug when rlRun with -l param didn't work properly (Jan Hutar) +- fixed selinux context problems in rlFileRestore (Petr Splichal) + +* Wed Jun 09 2010 Petr Muller - 1.3-3 +- packaging fix (remove the unnecessary tag from release) + +* Wed Jun 09 2010 Petr Muller - 1.3-2 +- functions for determining current test status (Ales Zelinka, Petr Splichal] +- removal of unnecessary sync in rlRun (Petr Splichal) +- packaging tuned for rhel6 + +* Wed May 12 2010 Petr Muller - 1.3-1 +- packaging fixes: permission fixes, added dep on python2, +- added examples as documentation files + +* Thu Apr 29 2010 Petr Muller - 1.2-1 +- packaging fixes: docdir change, specfile tweaks +- using consistently install -p everywhere + +* Thu Apr 08 2010 Petr Muller - 1.2-0 +- disable the testsuite and removed a 3rd party lib from the tree + +* Mon Mar 22 2010 Petr Muller - 1.1-0 +- packaging fixes + +* Fri Feb 12 2010 Petr Muller - 1.0-3 +- fixed bad path preventing tests from running + +* Fri Feb 12 2010 Petr Muller - 1.0-2 +- zillion of specfile tweaks for Fedora inclusion +- staf-rhts files were removed +- added a LICENSE file +- added a better package summary +- directory structure revamped +- improved rLDejaSum + +* Wed Jan 27 2010 Petr Muller - 1.0-1 +- genesis of the standalone BeakerLib