Project

General

Profile

Bug #9547

python rados aio_read truncates returned buffer on \000

Added by Loïc Dachary about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
librados
Target version:
% Done:

100%

Source:
Community (dev)
Tags:
Backport:
firefly
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

diff --git a/src/test/pybind/test_rados.py b/src/test/pybind/test_rados.py
index fcbe421..c41ddef 100644
--- a/src/test/pybind/test_rados.py
+++ b/src/test/pybind/test_rados.py
@@ -288,12 +288,12 @@ class TestIoctx(object):
             with lock:
                 retval[0] = buf
                 lock.notify()
-        self.ioctx.write("foo", "bar")
+        self.ioctx.write("foo", "bar\000frob")
         self.ioctx.aio_read("foo", 7, 0, cb)
         with lock:
             while retval[0] is None:
                 lock.wait()
-        eq(retval[0], "bar")
+        eq(retval[0], "bar\000frob")
         [i.remove() for i in self.ioctx.list_objects()]

 class TestObject(object):

$ PYTHONPATH=pybind nosetests -v test/pybind/test_rados.py:TestIoctx.test_aio_read
test_rados.TestIoctx.test_aio_read ... FAIL

======================================================================
FAIL: test_rados.TestIoctx.test_aio_read
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/loic/software/ceph/ceph/src/test/pybind/test_rados.py", line 296, in test_aio_read
    eq(retval[0], "bar\000frob")
AssertionError: 'bar' != 'bar\x00frob'

----------------------------------------------------------------------
Ran 1 test in 3.080s

FAILED (failures=1)

Associated revisions

Revision 226c0c7a (diff)
Added by Loic Dachary about 9 years ago

test: check python rados aio_read with buffers containing null

http://tracker.ceph.com/issues/9547 Refs: #9547

Signed-off-by: Loic Dachary <>

Revision 2e60c2f1 (diff)
Added by Loic Dachary about 9 years ago

test: check python rados aio_read with buffers containing null

http://tracker.ceph.com/issues/9547 Refs: #9547

Signed-off-by: Loic Dachary <>
(cherry picked from commit 226c0c7ac6ee95ff2c1665d4e7164e2962c0346e)

History

#1 Updated by Loïc Dachary about 9 years ago

  • Source changed from other to Community (dev)

#3 Updated by Loïc Dachary about 9 years ago

  • Backport set to firefly

#4 Updated by Loïc Dachary about 9 years ago

running wip-9547-python-rados-truncate from https://github.com/ceph/ceph/pull/2545 on http://ceph.com/gitbuilder.cgi

#5 Updated by Loïc Dachary about 9 years ago

  • Status changed from 12 to Fix Under Review

#6 Updated by Loïc Dachary about 9 years ago

  • % Done changed from 0 to 90

#7 Updated by Loïc Dachary about 9 years ago

  • Status changed from Fix Under Review to Pending Backport

#8 Updated by Loïc Dachary about 9 years ago

  • Description updated (diff)

#9 Updated by Loïc Dachary about 9 years ago

The example from the description was not right but fixing it to have the expected length does not change the result of the failed test. The test in the commit does not have this problem.

#11 Updated by Loïc Dachary about 9 years ago

  • Status changed from Pending Backport to Resolved
  • % Done changed from 90 to 100

Also available in: Atom PDF