Bug 1264463 - upstream test 257 failing on big endian systems
upstream test 257 failing on big endian systems
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rpm (Show other bugs)
7.1
s390x Linux
medium Severity low
: rc
: ---
Assigned To: Florian Festi
Karel Srot
:
Depends On:
Blocks: 1299750 1313485 1289025
  Show dependency treegraph
 
Reported: 2015-09-18 10:01 EDT by Karel Srot
Modified: 2016-11-04 00:37 EDT (History)
1 user (show)

See Also:
Fixed In Version: rpm-4.11.3-18.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-04 00:37:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Karel Srot 2015-09-18 10:01:55 EDT
Description of problem:

Upstream test 257 is failing on big endian systems pointing at a bug in rpm python binding

257. rpmpython.at:35: testing basic rpmio ...
./rpmpython.at:35:
cat << EOF > test.py
import rpm, sys
dbpath=rpm.expandMacro('%_dbpath')
rpm.addMacro('_dbpath', '${abs_builddir}/testing%s' % dbpath)
def myprint(msg = ''):
    sys.stdout.write('%s\n' % msg)

msg = 'Killroy was here\n'
data = msg * 10
# TODO: test other compression types too if built in
for iot in [ 'fpio', 'fdio', 'ufdio', 'gzdio' ]:
    fn = 'pyio.%s' % iot
    fd = rpm.fd(fn, 'w', iot)
    pos = fd.tell()
    if pos != -2 and pos != 0:
        myprint('bad start pos %d' % fd.tell())
    if fd.write(data) != len(data):
        myprint('%s write fail' % iot)
    if fn != fd.name:
        myprint('bad file name %s' % fd.name)
    fd.flush()
    pos = fd.tell()
    if pos != -2 and pos != len(data):
        myprint('bad end pos %d' % fd.tell())
    fd = rpm.fd(fn, 'r', iot)
    rdata = fd.read()
    if rdata != data:
        myprint('%s read fail (got %d bytes)' % (iot, len(rdata), rdata))
    # compressed io types can't seek
    if iot == 'ufdio':
        fd.seek(0)
    else:
        fd = rpm.fd(fn, 'r', iot)
    if fn != fd.name:
        myprint('bad file name %s' % fd.name)
    rdata = fd.read(len(msg))
    if rdata != msg:
        myprint('%s sized read fail (got %d bytes)\n%s' % (iot, len(rdata),
        rdata))

EOF
python test.py

--- /dev/null       2015-09-17 10:50:59.249741088 +0800
+++ /root/rpmbuild/BUILD/rpm-4.11.3/tests/rpmtests.dir/at-groups/257/stderr
    2015-09-17 19:17:24.384550983 +0800
@@ -0,0 +1,4 @@
+Traceback (most recent call last):
+  File "test.py", line 27, in <module>
+    myprint('%s read fail (got %d bytes)' % (iot, len(rdata), rdata))
+TypeError: not all arguments converted during string formatting
--- /dev/null       2015-09-17 10:50:59.249741088 +0800
+++ /root/rpmbuild/BUILD/rpm-4.11.3/tests/rpmtests.dir/at-groups/257/stdout
    2015-09-17 19:17:24.384550983 +0800
@@ -0,0 +1,2 @@
+fpio write fail
+bad end pos 6750208
./rpmpython.at:35: exit code was 1, expected 0
257. rpmpython.at:35: 257. basic rpmio (rpmpython.at:35): FAILED
(rpmpython.at:35)
Comment 2 Florian Festi 2015-09-22 07:05:30 EDT
While there obviously is a bug in rpm there also is one in the test case:

+Traceback (most recent call last):
+  File "test.py", line 27, in <module>
+    myprint('%s read fail (got %d bytes)' % (iot, len(rdata), rdata))
+TypeError: not all arguments converted during string formatting

You are missing another % in the message to render rdata.
Comment 3 Florian Festi 2015-09-22 07:22:05 EDT
*Eeek* Of course it is the rpm test case that is broken in addition to the problem of the Python binding.
Comment 5 Ľuboš Kardoš 2016-06-28 09:28:28 EDT
Fixed in version rpm-4.11.3-18
Comment 12 errata-xmlrpc 2016-11-04 00:37:19 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2359.html

Note You need to log in before you can comment on or make changes to this bug.