Test embedded nulls in rados data. Fix a bug in rados.Object.__str__
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
self.state = "exists"
def __str__(self):
- return "rados.Object(ioctx=%s,key=%s)" % (str(self.ioctx), self.key.value)
+ return "rados.Object(ioctx=%s,key=%s)" % (str(self.ioctx), self.key)
def require_object_exists(self):
if self.state != "exists":
for obj in foo3_ioctx.list_objects():
print str(obj)
+foo3_ioctx.write_full("ghi", "g\0h\0i")
+ghi_str = foo3_ioctx.read("ghi")
+if (ghi_str != "g\0h\0i"):
+ raise RuntimeError("error reading object ghi: expected value g\\0h\\0\i, \
+got %s" % (ghi_str))
+
# do some things with extended attributes
foo3_ioctx.set_xattr("abc", "a", "1")
foo3_ioctx.set_xattr("def", "b", "2")