Project

General

Profile

Actions

Bug #9547

closed

python rados aio_read truncates returned buffer on \000

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

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

100%

Source:
Community (dev)
Tags:
Backport:
firefly
Regression:
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)
Actions #1

Updated by Loïc Dachary over 9 years ago

  • Source changed from other to Community (dev)
Actions #3

Updated by Loïc Dachary over 9 years ago

  • Backport set to firefly
Actions #4

Updated by Loïc Dachary over 9 years ago

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

Actions #5

Updated by Loïc Dachary over 9 years ago

  • Status changed from 12 to Fix Under Review
Actions #6

Updated by Loïc Dachary over 9 years ago

  • % Done changed from 0 to 90
Actions #7

Updated by Loïc Dachary over 9 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #8

Updated by Loïc Dachary over 9 years ago

  • Description updated (diff)
Actions #9

Updated by Loïc Dachary over 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.

Actions #11

Updated by Loïc Dachary over 9 years ago

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

Also available in: Atom PDF