diff --git a/.gitignore b/.gitignore index fe1c9fe..78057b4 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ beakerlib-1.3.tar.gz /beakerlib-1.8.tar.gz /beakerlib-1.9.tar.gz /beakerlib-1.10.tar.gz +/beakerlib-1.11.tar.gz diff --git a/0001-Do-not-use-with-open-as-foo-construct.patch b/0001-Do-not-use-with-open-as-foo-construct.patch deleted file mode 100644 index fb8d867..0000000 --- a/0001-Do-not-use-with-open-as-foo-construct.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 993dd30854ecf0b8eacfbc2b005dfd59778da23d Mon Sep 17 00:00:00 2001 -From: Petr Muller -Date: Wed, 10 Apr 2013 16:20:16 +0200 -Subject: [PATCH 1/3] Do not use 'with open() as foo' construct - -It does not work on RHEL<=5, with old Python not having -this syntax yet - -fix for python compat on RHEL5 ---- - src/python/bstor.py | 5 +++-- - src/python/journalling.py | 5 +++-- - 2 files changed, 6 insertions(+), 4 deletions(-) - -diff --git a/src/python/bstor.py b/src/python/bstor.py -index 04d4dfd..a512795 100755 ---- a/src/python/bstor.py -+++ b/src/python/bstor.py -@@ -36,8 +36,9 @@ class Storage(object): - - def __save_file(self, parser): - fpath = os.path.join(self.__obtain_dir(), self.namespace) -- with open(fpath, 'w') as cfile: -- parser.write(cfile) -+ cfile = open(fpath, 'w') -+ parser.write(cfile) -+ cfile.close() - - def get(self, key): - parser = self.__obtain_file() -diff --git a/src/python/journalling.py b/src/python/journalling.py -index 324a3ad..ed63e7f 100755 ---- a/src/python/journalling.py -+++ b/src/python/journalling.py -@@ -440,8 +440,9 @@ class Journal(object): - - releaseEl = newdoc.createElement("release") - try: -- with open("/etc/redhat-release", "r") as release_file: -- release = release_file.read().strip() -+ release_file = open("/etc/redhat-release", "r") -+ release = release_file.read().strip() -+ release_file.close() - except IOError: - release = "unknown" - release = unicode(release, 'utf-8', errors='replace') --- -1.9.3 - diff --git a/0002-mi-object-does-not-have-size-in-old-pythons.patch b/0002-mi-object-does-not-have-size-in-old-pythons.patch deleted file mode 100644 index 21a6017..0000000 --- a/0002-mi-object-does-not-have-size-in-old-pythons.patch +++ /dev/null @@ -1,60 +0,0 @@ -From ead72529c223163a1a9f4b563a9a4e4947f03756 Mon Sep 17 00:00:00 2001 -From: Petr Muller -Date: Wed, 10 Apr 2013 19:17:01 +0200 -Subject: [PATCH 2/3] mi object does not have size in old pythons - -check .count() of rpm.mi objects instead of relying on bool coercion - -Older versions of RPM (including the version in RHEL5 and earlier) did -not implement bool coercion for rpm.mi objects, they are always true -even if they contain no matches. len() is also not implemented. So we -need to check .count() before we can assume there are any matches. - -Bug: 1142535 ---- - src/python/journalling.py | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/python/journalling.py b/src/python/journalling.py -index ed63e7f..5a4a807 100755 ---- a/src/python/journalling.py -+++ b/src/python/journalling.py -@@ -296,7 +296,7 @@ class Journal(object): - return None - - testInfo = ts.dbMatch("name", package) -- if not testInfo: -+ if not testInfo.count(): - return None - - buildtime = time.gmtime(int(testInfo.next().format("%{BUILDTIME}"))) -@@ -318,7 +318,7 @@ class Journal(object): - def getRpmVersion(xmldoc, package, rpm_ts): - rpms = [] - mi = rpm_ts.dbMatch("name", package) -- if len(mi) == 0: -+ if mi.count() == 0: - if package != 'unknown': - pkgDetailsEl = xmldoc.createElement("pkgnotinstalled") - pkgDetailsCon = xmldoc.createTextNode("%s" % package) -@@ -385,7 +385,7 @@ class Journal(object): - ts = rpm.ts() - mi = ts.dbMatch("name", "beakerlib") - beakerlibRpmEl = newdoc.createElement("beakerlib_rpm") -- if mi: -+ if mi.count(): - beakerlib_rpm = mi.next() - beakerlibRpmCon = newdoc.createTextNode("%(name)s-%(version)s-%(release)s" % beakerlib_rpm) - else: -@@ -393,7 +393,7 @@ class Journal(object): - - mi = ts.dbMatch("name", "beakerlib-redhat") - beakerlibRedhatRpmEl = newdoc.createElement("beakerlib_redhat_rpm") -- if mi: -+ if mi.count(): - beakerlib_redhat_rpm = mi.next() - beakerlibRedhatRpmCon = newdoc.createTextNode("%(name)s-%(version)s-%(release)s" % beakerlib_redhat_rpm) - else: --- -1.9.3 - diff --git a/0003-Fix-mktemp-call-for-older-RHELs.patch b/0003-Fix-mktemp-call-for-older-RHELs.patch deleted file mode 100644 index 247db31..0000000 --- a/0003-Fix-mktemp-call-for-older-RHELs.patch +++ /dev/null @@ -1,62 +0,0 @@ -From ce550a40fd0003b52efddba2f57bd16ac16286e7 Mon Sep 17 00:00:00 2001 -From: Petr Muller -Date: Fri, 7 Jun 2013 13:36:16 +0200 -Subject: [PATCH 3/3] Fix mktemp call for older RHELs - -Version of mktemp present in older RHELs (RHEL5 and older) does not -support --tmpdir parameter used in rlLog and rlRun implementations. - -Therefore, on these RHELs, older parameter -p (deprecated in newer -RHELs) must be used. ---- - src/logging.sh | 4 ++-- - src/testing.sh | 6 +++--- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/logging.sh b/src/logging.sh -index f278739..ac71dc6 100644 ---- a/src/logging.sh -+++ b/src/logging.sh -@@ -55,9 +55,9 @@ Implements also phase support with automatic assert evaluation. - __INTERNAL_LogText() { - local MESSAGE=${1:-"***BAD BEAKERLIB_HLOG CALL***"} - local LOGFILE=${2:-$OUTPUTFILE} -- [ -z "$LOGFILE" ] && LOGFILE=$( mktemp --tmpdir=$__INTERNAL_PERSISTENT_TMP ) -+ [ -z "$LOGFILE" ] && LOGFILE=$( mktemp -p $__INTERNAL_PERSISTENT_TMP ) - [ ! -e "$LOGFILE" ] && touch "$LOGFILE" -- [ ! -w "$LOGFILE" ] && LOGFILE=$( mktemp --tmpdir=$__INTERNAL_PERSISTENT_TMP ) -+ [ ! -w "$LOGFILE" ] && LOGFILE=$( mktemp -p $__INTERNAL_PERSISTENT_TMP ) - echo -e "$MESSAGE" | tee -a $LOGFILE >&2 - return $? - } -diff --git a/src/testing.sh b/src/testing.sh -index 393a272..e5ab75d 100644 ---- a/src/testing.sh -+++ b/src/testing.sh -@@ -668,12 +668,12 @@ rlRun() { - case "$1" in - -l) - DO_LOG=true; -- [ -n "$LOG_FILE" ] || LOG_FILE=$( mktemp --tmpdir=$__INTERNAL_PERSISTENT_TMP ) -+ [ -n "$LOG_FILE" ] || LOG_FILE=$( mktemp -p $__INTERNAL_PERSISTENT_TMP ) - shift;; - -c) - DO_LOG=true; - DO_CON=true; -- [ -n "$LOG_FILE" ] || LOG_FILE=$( mktemp --tmpdir=$__INTERNAL_PERSISTENT_TMP ) -+ [ -n "$LOG_FILE" ] || LOG_FILE=$( mktemp -p $__INTERNAL_PERSISTENT_TMP ) - shift;; - -t) - DO_TAG=true; -@@ -682,7 +682,7 @@ rlRun() { - shift;; - -s) - DO_KEEP=true -- [ -n "$LOG_FILE" ] || LOG_FILE=$( mktemp --tmpdir=$__INTERNAL_PERSISTENT_TMP ) -+ [ -n "$LOG_FILE" ] || LOG_FILE=$( mktemp -p $__INTERNAL_PERSISTENT_TMP ) - shift;; - --) - shift; --- -1.9.3 - diff --git a/beakerlib.spec b/beakerlib.spec index 27753a6..3c74d7a 100644 --- a/beakerlib.spec +++ b/beakerlib.spec @@ -1,7 +1,7 @@ Name: beakerlib Summary: A shell-level integration testing library -Version: 1.10 -Release: 2%{?dist} +Version: 1.11 +Release: 1%{?dist} License: GPLv2 Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-root @@ -13,14 +13,13 @@ Requires: nfs-utils Requires: python2 Requires: grep Requires: sed +Requires: net-tools +Requires: rpm-python Obsoletes: rhtslib beaker-lib Provides: rhtslib beaker-lib BuildRequires: /usr/bin/pod2man -Patch0: 0001-Do-not-use-with-open-as-foo-construct.patch -Patch1: 0002-mi-object-does-not-have-size-in-old-pythons.patch -Patch2: 0003-Fix-mktemp-call-for-older-RHELs.patch -Patch3: do-remount-if-already-mounted.patch +Patch0: rhel5-compat.patch %description The BeakerLib project means to provide a library of various helpers, which @@ -37,10 +36,7 @@ Files for syntax highlighting BeakerLib tests in VIM editor %prep %setup -q -%patch0 -p1 -b .python-with-open -%patch1 -p1 -b .python-mi.count -%patch2 -p1 -b .mktemp -%patch3 -p1 -b .remount +%patch0 -p1 -b .rhel5-compat %build make build @@ -80,6 +76,13 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/vim/vimfiles/after/syntax/beakerlib.vim %changelog +* 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 Jun 17 2015 Fedora Release Engineering - 1.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Wed Feb 4 2015 Dalibor Pospisil - 1.10-2 - remount if mounting already mounted mount point with options, fixes bug 1173623 diff --git a/do-remount-if-already-mounted.patch b/do-remount-if-already-mounted.patch deleted file mode 100644 index fba2238..0000000 --- a/do-remount-if-already-mounted.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0474dc962be56f7292e595423c092c3d4117eb99 Mon Sep 17 00:00:00 2001 -From: Dalibor Pospisil -Date: Fri, 12 Dec 2014 15:25:56 +0100 -Subject: [PATCH 1/5] __INTERNAL_Mount: do remount if already mounted and - options specified - -If option 'rw' is specified, automatically prepend 'remount' to options if it is not already present. ---- - src/infrastructure.sh | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/infrastructure.sh b/src/infrastructure.sh -index e911fc9..29a5d43 100644 ---- a/src/infrastructure.sh -+++ b/src/infrastructure.sh -@@ -86,8 +86,12 @@ __INTERNAL_Mount(){ - - if __INTERNAL_CheckMount "$MNTPATH" - then -+ if [[ -z "$OPTIONS" ]]; then - rlLogInfo "$WHO already mounted: success" - return 0 -+ else -+ [[ "$OPTIONS" =~ remount ]] || OPTIONS="remount,$OPTIONS" -+ fi - elif [ ! -d "$MNTPATH" ] - then - rlLogInfo "$WHO creating directory $MNTPATH" --- -1.9.3 - diff --git a/rhel5-compat.patch b/rhel5-compat.patch new file mode 100644 index 0000000..36f3db8 --- /dev/null +++ b/rhel5-compat.patch @@ -0,0 +1,97 @@ +diff --git a/src/logging.sh b/src/logging.sh +index 8fc85a3..1631cf1 100644 +--- a/src/logging.sh ++++ b/src/logging.sh +@@ -55,9 +55,9 @@ Implements also phase support with automatic assert evaluation. + __INTERNAL_LogText() { + local MESSAGE=${1:-"***BAD BEAKERLIB_HLOG CALL***"} + local LOGFILE=${2:-$OUTPUTFILE} +- [ -z "$LOGFILE" ] && LOGFILE=$( mktemp --tmpdir=$__INTERNAL_PERSISTENT_TMP ) ++ [ -z "$LOGFILE" ] && LOGFILE=$( mktemp -p $__INTERNAL_PERSISTENT_TMP ) + [ ! -e "$LOGFILE" ] && touch "$LOGFILE" +- [ ! -w "$LOGFILE" ] && LOGFILE=$( mktemp --tmpdir=$__INTERNAL_PERSISTENT_TMP ) ++ [ ! -w "$LOGFILE" ] && LOGFILE=$( mktemp -p $__INTERNAL_PERSISTENT_TMP ) + echo -e "$MESSAGE" | tee -a $LOGFILE >&2 + return $? + } +diff --git a/src/python/bstor.py b/src/python/bstor.py +index 04d4dfd..a512795 100755 +--- a/src/python/bstor.py ++++ b/src/python/bstor.py +@@ -36,8 +36,9 @@ class Storage(object): + + def __save_file(self, parser): + fpath = os.path.join(self.__obtain_dir(), self.namespace) +- with open(fpath, 'w') as cfile: +- parser.write(cfile) ++ cfile = open(fpath, 'w') ++ parser.write(cfile) ++ cfile.close() + + def get(self, key): + parser = self.__obtain_file() +diff --git a/src/python/journalling.py b/src/python/journalling.py +index 324a3ad..5a4a807 100755 +--- a/src/python/journalling.py ++++ b/src/python/journalling.py +@@ -296,7 +296,7 @@ class Journal(object): + return None + + testInfo = ts.dbMatch("name", package) +- if not testInfo: ++ if not testInfo.count(): + return None + + buildtime = time.gmtime(int(testInfo.next().format("%{BUILDTIME}"))) +@@ -318,7 +318,7 @@ class Journal(object): + def getRpmVersion(xmldoc, package, rpm_ts): + rpms = [] + mi = rpm_ts.dbMatch("name", package) +- if len(mi) == 0: ++ if mi.count() == 0: + if package != 'unknown': + pkgDetailsEl = xmldoc.createElement("pkgnotinstalled") + pkgDetailsCon = xmldoc.createTextNode("%s" % package) +@@ -385,7 +385,7 @@ class Journal(object): + ts = rpm.ts() + mi = ts.dbMatch("name", "beakerlib") + beakerlibRpmEl = newdoc.createElement("beakerlib_rpm") +- if mi: ++ if mi.count(): + beakerlib_rpm = mi.next() + beakerlibRpmCon = newdoc.createTextNode("%(name)s-%(version)s-%(release)s" % beakerlib_rpm) + else: +@@ -393,7 +393,7 @@ class Journal(object): + + mi = ts.dbMatch("name", "beakerlib-redhat") + beakerlibRedhatRpmEl = newdoc.createElement("beakerlib_redhat_rpm") +- if mi: ++ if mi.count(): + beakerlib_redhat_rpm = mi.next() + beakerlibRedhatRpmCon = newdoc.createTextNode("%(name)s-%(version)s-%(release)s" % beakerlib_redhat_rpm) + else: +@@ -440,8 +440,9 @@ class Journal(object): + + releaseEl = newdoc.createElement("release") + try: +- with open("/etc/redhat-release", "r") as release_file: +- release = release_file.read().strip() ++ release_file = open("/etc/redhat-release", "r") ++ release = release_file.read().strip() ++ release_file.close() + except IOError: + release = "unknown" + release = unicode(release, 'utf-8', errors='replace') +diff --git a/src/testing.sh b/src/testing.sh +index e7c7b15..8589c1f 100644 +--- a/src/testing.sh ++++ b/src/testing.sh +@@ -711,7 +711,7 @@ rlRun() { + # create LOG_FILE if needed + if $DO_LOG || $DO_KEEP + then +- LOG_FILE=$( mktemp --tmpdir=$__INTERNAL_PERSISTENT_TMP ) ++ LOG_FILE=$( mktemp -p $__INTERNAL_PERSISTENT_TMP ) + if [ ! -e "$LOG_FILE" ] + then + rlFail "rlRun: Internal file creation failed" diff --git a/sources b/sources index c692355..2d958dd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -94276ab219a82ae98275cfb2ee928a97 beakerlib-1.10.tar.gz +550f7cb1dc391b9bb4f320dabadcddb5 beakerlib-1.11.tar.gz