I can confirm the issue, it happens when running the testsuite without a virtualenv, i.e. with different Python module versions: 2012-12-12 17:07:38 ====================================================================== 2012-12-12 17:07:38 ERROR: test_add_image_with_image_data_as_file_with_sendfile (glance.tests.unit.test_clients.TestClient) 2012-12-12 17:07:38 ---------------------------------------------------------------------- 2012-12-12 17:07:38 Traceback (most recent call last): 2012-12-12 17:07:38 File "/var/lib/openstack-glance-test/glance/tests/utils.py", line 109, in _skipper 2012-12-12 17:07:38 func(*args, **kw) 2012-12-12 17:07:38 File "/var/lib/openstack-glance-test/glance/tests/unit/test_clients.py", line 1858, in test_add_image_with_image_data_as_file_with_sendfile 2012-12-12 17:07:38 self.add_image_with_image_data_as_file(sendfile=True) 2012-12-12 17:07:38 File "/var/lib/openstack-glance-test/glance/tests/unit/test_clients.py", line 1814, in add_image_with_image_data_as_file 2012-12-12 17:07:38 new_image = self.client.add_image(fixture, open(tmp_image_filepath)) 2012-12-12 17:07:38 File "/var/lib/openstack-glance-test/glance/client.py", line 165, in add_image 2012-12-12 17:07:38 res = self.do_request("POST", "/images", body, headers) 2012-12-12 17:07:38 File "/var/lib/openstack-glance-test/glance/common/client.py", line 63, in wrapped 2012-12-12 17:07:38 return func(self, *args, **kwargs) 2012-12-12 17:07:38 File "/var/lib/openstack-glance-test/glance/common/client.py", line 444, in do_request 2012-12-12 17:07:38 headers=headers) 2012-12-12 17:07:38 File "/var/lib/openstack-glance-test/glance/common/client.py", line 80, in wrapped 2012-12-12 17:07:38 return func(self, method, url, body, headers) 2012-12-12 17:07:38 File "/var/lib/openstack-glance-test/glance/common/client.py", line 589, in _do_request 2012-12-12 17:07:38 raise exception.ClientConnectionError(e) 2012-12-12 17:07:38 ClientConnectionError: The client disconnected while sending the POST/PUT body (19 more bytes were expected) While I haven't yet found out why, I discovered something strange: % ./run_tests.sh -N -s --pdb glance.tests.unit.test_clients:TestClient.test_add_image_with_image_data_as_file_with_sendfile /root/Projects/suse/openstack/glance/glance/tests/unit/test_clients.py:22: UserWarning: The 'glance.client' module is deprecated in favor of the 'glanceclient' module provided by python-glanceclient (see http://github.com/openstack/python-glanceclient). from glance import client TestClient test_add_image_with_image_data_as_file_with_sendfile > /root/Projects/suse/openstack/glance/glance/common/client.py(589)_do_request() -> raise exception.ClientConnectionError(e) (Pdb) l 584 else: 585 raise exception.UnexpectedStatus(status=status_code, 586 body=res.read()) 587 588 except (socket.error, IOError), e: 589 -> raise exception.ClientConnectionError(e) 590 591 def _seekable(self, body): 592 # pipes are not seekable, avoids sendfile() failure on e.g. 593 # cat /path/to/image | glance add ... 594 # or where add command is launched via popen (Pdb) up > /root/Projects/suse/openstack/glance/glance/common/client.py(80)wrapped() -> return func(self, method, url, body, headers) (Pdb) up > /root/Projects/suse/openstack/glance/glance/common/client.py(444)do_request() -> headers=headers) (Pdb) p body.read() 'chunk00000remainderchunk00000remainder' (Pdb) p body.tell() 38 Although the actual file content is only "chunk00000remainder" (len 19).