[Rpm-maint] [rpm-software-management/rpm] [ppc64|s390x] 299: basic rpmio FAILED (rpmpython.at:35) (#259)
Igor Gnatenko
notifications at github.com
Wed Jul 19 10:11:05 UTC 2017
```python
299. 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
```
```diff
--- /dev/null 2017-07-18 14:03:45.950602295 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/299/stderr 2017-07-18 14:09:21.796630146 +0000
@@ -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 2017-07-18 14:03:45.950602295 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/299/stdout 2017-07-18 14:09:21.796630146 +0000
@@ -0,0 +1,2 @@
+fpio write fail
+bad end pos 7208960
./rpmpython.at:35: exit code was 1, expected 0
299. rpmpython.at:35: 299. basic rpmio (rpmpython.at:35): FAILED (rpmpython.at:35)
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/259
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20170719/f606d2a1/attachment-0001.html>
More information about the Rpm-maint
mailing list